Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / frmfmt.hxx
blob10e124c371cba2a9b7944454a34ce3bedbd65a50
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: frmfmt.hxx,v $
10 * $Revision: 1.8 $
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 _FRMFMT_HXX
31 #define _FRMFMT_HXX
33 #ifndef _FORMAT_HXX
34 #include <format.hxx>
35 #endif
36 class Graphic;
37 class Point;
39 namespace binfilter {
41 class ImageMap;
42 class SwDrawContact;
43 class SwFlyFrm;
44 class IMapObject;
45 class SwRect;
46 class SwContact;
47 class SdrObject;
49 class SwFrmFmt: public SwFmt
51 friend class SwDoc;
52 friend class SwPageDesc; //darf den protected CTor rufen.
53 friend class SwSwgReader; // der SW2-Reader auch!
54 friend class Sw3IoImp; // der SW3-Reader auch!
56 protected:
57 SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
58 SwFrmFmt *pDrvdFrm, USHORT nFmtWhich = RES_FRMFMT,
59 const USHORT* pWhichRange = 0 )
60 : SwFmt( rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
61 pDrvdFrm, nFmtWhich )
64 SwFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
65 SwFrmFmt *pDrvdFrm, USHORT nFmtWhich = RES_FRMFMT,
66 const USHORT* pWhichRange = 0 )
67 : SwFmt( rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
68 pDrvdFrm, nFmtWhich )
71 public:
72 TYPEINFO(); //Bereits in Basisklasse Client drin.
74 //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
75 virtual void DelFrms();
77 //Erzeugt die Ansichten
78 virtual void MakeFrms();
81 virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
83 // returnt das IMapObject, das an dem Format (Fly), in der ImageMap
84 // an der Point Position definiert ist.
85 // rPoint - teste auf der DocPosition
86 // pFly - optionaler FlyFrame, falls der schon bekannt ist.
88 // Gibt die tatsaechlche Groesse des Frames zurueck bzw. ein leeres
89 // Rechteck, wenn kein Layout existiert. Wird pPoint angegeben, dann
90 // wird der am dichtesten liegende Frame gesucht.
91 SwRect FindLayoutRect( const BOOL bPrtArea = FALSE,
92 const Point* pPoint = 0,
93 const BOOL bCalcFrm = FALSE ) const;
95 // Sucht das SdrObject. Der SdrObjUserCall ist Client vom Format.
96 // Der UserCall kennt sein SdrObject.
97 SwContact *FindContactObj();
98 const SwContact *FindContactObj() const
99 { return ((SwFrmFmt*)this)->FindContactObj(); }
101 // returns the SdrObject, that ist connected to the ContactObject.
102 // Only DrawFrmFmts are connected to the "real SdrObject". FlyFrmFmts
103 // are connected to a Master and all FlyFrms has the "real SdrObject".
104 // "Real SdrObject" has position and a Z-order.
105 SdrObject *FindSdrObject();
106 const SdrObject *FindSdrObject() const
107 { return ((SwFrmFmt*)this)->FindSdrObject(); }
109 SdrObject *FindRealSdrObject();
110 const SdrObject *FindRealSdrObject() const
111 { return ((SwFrmFmt*)this)->FindRealSdrObject(); }
114 DECL_FIXEDMEMPOOL_NEWDEL(SwFrmFmt)
117 //Das FlyFrame-Format ------------------------------
119 class SwFlyFrmFmt: public SwFrmFmt
121 friend class SwDoc;
123 //Beide nicht vorhanden.
124 SwFlyFrmFmt( const SwFlyFrmFmt &rCpy );
125 SwFlyFrmFmt &operator=( const SwFlyFrmFmt &rCpy );
127 protected:
128 SwFlyFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
129 SwFrmFmt *pDrvdFrm )
130 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FLYFRMFMT )
132 SwFlyFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
133 SwFrmFmt *pDrvdFrm )
134 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FLYFRMFMT )
137 public:
138 TYPEINFO();
139 ~SwFlyFrmFmt();
141 //Erzeugt die Ansichten
142 virtual void MakeFrms();
144 SwFlyFrm* GetFrm( const Point* pDocPos = 0,
145 const BOOL bCalcFrm = FALSE ) const;
148 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
150 /** SwFlyFrmFmt::IsBackgroundTransparent - for #99657#
152 OD 22.08.2002 - overloading virtual method and its default implementation,
153 because format of fly frame provides transparent backgrounds.
154 Method determines, if background of fly frame is transparent.
156 @author OD
158 @return true, if background color is transparent, but not "no fill"
159 or a existing background graphic is transparent.
161 virtual const sal_Bool IsBackgroundTransparent() const;
163 /** SwFlyFrmFmt::IsBackgroundBrushInherited - for #103898#
165 OD 08.10.2002 - method to determine, if the brush for drawing the
166 background is "inherited" from its parent/grandparent.
167 This is the case, if no background graphic is set and the background
168 color is "no fill"/"auto fill"
170 @author OD
172 @return true, if background brush is "inherited" from parent/grandparent
174 const sal_Bool IsBackgroundBrushInherited() const;
176 DECL_FIXEDMEMPOOL_NEWDEL(SwFlyFrmFmt)
179 //Das DrawFrame-Format -----------------------------
181 class SwDrawFrmFmt: public SwFrmFmt
183 friend class SwDoc;
185 //Beide nicht vorhanden.
186 SwDrawFrmFmt( const SwDrawFrmFmt &rCpy );
187 SwDrawFrmFmt &operator=( const SwDrawFrmFmt &rCpy );
189 protected:
190 SwDrawFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
191 SwFrmFmt *pDrvdFrm )
192 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_DRAWFRMFMT )
194 SwDrawFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
195 SwFrmFmt *pDrvdFrm )
196 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_DRAWFRMFMT )
199 public:
200 TYPEINFO();
201 ~SwDrawFrmFmt();
203 //DrawObjecte werden aus den Arrays am Layout entfernt. Die DrawObjecte
204 //werden als geloescht gekennzeichnet.
205 virtual void DelFrms();
207 //Anmelden der DrawObjecte in den Arrays am Layout. Loeschkennzeichen
208 //werden zurueckgesetzt.
209 virtual void MakeFrms();
213 DECL_FIXEDMEMPOOL_NEWDEL(SwDrawFrmFmt);
217 } //namespace binfilter
218 #endif