1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: frmdescr.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SFX_FRMDESCRHXX
31 #define _SFX_FRMDESCRHXX
33 #include <bf_sfx2/sfxsids.hrc>
35 #ifndef _SFXPOOLITEM_HXX //autogen
36 #include <bf_svtools/poolitem.hxx>
38 #ifndef _URLOBJ_HXX //autogen
39 #include <tools/urlobj.hxx>
41 #ifndef _STRING_HXX //autogen
42 #include <tools/string.hxx>
44 #ifndef _SVARRAY_HXX //autogen
45 #include <bf_svtools/svarray.hxx>
48 #include <tools/gen.hxx>
56 struct SfxFrameDescriptor_Impl
;
57 struct SfxFrameSetDescriptor_Impl
;
58 class SfxFrameDescriptor
;
59 typedef SfxFrameDescriptor
* SfxFrameDescriptorPtr
;
60 SV_DECL_PTRARR(SfxFramesArr
, SfxFrameDescriptorPtr
, 4, 2)//STRIP008 ;
62 //===========================================================================
63 // Die SfxFrame...descriptoren bauen eine rekursive Struktur auf, die
64 // s"amtliche zur Anzeige des Frame-Dokuments erforderlichen Daten umfa\st.
65 // "Uber einen SfxFrameSetDescriptor hat man Zugriff auf die gesamte darunter
67 // Aufgrund der besonderen Eigenschaften des SfxFrames-Dokuments ist ein
68 // SfxFramesSetDescriptor nicht nur der Inhalt dieses Dokuments, sondern
69 // beschreibt auch die View darauf.
70 // Das FrameSet wird aus Zeilen aufgebaut, die wiederum die eigentlichen
71 // Fenster enthalten. Eine Zeile kann horizontal oder vertikal ausgerichtet
72 // sein, woraus sich auch das Alignment des FrameSets ergibt.
73 //===========================================================================
92 #define SPACING_NOT_SET -1L
93 #define SIZE_NOT_SET -1L
95 class SfxFrameSetDescriptor
97 friend class SfxFrameDescriptor
;
101 SfxFrameSetDescriptor_Impl
* pImp
;
102 String aDocumentTitle
;
103 SfxFrameDescriptor
* pParentFrame
;
110 SvStrings
* pComments
;
113 struct SfxFrameProperties
;
115 class SfxFrameDescriptor
117 friend class SfxFrameSetDescriptor
;
119 SfxFrameSetDescriptor
* pParentFrameSet
; // Der Vater
120 SfxFrameSetDescriptor
* pFrameSet
; // Wenn Kinder da sind, die
123 INetURLObject aActualURL
;
127 ScrollingMode eScroll
;
128 SizeSelector eSizeSelector
;
131 BOOL bResizeHorizontal
;
132 BOOL bResizeVertical
;
135 SfxFrameDescriptor_Impl
* pImp
;
137 SvStrings
* pComments
;
140 SfxFrameDescriptor(SfxFrameSetDescriptor
* pSet
);
141 ~SfxFrameDescriptor();
146 const INetURLObject
& GetURL() const
148 void SetURL( const String
& rURL
);
149 const INetURLObject
& GetActualURL() const
150 { return aActualURL
; }
151 void SetReadOnly( BOOL bSet
) { bReadOnly
= bSet
;}
152 BOOL
IsReadOnly( ) const { return bReadOnly
;}
155 void SetWidth( long n
)
157 void SetWidthPercent( long n
)
158 { nWidth
= n
; eSizeSelector
= SIZE_PERCENT
; }
159 void SetWidthRel( long n
)
160 { nWidth
= n
; eSizeSelector
= SIZE_REL
; }
161 void SetWidthAbs( long n
)
162 { nWidth
= n
; eSizeSelector
= SIZE_ABS
; }
163 long GetWidth() const
165 SizeSelector
GetSizeSelector() const
166 { return eSizeSelector
; }
167 BOOL
IsResizable() const
168 { return bResizeHorizontal
&& bResizeVertical
; }
169 void SetResizable( BOOL bRes
)
170 { bResizeHorizontal
= bResizeVertical
= bRes
; }
173 const String
& GetName() const
175 void SetName( const String
& rName
)
179 const Size
& GetMargin() const
181 void SetMargin( const Size
& rMargin
)
182 { aMargin
= rMargin
; }
183 ScrollingMode
GetScrollingMode() const
185 void SetScrollingMode( ScrollingMode eMode
)
188 BOOL
IsFrameBorderOn() const
189 { return ( nHasBorder
& BORDER_YES
) != 0; }
191 void SetFrameBorder( BOOL bBorder
)
193 nHasBorder
= bBorder
?
194 BORDER_YES
| BORDER_SET
:
195 BORDER_NO
| BORDER_SET
;
197 BOOL
IsFrameBorderSet() const
198 { return (nHasBorder
& BORDER_SET
) != 0; }
204 void SetHasUI( BOOL bOn
)
207 // Attribute f"ur das Splitwindow
208 USHORT
GetItemId() const
210 void SetItemId( USHORT nId
)
213 // Rekursion, Iteration
214 SfxFrameSetDescriptor
* GetParent() const
215 { return pParentFrameSet
; }
216 SfxFrameSetDescriptor
* GetFrameSet() const
217 { return pFrameSet
; }
218 void SetFrameSet( SfxFrameSetDescriptor
* pSet
)
221 pFrameSet
->pParentFrame
= NULL
;
224 pSet
->pParentFrame
= this;
227 // Kopie z.B. f"ur die Views
228 SfxFrameDescriptor
* Clone(SfxFrameSetDescriptor
*pFrame
=NULL
, BOOL bWithIds
= TRUE
) const;
232 // Kein Bock, einen operator= zu implementieren...
233 struct SfxFrameProperties
242 long lInheritedFrameSpacing
;
243 ScrollingMode eScroll
;
244 SizeSelector eSizeSelector
;
245 SizeSelector eSetSizeSelector
;
252 BOOL bHasBorderInherited
;
253 SfxFrameDescriptor
* pFrame
;
256 SfxFrameProperties( SfxFrameProperties
& ) {}
260 lMarginWidth( SIZE_NOT_SET
),
261 lMarginHeight( SIZE_NOT_SET
),
264 lFrameSpacing( SPACING_NOT_SET
),
265 lInheritedFrameSpacing( SPACING_NOT_SET
),
266 eScroll( ScrollingAuto
),
267 eSizeSelector( SIZE_REL
),
268 eSetSizeSelector( SIZE_REL
),
270 bHasBorderInherited( TRUE
),
273 bSetResizable( TRUE
),
275 bIsInColSet( FALSE
) {}
277 ~SfxFrameProperties() { delete pFrame
; }
279 int operator ==( const SfxFrameProperties
& ) const;
280 SfxFrameProperties
& operator =( const SfxFrameProperties
&rProp
);
283 class SfxFrameDescriptorItem
: public SfxPoolItem
285 SfxFrameProperties aProperties
;
289 SfxFrameDescriptorItem ( const USHORT nId
= SID_FRAMEDESCRIPTOR
)
293 SfxFrameDescriptorItem( const SfxFrameDescriptorItem
& rCpy
)
294 : SfxPoolItem( rCpy
)
296 aProperties
= rCpy
.aProperties
;
299 virtual ~SfxFrameDescriptorItem();
301 virtual int operator ==( const SfxPoolItem
& ) const;
302 SfxFrameDescriptorItem
& operator =( const SfxFrameDescriptorItem
& );
304 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
305 SfxMapUnit eCoreMetric
,
306 SfxMapUnit ePresMetric
,
307 UniString
&rText
, const ::IntlWrapper
* = 0 ) const;
309 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
310 //virtual SfxPoolItem* Create(SvStream &, USHORT) const;
311 //virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
312 //virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
314 const SfxFrameProperties
& GetProperties() const
315 { return aProperties
; }
316 void SetProperties( const SfxFrameProperties
& rProp
)
317 { aProperties
= rProp
; }
320 }//end of namespace binfilter
321 #endif // #ifndef _SFX_FRMDESCRHXX