Update ooo320-m1
[ooovba.git] / sw / source / core / inc / flyfrms.hxx
blob0980bbff181c0e30c8fc040ece7d61c1cdcc6610
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: flyfrms.hxx,v $
10 * $Revision: 1.14 $
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 _FLYFRMS_HXX
31 #define _FLYFRMS_HXX
32 #include "flyfrm.hxx"
33 // --> OD 2004-06-23 #i28701#
34 class SwFlyAtCntFrm;
36 //Basisklasse fuer diejenigen Flys, die sich relativ frei Bewegen koennen -
37 //also die nicht _im_ Inhalt gebundenen Flys.
38 class SwFlyFreeFrm : public SwFlyFrm
40 SwPageFrm *pPage; //Bei dieser Seite ist der Fly angemeldet.
42 // --> OD 2004-11-15 #i34753# - flag for at-page anchored Writer fly frames
43 // to prevent a positioning - call of method <MakeObjPos()> -, if Writer
44 // fly frame is already clipped during its format by the object formatter.
45 bool mbNoMakePos;
46 // <--
47 // --> OD 2004-11-12 #i37068# - flag to prevent move in method
48 // <CheckClip(..)>
49 bool mbNoMoveOnCheckClip;
50 // <--
51 void CheckClip( const SwFmtFrmSize &rSz ); //'Emergency' Clipping.
53 /** determines, if direct environment of fly frame has 'auto' size
55 OD 07.08.2003 #i17297#, #111066#, #111070#
56 start with anchor frame and search for a header, footer, row or fly frame
57 stopping at page frame.
58 return <true>, if such a frame is found and it has 'auto' size.
59 otherwise <false> is returned.
61 @author OD
63 @return boolean indicating, that direct environment has 'auto' size
65 bool HasEnvironmentAutoSize() const;
67 protected:
68 // OD 2004-05-12 #i28701# - new friend class <SwFlyNotify> for access to
69 // method <NotifyBackground>
70 friend class SwFlyNotify;
71 virtual void NotifyBackground( SwPageFrm *pPage,
72 const SwRect& rRect, PrepareHint eHint);
74 SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
76 public:
77 // --> OD 2004-06-29 #i28701#
78 TYPEINFO();
80 virtual ~SwFlyFreeFrm();
82 virtual void MakeAll();
84 // --> OD 2004-11-12 #i37068# - accessors for member <mbNoMoveOnCheckClip>
85 inline void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
87 mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
89 inline bool IsNoMoveOnCheckClip() const
91 return mbNoMoveOnCheckClip;
93 // <--
94 // --> OD 2004-11-15 #i34753# - accessors for member <mbNoMakePos>
95 inline void SetNoMakePos( const bool _bNoMakePos )
97 if ( IsFlyLayFrm() )
99 mbNoMakePos = _bNoMakePos;
102 inline bool IsNoMakePos() const
104 if ( IsFlyLayFrm() )
106 return mbNoMakePos;
108 else
110 return false;
113 // <--
115 /** method to determine, if a format on the Writer fly frame is possible
117 OD 2004-05-11 #i28701#
118 refine 'IsFormatPossible'-conditions of method
119 <SwFlyFrm::IsFormatPossible()> by:
120 format isn't possible, if Writer fly frame isn't registered at a page frame
121 and its anchor frame isn't inside another Writer fly frame.
123 @author OD
125 virtual bool IsFormatPossible() const;
129 //Die Fly's, die an einem Layoutfrm haengen und nicht inhaltsgebunden sind
130 class SwFlyLayFrm : public SwFlyFreeFrm
132 public:
133 // --> OD 2004-06-29 #i28701#
134 TYPEINFO();
136 SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
137 SwFlyLayFrm( SwFlyLayFrm& );
139 virtual void Modify( SfxPoolItem*, SfxPoolItem* );
143 //Die Flys, die an einem Cntnt haengen nicht aber im Inhalt
144 class SwFlyAtCntFrm : public SwFlyFreeFrm
146 protected:
147 virtual void MakeAll();
149 // OD 2004-05-12 #i28701#
150 virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
152 /** method to assure that anchored object is registered at the correct
153 page frame
155 OD 2004-07-02 #i28701#
157 @author OD
159 virtual void RegisterAtCorrectPage();
161 public:
162 // --> OD 2004-06-29 #i28701#
163 TYPEINFO();
165 SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
167 virtual void Modify( SfxPoolItem*, SfxPoolItem* );
169 void SetAbsPos( const Point &rNew );
171 // OD 2004-03-23 #i26791#
172 virtual void MakeObjPos();
174 /** method to determine, if a format on the Writer fly frame is possible
176 OD 2004-05-11 #i28701#
177 refine 'IsFormatPossible'-conditions of method
178 <SwFlyFreeFrm::IsFormatPossible()> by:
179 format isn't possible, if method <MakeAll()> is already in progress.
181 @author OD
183 virtual bool IsFormatPossible() const;
186 //Die Flys, die an einem Zeichen in einem Cntnt haengen.
187 class SwFlyInCntFrm : public SwFlyFrm
189 Point aRef; //Relativ zu diesem Point wird die AbsPos berechnet.
190 long nLine; //Zeilenhoehe, Ref.Y() - nLine == Zeilenanfang.
192 BOOL bInvalidLayout :1;
193 BOOL bInvalidCntnt :1;
195 protected:
196 virtual void NotifyBackground( SwPageFrm *pPage,
197 const SwRect& rRect, PrepareHint eHint);
198 virtual void MakeAll();
200 public:
201 // --> OD 2004-06-29 #i28701#
202 TYPEINFO();
204 SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
206 virtual ~SwFlyInCntFrm();
207 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
208 virtual void Modify( SfxPoolItem*, SfxPoolItem* );
210 void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
211 const Point &rRelPos );
212 const Point &GetRefPoint() const { return aRef; }
213 const Point GetRelPos() const;
214 long GetLineHeight() const { return nLine; }
216 inline void InvalidateLayout() const;
217 inline void InvalidateCntnt() const;
218 inline void ValidateLayout() const;
219 inline void ValidateCntnt() const;
220 BOOL IsInvalid() const { return (bInvalidLayout || bInvalidCntnt); }
221 BOOL IsInvalidLayout() const { return bInvalidLayout; }
222 BOOL IsInvalidCntnt() const { return bInvalidCntnt; }
225 //BP 26.11.93: vgl. tabfrm.hxx, gilt bestimmt aber fuer andere auch...
226 //Zum Anmelden der Flys nachdem ein FlyCnt erzeugt _und_ eingefuegt wurde.
227 //Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird
228 //Das Teil gepastet; mithin ist auch erst dann die Seite zum Anmelden der
229 //Flys erreichbar.
230 void RegistFlys();
232 //siehe layact.cxx
233 void AddRefOfst( long nOfst ) { aRef.Y() += nOfst; }
235 // OD 2004-03-23 #i26791#
236 virtual void MakeObjPos();
238 // --> OD 2004-12-02 #115759# - invalidate anchor frame on invalidation
239 // of the position, because the position is calculated during the
240 // format of the anchor frame
241 virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
242 // <--
245 inline void SwFlyInCntFrm::InvalidateLayout() const
247 ((SwFlyInCntFrm*)this)->bInvalidLayout = TRUE;
249 inline void SwFlyInCntFrm::InvalidateCntnt() const
251 ((SwFlyInCntFrm*)this)->bInvalidCntnt = TRUE;
253 inline void SwFlyInCntFrm::ValidateLayout() const
255 ((SwFlyInCntFrm*)this)->bInvalidLayout = FALSE;
257 inline void SwFlyInCntFrm::ValidateCntnt() const
259 ((SwFlyInCntFrm*)this)->bInvalidCntnt = FALSE;
262 #endif