1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SFX_FRMDESCRHXX
20 #define _SFX_FRMDESCRHXX
22 #include <rtl/ustring.hxx>
23 #include <sal/config.h>
24 #include <sfx2/dllapi.h>
25 #include <sfx2/sfxsids.hrc>
26 #include <svl/poolitem.hxx>
27 #include <tools/gen.hxx>
28 #include <tools/urlobj.hxx>
31 struct SfxFrameDescriptor_Impl
;
32 class SfxFrameDescriptor
;
35 //===========================================================================
36 // The SfxFrame descriptors build a recursive structure, that covers all the
37 // required data in-order to display the frame document.
38 // Through a SfxFrameSetDescriptor access is given to the whole underlying
39 // structure. Due to the nature of the SfxFrames document, the
40 // SfxFramesSetDescriptor is not only the content of this document, but also
41 // describes the view on it. The FrameSet is made up of lines, which in turn,
42 // contains the actual window . A line can be horizontally or vertically
43 // aligned, from which also the alignment of the FrameSet is given.
44 //===========================================================================
63 #define SPACING_NOT_SET -1L
64 #define SIZE_NOT_SET -1L
67 struct SfxFrameProperties
;
69 class SFX2_DLLPUBLIC SfxFrameDescriptor
72 INetURLObject aActualURL
;
76 ScrollingMode eScroll
;
77 SizeSelector eSizeSelector
;
78 sal_uInt16 nHasBorder
;
80 sal_Bool bResizeHorizontal
;
81 sal_Bool bResizeVertical
;
84 SfxFrameDescriptor_Impl
* pImp
;
88 ~SfxFrameDescriptor();
91 SfxItemSet
* GetArgs();
92 const INetURLObject
& GetURL() const
94 void SetURL( const OUString
& rURL
);
95 const INetURLObject
& GetActualURL() const
96 { return aActualURL
; }
97 void SetActualURL( const INetURLObject
& rURL
);
98 void SetActualURL( const OUString
& rURL
);
99 void SetReadOnly( sal_Bool bSet
) { bReadOnly
= bSet
;}
100 sal_Bool
IsReadOnly( ) const { return bReadOnly
;}
101 void SetEditable( sal_Bool bSet
);
102 sal_Bool
IsEditable() const;
105 void SetWidth( long n
)
107 void SetWidthPercent( long n
)
108 { nWidth
= n
; eSizeSelector
= SIZE_PERCENT
; }
109 void SetWidthRel( long n
)
110 { nWidth
= n
; eSizeSelector
= SIZE_REL
; }
111 void SetWidthAbs( long n
)
112 { nWidth
= n
; eSizeSelector
= SIZE_ABS
; }
113 long GetWidth() const
115 SizeSelector
GetSizeSelector() const
116 { return eSizeSelector
; }
117 sal_Bool
IsResizable() const
118 { return bResizeHorizontal
&& bResizeVertical
; }
119 void SetResizable( sal_Bool bRes
)
120 { bResizeHorizontal
= bResizeVertical
= bRes
; }
123 const OUString
& GetName() const
125 void SetName( const OUString
& rName
)
129 const Size
& GetMargin() const
131 void SetMargin( const Size
& rMargin
)
132 { aMargin
= rMargin
; }
133 ScrollingMode
GetScrollingMode() const
135 void SetScrollingMode( ScrollingMode eMode
)
139 void SetWallpaper( const Wallpaper
& rWallpaper
);
140 sal_Bool
HasFrameBorder() const;
142 sal_Bool
IsFrameBorderOn() const
143 { return ( nHasBorder
& BORDER_YES
) != 0; }
145 void SetFrameBorder( sal_Bool bBorder
)
147 nHasBorder
= bBorder
?
148 BORDER_YES
| BORDER_SET
:
149 BORDER_NO
| BORDER_SET
;
151 sal_Bool
IsFrameBorderSet() const
152 { return (nHasBorder
& BORDER_SET
) != 0; }
156 sal_Bool
HasUI() const
158 void SetHasUI( sal_Bool bOn
)
161 // Attribute for Splitwindow
162 sal_uInt16
GetItemId() const
164 void SetItemId( sal_uInt16 nId
)
167 // Copy for example for Views
168 SfxFrameDescriptor
* Clone( sal_Bool bWithIds
= sal_True
) const;
171 // No block to implement a =operator
172 struct SfxFrameProperties
181 long lInheritedFrameSpacing
;
182 ScrollingMode eScroll
;
183 SizeSelector eSizeSelector
;
184 SizeSelector eSetSizeSelector
;
188 sal_Bool bSetResizable
;
190 sal_Bool bIsInColSet
;
191 sal_Bool bHasBorderInherited
;
192 SfxFrameDescriptor
* pFrame
;
195 SfxFrameProperties( SfxFrameProperties
& ) {}
198 : lMarginWidth( SIZE_NOT_SET
),
199 lMarginHeight( SIZE_NOT_SET
),
202 lFrameSpacing( SPACING_NOT_SET
),
203 lInheritedFrameSpacing( SPACING_NOT_SET
),
204 eScroll( ScrollingAuto
),
205 eSizeSelector( SIZE_REL
),
206 eSetSizeSelector( SIZE_REL
),
207 bHasBorder( sal_True
),
208 bBorderSet( sal_True
),
209 bResizable( sal_True
),
210 bSetResizable( sal_True
),
211 bIsRootSet( sal_False
),
212 bIsInColSet( sal_False
),
213 bHasBorderInherited( sal_True
),
216 ~SfxFrameProperties() { delete pFrame
; }
218 int operator ==( const SfxFrameProperties
& ) const;
219 SfxFrameProperties
& operator =( const SfxFrameProperties
&rProp
);
222 class SfxFrameDescriptorItem
: public SfxPoolItem
224 SfxFrameProperties aProperties
;
228 SfxFrameDescriptorItem ( const sal_uInt16 nId
= SID_FRAMEDESCRIPTOR
)
232 SfxFrameDescriptorItem( const SfxFrameDescriptorItem
& rCpy
)
233 : SfxPoolItem( rCpy
)
235 aProperties
= rCpy
.aProperties
;
238 virtual ~SfxFrameDescriptorItem();
240 virtual int operator ==( const SfxPoolItem
& ) const;
241 SfxFrameDescriptorItem
& operator =( const SfxFrameDescriptorItem
& );
243 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
244 SfxMapUnit eCoreMetric
,
245 SfxMapUnit ePresMetric
,
246 OUString
&rText
, const IntlWrapper
* = 0 ) const;
248 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
250 const SfxFrameProperties
& GetProperties() const
251 { return aProperties
; }
252 void SetProperties( const SfxFrameProperties
& rProp
)
253 { aProperties
= rProp
; }
256 #endif // #ifndef _SFX_FRMDESCRHXX
258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */