/src/libreoffice/include/sfx2/frmdescr.hxx
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | #ifndef INCLUDED_SFX2_FRMDESCR_HXX |
20 | | #define INCLUDED_SFX2_FRMDESCR_HXX |
21 | | |
22 | | #include <memory> |
23 | | #include <rtl/ustring.hxx> |
24 | | #include <sal/config.h> |
25 | | #include <sfx2/dllapi.h> |
26 | | #include <tools/gen.hxx> |
27 | | #include <tools/urlobj.hxx> |
28 | | |
29 | | // The SfxFrame descriptors build a recursive structure, that covers all the |
30 | | // required data in-order to display the frame document. |
31 | | // Through a SfxFrameSetDescriptor access is given to the whole underlying |
32 | | // structure. Due to the nature of the SfxFrames document, the |
33 | | // SfxFramesSetDescriptor is not only the content of this document, but also |
34 | | // describes the view on it. The FrameSet is made up of lines, which in turn, |
35 | | // contains the actual window . A line can be horizontally or vertically |
36 | | // aligned, from which also the alignment of the FrameSet is given. |
37 | | |
38 | | |
39 | | enum class ScrollingMode |
40 | | { |
41 | | Yes, |
42 | | No, |
43 | | Auto |
44 | | }; |
45 | | |
46 | 0 | #define SIZE_NOT_SET -1L |
47 | | |
48 | | class SfxItemSet; |
49 | | |
50 | | class SFX2_DLLPUBLIC SfxFrameDescriptor |
51 | | { |
52 | | INetURLObject aURL; |
53 | | OUString aName; |
54 | | Size aMargin; |
55 | | ScrollingMode eScroll; |
56 | | bool bHasBorder; |
57 | | bool bHasBorderSet; |
58 | | std::unique_ptr<SfxItemSet> m_pArgs; |
59 | | |
60 | | public: |
61 | | SfxFrameDescriptor(); |
62 | | ~SfxFrameDescriptor(); |
63 | | |
64 | | // FileName/URL |
65 | | SfxItemSet* GetArgs(); |
66 | | const INetURLObject& GetURL() const |
67 | 0 | { return aURL; } |
68 | | void SetURL( std::u16string_view rURL ); |
69 | | void SetActualURL(); |
70 | | |
71 | | // FrameName |
72 | | const OUString& GetName() const |
73 | 0 | { return aName; } |
74 | | void SetName( const OUString& rName ) |
75 | 89 | { aName = rName; } |
76 | | |
77 | | // Margin, Scrolling |
78 | | const Size& GetMargin() const |
79 | 4.66k | { return aMargin; } |
80 | | void SetMargin( const Size& rMargin ) |
81 | 4.66k | { aMargin = rMargin; } |
82 | | ScrollingMode GetScrollingMode() const |
83 | 0 | { return eScroll; } |
84 | | void SetScrollingMode( ScrollingMode eMode ) |
85 | 154 | { eScroll = eMode; } |
86 | | |
87 | | // FrameBorder |
88 | | bool HasFrameBorder() const |
89 | 0 | { return bHasBorder; } |
90 | | bool IsFrameBorderOn() const |
91 | 0 | { return bHasBorder; } |
92 | | void SetFrameBorder( bool bBorder ) |
93 | 235 | { bHasBorder = bBorder; bHasBorderSet = true; } |
94 | | bool IsFrameBorderSet() const |
95 | 0 | { return bHasBorderSet; } |
96 | | void ResetBorder() |
97 | 0 | { bHasBorder = false; bHasBorderSet = false; } |
98 | | }; |
99 | | |
100 | | #endif // INCLUDED_SFX2_FRMDESCR_HXX |
101 | | |
102 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |