2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* $RCSfile: flyfrm.hxx,v $
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* $Revision: 1.15 $
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* last change: $Author: rt $ $Date: 2005-09-09 03:46:47 $
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2005-09-09 02:46:47 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _FLYFRM_HXX
|
|
|
|
#define _FLYFRM_HXX
|
|
|
|
|
|
|
|
#include "layfrm.hxx"
|
|
|
|
|
|
|
|
class SwPageFrm;
|
|
|
|
class SwFlyFrmFmt;
|
|
|
|
class SwFmtFrmSize;
|
|
|
|
struct SwCrsrMoveState;
|
|
|
|
class SwBorderAttrs;
|
|
|
|
class SwVirtFlyDrawObj;
|
|
|
|
class SwSpzFrmFmts;
|
|
|
|
class SwAttrSetChg;
|
|
|
|
class PolyPolygon;
|
|
|
|
|
|
|
|
#include <orntenum.hxx>
|
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-03-22 #i26791#
|
|
|
|
#ifndef _ANCHOREDOBJECT_HXX
|
|
|
|
#include <anchoredobject.hxx>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen.
|
|
|
|
//Wird beim Draggen von Absatzgebundenen Objekten zur Ankeranzeige sowie
|
|
|
|
//fuer Ankerwechsel benoetigt.
|
|
|
|
//implementiert in layout/flycnt.cxx
|
|
|
|
const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
|
|
|
|
const BOOL bBody = FALSE );
|
|
|
|
|
|
|
|
// berechnet das Rechteck, in dem das Objekt bewegt bzw. resized werden darf
|
|
|
|
BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove = TRUE );
|
|
|
|
|
|
|
|
//allg. Basisklasse fuer alle Freifliegenden Rahmen
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-03-22 #i26791# - inherit also from <SwAnchoredFlyFrm>
|
|
|
|
class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//darf Locken. Definiert in frmtool.cxx
|
|
|
|
friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * );
|
|
|
|
friend void AppendAllObjs( const SwSpzFrmFmts * );
|
2004-02-16 10:57:21 +00:00
|
|
|
friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld,
|
|
|
|
const SwRect* pOldPrt );
|
2004-02-02 17:18:30 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void InitDrawObj( BOOL bNotify ); //Wird von den CToren gerufen.
|
|
|
|
void FinitDrawObj(); //Wird vom CTor gerufen.
|
|
|
|
|
|
|
|
void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
|
|
|
|
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
|
|
|
|
*pNextLink; // Textfluss
|
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
|
|
|
|
// Point aRelPos; //Die Relative Position zum Master
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BOOL bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
|
|
|
|
//koennen, dass sie nicht Formatiert werden; :MakeAll
|
|
|
|
//returnt dann sofort. Dies ist bei Seitenwechseln
|
|
|
|
//waehrend der Formatierung notwendig.
|
|
|
|
//Auch wahrend des RootCTors ist dies notwendig da
|
|
|
|
//sonst der Anker formatiert wird obwohl die Root noch
|
|
|
|
//nicht korrekt an der Shell haengt und weil sonst
|
|
|
|
//initial zuviel Formatiert wuerde.
|
|
|
|
BOOL bNotifyBack:1; //TRUE wenn am Ende eines MakeAll() der Background
|
|
|
|
//vom NotifyDTor benachrichtigt werden muss.
|
|
|
|
protected:
|
|
|
|
|
|
|
|
BOOL bInvalid :1; //Pos, PrtArea od. SSize wurden Invalidiert, sie werden
|
|
|
|
//gleich wieder Validiert, denn sie muessen _immer_
|
|
|
|
//gueltig sein. Damit in LayAction korrekt gearbeitet
|
|
|
|
//werden kann muss hier festgehalten werden, dass sie
|
|
|
|
//invalidiert wurden. Ausnahmen bestaetigen die Regelt!
|
|
|
|
BOOL bMinHeight:1; //TRUE wenn die vom Attribut vorgegebene Hoehe eine
|
|
|
|
//eine Minimalhoehe ist (der Frm also bei Bedarf
|
|
|
|
//darueberhinaus wachsen kann).
|
|
|
|
BOOL bHeightClipped :1; //TRUE wenn der Fly nicht die Pos/Size anhand der Attrs
|
|
|
|
BOOL bWidthClipped :1; //formatieren konnte, weil z.B. nicht genug Raum vorh.
|
|
|
|
//war.
|
|
|
|
BOOL bFormatHeightOnly :1; //Damit nach einer Anpassung der Breite
|
|
|
|
//(CheckClip) nur das Format aufgerufen wird;
|
|
|
|
//nicht aber die Breite anhand der Attribute
|
|
|
|
//wieder bestimmt wird.
|
|
|
|
BOOL bInCnt :1; // FLY_IN_CNTNT, als Zeichen verankert
|
|
|
|
BOOL bAtCnt :1; // FLY_AT_CNTNT, am Absatz verankert
|
|
|
|
BOOL bLayout :1; // FLY_PAGE, FLY_AT_FLY, an Seite oder Rahmen
|
|
|
|
BOOL bAutoPosition :1; // FLY_AUTO_CNTNT, im Text verankerter Rahmen
|
2002-07-08 07:26:15 +00:00
|
|
|
BOOL bNoShrink :1; // temporary forbud of shrinking to avoid loops
|
2004-02-26 14:28:03 +00:00
|
|
|
BOOL bLockDeleteContent :1; // If the flag is set, the content of the
|
|
|
|
// fly frame is not deleted if moved to
|
|
|
|
// invisible layer.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
friend class SwNoTxtFrm; // Darf NotifyBackground rufen
|
2004-08-02 13:04:36 +00:00
|
|
|
// virtual void NotifyBackground( SwPageFrm *pPage,
|
|
|
|
// const SwRect& rRect, PrepareHint eHint) = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
|
|
|
|
void MakePrtArea( const SwBorderAttrs &rAttrs );
|
|
|
|
|
|
|
|
void Lock() { bLocked = TRUE; }
|
|
|
|
void Unlock() { bLocked = FALSE; }
|
|
|
|
|
|
|
|
void SetMinHeight() { bMinHeight = TRUE; }
|
|
|
|
void ResetMinHeight(){ bMinHeight = FALSE; }
|
|
|
|
|
|
|
|
Size CalcRel( const SwFmtFrmSize &rSz ) const;
|
2004-05-18 13:50:00 +00:00
|
|
|
SwTwips CalcAutoWidth() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwFlyFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
|
2004-02-26 14:28:03 +00:00
|
|
|
|
2004-08-02 13:04:36 +00:00
|
|
|
/** method to assure that anchored object is registered at the correct
|
|
|
|
page frame
|
|
|
|
|
|
|
|
OD 2004-07-02 #i28701#
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
*/
|
|
|
|
virtual void RegisterAtCorrectPage();
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-03-23 #i26791#
|
|
|
|
TYPEINFO();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual ~SwFlyFrm();
|
|
|
|
virtual void Modify( SfxPoolItem*, SfxPoolItem* );
|
|
|
|
// erfrage vom Client Informationen
|
|
|
|
virtual BOOL GetInfo( SfxPoolItem& ) const;
|
|
|
|
virtual void Paint( const SwRect& ) const;
|
|
|
|
virtual void ChgSize( const Size& aNewSize );
|
|
|
|
virtual BOOL GetCrsrOfst( SwPosition *, Point&,
|
2004-05-17 15:15:11 +00:00
|
|
|
SwCrsrMoveState* = 0 ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-06-19 13:33:21 +00:00
|
|
|
virtual void CheckDirection( BOOL bVert );
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual void Cut();
|
|
|
|
#ifndef PRODUCT
|
|
|
|
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
|
|
|
|
#endif
|
|
|
|
|
2001-10-19 09:25:19 +00:00
|
|
|
SwTwips _Shrink( SwTwips, SZPTR BOOL bTst );
|
|
|
|
SwTwips _Grow ( SwTwips, SZPTR BOOL bTst );
|
2000-09-18 23:08:29 +00:00
|
|
|
void _Invalidate( SwPageFrm *pPage = 0 );
|
|
|
|
|
|
|
|
BOOL FrmSizeChg( const SwFmtFrmSize & );
|
|
|
|
|
|
|
|
SwFlyFrm *GetPrevLink() { return pPrevLink; }
|
|
|
|
SwFlyFrm *GetNextLink() { return pNextLink; }
|
|
|
|
|
|
|
|
static void ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow );
|
|
|
|
static void UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow );
|
|
|
|
|
|
|
|
SwFlyFrm *FindChainNeighbour( SwFrmFmt &rFmt, SwFrm *pAnch = 0 );
|
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-03-24 #i26791#
|
|
|
|
const SwVirtFlyDrawObj* GetVirtDrawObj() const;
|
|
|
|
SwVirtFlyDrawObj *GetVirtDrawObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
void NotifyDrawObj();
|
|
|
|
|
|
|
|
void ChgRelPos( const Point &rAbsPos );
|
|
|
|
BOOL IsInvalid() const { return bInvalid; }
|
|
|
|
void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = TRUE; }
|
|
|
|
void Validate() const { ((SwFlyFrm*)this)->bInvalid = FALSE; }
|
|
|
|
|
|
|
|
BOOL IsMinHeight() const { return bMinHeight; }
|
|
|
|
BOOL IsLocked() const { return bLocked; }
|
|
|
|
BOOL IsAutoPos() const { return bAutoPosition; }
|
|
|
|
BOOL IsFlyInCntFrm() const { return bInCnt; }
|
|
|
|
BOOL IsFlyFreeFrm() const { return bAtCnt || bLayout; }
|
|
|
|
BOOL IsFlyLayFrm() const { return bLayout; }
|
|
|
|
BOOL IsFlyAtCntFrm() const { return bAtCnt; }
|
|
|
|
|
|
|
|
BOOL IsNotifyBack() const { return bNotifyBack; }
|
|
|
|
void SetNotifyBack() { bNotifyBack = TRUE; }
|
|
|
|
void ResetNotifyBack() { bNotifyBack = FALSE; }
|
2002-07-08 07:26:15 +00:00
|
|
|
BOOL IsNoShrink() const { return bNoShrink; }
|
|
|
|
void SetNoShrink( BOOL bNew ) { bNoShrink = bNew; }
|
2004-02-26 14:28:03 +00:00
|
|
|
BOOL IsLockDeleteContent() const { return bLockDeleteContent; }
|
|
|
|
void SetLockDeleteContent( BOOL bNew ) { bLockDeleteContent = bNew; }
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
BOOL IsClipped() const { return bHeightClipped || bWidthClipped; }
|
|
|
|
BOOL IsHeightClipped() const { return bHeightClipped; }
|
|
|
|
BOOL IsWidthClipped() const { return bWidthClipped; }
|
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
BOOL IsLowerOf( const SwLayoutFrm* pUpper ) const;
|
|
|
|
inline BOOL IsUpperOf( const SwFlyFrm& _rLower ) const
|
|
|
|
{
|
|
|
|
return _rLower.IsLowerOf( this );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwFrm *FindLastLower();
|
|
|
|
|
2003-04-24 08:51:35 +00:00
|
|
|
// OD 16.04.2003 #i13147# - add parameter <_bForPaint> to avoid load of
|
|
|
|
// the graphic during paint. Default value: sal_False
|
|
|
|
BOOL GetContour( PolyPolygon& rContour,
|
|
|
|
const sal_Bool _bForPaint = sal_False ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
BOOL ConvertHoriTo40( SwHoriOrient &rHori, SwRelationOrient &rRel, SwTwips &rPos ) const;
|
|
|
|
|
|
|
|
//Auf dieser Shell painten (PreView, Print-Flag usw. rekursiv beachten)?.
|
|
|
|
static BOOL IsPaint( SdrObject *pObj, const ViewShell *pSh );
|
2002-08-28 10:54:54 +00:00
|
|
|
|
|
|
|
/** SwFlyFrm::IsBackgroundTransparent - for feature #99657#
|
|
|
|
|
|
|
|
OD 12.08.2002
|
|
|
|
determines, if background of fly frame has to be drawn transparent
|
|
|
|
definition found in /core/layout/paintfrm.cxx
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
|
|
|
@return true, if background color is transparent or a existing background
|
|
|
|
graphic is transparent.
|
|
|
|
*/
|
|
|
|
const sal_Bool IsBackgroundTransparent() const;
|
|
|
|
|
|
|
|
/** SwFlyFrm::IsShadowTransparent - for feature #99657#
|
|
|
|
|
|
|
|
OD 05.08.2002
|
|
|
|
determine, if shadow color of fly frame has to be drawn transparent
|
|
|
|
definition found in /core/layout/paintfrm.cxx
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
|
|
|
@return true, if shadow color is transparent.
|
|
|
|
*/
|
|
|
|
const sal_Bool IsShadowTransparent() const;
|
2004-02-26 14:28:03 +00:00
|
|
|
|
|
|
|
// OD 2004-01-19 #110582#
|
|
|
|
void Chain( SwFrm* _pAnchor );
|
|
|
|
void Unchain();
|
|
|
|
void InsertCnt();
|
|
|
|
void DeleteCnt();
|
|
|
|
// OD 2004-02-12 #110582#-2
|
|
|
|
void InsertColumns();
|
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
// OD 2004-03-23 #i26791# - pure virtual methods of base class <SwAnchoredObject>
|
|
|
|
virtual void MakeObjPos();
|
|
|
|
virtual void InvalidateObjPos();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
virtual SwFrmFmt& GetFrmFmt();
|
|
|
|
virtual const SwFrmFmt& GetFrmFmt() const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
virtual const SwRect GetObjRect() const;
|
|
|
|
virtual void SetObjTop( const SwTwips _nTop );
|
|
|
|
virtual void SetObjLeft( const SwTwips _nLeft );
|
2004-08-02 13:04:36 +00:00
|
|
|
|
|
|
|
/** method to determine, if a format on the Writer fly frame is possible
|
|
|
|
|
|
|
|
OD 2004-05-11 #i28701#
|
|
|
|
refine 'IsFormatPossible'-conditions of method
|
|
|
|
<SwAnchoredObject::IsFormatPossible()> by:
|
|
|
|
format isn't possible, if Writer fly frame is locked resp. col-locked.
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
*/
|
|
|
|
virtual bool IsFormatPossible() const;
|
2004-06-28 12:36:12 +00:00
|
|
|
};
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|