2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:13:52 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2010-09-30 16:03:07 +02:00
|
|
|
#ifndef SW_FLYFRM_HXX
|
|
|
|
#define SW_FLYFRM_HXX
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#include "layfrm.hxx"
|
2010-12-17 09:02:23 +01:00
|
|
|
#include <list>
|
2010-11-03 15:50:00 +01:00
|
|
|
#include "frmfmt.hxx"
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
class SwPageFrm;
|
|
|
|
class SwFmtFrmSize;
|
|
|
|
struct SwCrsrMoveState;
|
|
|
|
class SwBorderAttrs;
|
|
|
|
class SwVirtFlyDrawObj;
|
|
|
|
class SwSpzFrmFmts;
|
|
|
|
class SwAttrSetChg;
|
|
|
|
class PolyPolygon;
|
2010-12-17 09:02:23 +01:00
|
|
|
class SwFlyDrawContact;
|
|
|
|
class SwDrawContact;
|
|
|
|
class SwFmt;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:36:12 +00:00
|
|
|
#include <anchoredobject.hxx>
|
|
|
|
|
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,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bBody = sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// berechnet das Rechteck, in dem das Objekt bewegt bzw. resized werden darf
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove = sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//allg. Basisklasse fuer alle Freifliegenden Rahmen
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i26791# - inherit also from <SwAnchoredFlyFrm>
|
2004-06-28 12:36:12 +00:00
|
|
|
class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//darf Locken. Definiert in frmtool.cxx
|
2011-01-17 15:06:54 +01:00
|
|
|
friend void AppendObjs ( const SwSpzFrmFmts *, sal_uLong, SwFrm *, SwPageFrm * );
|
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
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void InitDrawObj( sal_Bool bNotify ); //Wird von den CToren gerufen.
|
2000-09-18 23:08:29 +00:00
|
|
|
void FinitDrawObj(); //Wird vom CTor gerufen.
|
|
|
|
|
2011-02-09 15:55:27 +01:00
|
|
|
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
|
2000-09-18 23:08:29 +00:00
|
|
|
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
|
|
|
|
|
2007-10-22 14:10:53 +00:00
|
|
|
using SwLayoutFrm::CalcRel;
|
|
|
|
|
2010-12-17 09:02:23 +01:00
|
|
|
sal_uInt32 _GetOrdNumForNewRef( const SwFlyDrawContact* );
|
|
|
|
SwVirtFlyDrawObj* CreateNewRef( SwFlyDrawContact* );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
|
|
|
|
*pNextLink; // Textfluss
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i26791# - moved to <SwAnchoredObject>
|
2004-06-28 12:36:12 +00:00
|
|
|
// Point aRelPos; //Die Relative Position zum Master
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
private:
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
|
2000-09-18 23:08:29 +00:00
|
|
|
//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.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bNotifyBack:1; //sal_True wenn am Ende eines MakeAll() der Background
|
2000-09-18 23:08:29 +00:00
|
|
|
//vom NotifyDTor benachrichtigt werden muss.
|
|
|
|
protected:
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bInvalid :1; //Pos, PrtArea od. SSize wurden Invalidiert, sie werden
|
2000-09-18 23:08:29 +00:00
|
|
|
//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!
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bMinHeight:1; //sal_True wenn die vom Attribut vorgegebene Hoehe eine
|
2000-09-18 23:08:29 +00:00
|
|
|
//eine Minimalhoehe ist (der Frm also bei Bedarf
|
|
|
|
//darueberhinaus wachsen kann).
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bHeightClipped :1; //sal_True wenn der Fly nicht die Pos/Size anhand der Attrs
|
|
|
|
sal_Bool bWidthClipped :1; //formatieren konnte, weil z.B. nicht genug Raum vorh.
|
2000-09-18 23:08:29 +00:00
|
|
|
//war.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bFormatHeightOnly :1; //Damit nach einer Anpassung der Breite
|
2000-09-18 23:08:29 +00:00
|
|
|
//(CheckClip) nur das Format aufgerufen wird;
|
|
|
|
//nicht aber die Breite anhand der Attribute
|
|
|
|
//wieder bestimmt wird.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bInCnt :1; // FLY_AS_CHAR, anchored as character
|
|
|
|
sal_Bool bAtCnt :1; // FLY_AT_PARA, anchored at paragraph
|
|
|
|
sal_Bool bLayout :1; // FLY_AT_PAGE, FLY_AT_FLY, at page or at frame
|
|
|
|
sal_Bool bAutoPosition :1; // FLY_AT_CHAR, anchored at character
|
|
|
|
sal_Bool bNoShrink :1; // temporary forbud of shrinking to avoid loops
|
|
|
|
sal_Bool bLockDeleteContent :1; // If the flag is set, the content of the
|
2004-02-26 14:28:03 +00:00
|
|
|
// fly frame is not deleted if moved to
|
|
|
|
// invisible layer.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
friend class SwNoTxtFrm; // Darf NotifyBackground rufen
|
|
|
|
|
|
|
|
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
|
|
|
|
void MakePrtArea( const SwBorderAttrs &rAttrs );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void Lock() { bLocked = sal_True; }
|
|
|
|
void Unlock() { bLocked = sal_False; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetMinHeight() { bMinHeight = sal_True; }
|
|
|
|
void ResetMinHeight(){ bMinHeight = sal_False; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFlyFrm( SwFlyFrmFmt*, SwFrm*, 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
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
#i28701#
|
2004-08-02 13:04:36 +00:00
|
|
|
*/
|
|
|
|
virtual void RegisterAtCorrectPage();
|
|
|
|
|
2008-10-10 13:02:43 +00:00
|
|
|
virtual bool _SetObjTop( const SwTwips _nTop );
|
|
|
|
virtual bool _SetObjLeft( const SwTwips _nLeft );
|
2006-11-01 14:11:48 +00:00
|
|
|
|
|
|
|
virtual const SwRect GetObjBoundRect() const;
|
2010-12-17 09:02:23 +01:00
|
|
|
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
|
2011-02-12 22:48:50 +01:00
|
|
|
|
2011-03-23 11:22:57 +01:00
|
|
|
virtual const IDocumentDrawModelAccess* getIDocumentDrawModelAccess( );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i26791#
|
2004-06-28 12:36:12 +00:00
|
|
|
TYPEINFO();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
virtual ~SwFlyFrm();
|
|
|
|
// erfrage vom Client Informationen
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
|
2010-09-30 16:03:07 +02:00
|
|
|
virtual void Paint( SwRect const&,
|
|
|
|
SwPrintData const*const pPrintData = NULL ) const;
|
2007-04-19 08:13:24 +00:00
|
|
|
virtual Size ChgSize( const Size& aNewSize );
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
|
2004-05-17 15:15:11 +00:00
|
|
|
SwCrsrMoveState* = 0 ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual void CheckDirection( sal_Bool bVert );
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual void Cut();
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
|
|
|
|
#endif
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTwips _Shrink( SwTwips, sal_Bool bTst );
|
|
|
|
SwTwips _Grow ( SwTwips, sal_Bool bTst );
|
2000-09-18 23:08:29 +00:00
|
|
|
void _Invalidate( SwPageFrm *pPage = 0 );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool FrmSizeChg( const SwFmtFrmSize & );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2007-11-22 14:34:56 +00:00
|
|
|
SwFlyFrm *GetPrevLink() const { return pPrevLink; }
|
|
|
|
SwFlyFrm *GetNextLink() const { return pNextLink; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
static void ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow );
|
|
|
|
static void UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow );
|
|
|
|
|
|
|
|
SwFlyFrm *FindChainNeighbour( SwFrmFmt &rFmt, SwFrm *pAnch = 0 );
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i26791#
|
2004-06-28 12:36:12 +00:00
|
|
|
const SwVirtFlyDrawObj* GetVirtDrawObj() const;
|
|
|
|
SwVirtFlyDrawObj *GetVirtDrawObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
void NotifyDrawObj();
|
|
|
|
|
|
|
|
void ChgRelPos( const Point &rAbsPos );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsInvalid() const { return bInvalid; }
|
|
|
|
void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = sal_True; }
|
|
|
|
void Validate() const { ((SwFlyFrm*)this)->bInvalid = sal_False; }
|
|
|
|
|
|
|
|
sal_Bool IsMinHeight() const { return bMinHeight; }
|
|
|
|
sal_Bool IsLocked() const { return bLocked; }
|
|
|
|
sal_Bool IsAutoPos() const { return bAutoPosition; }
|
|
|
|
sal_Bool IsFlyInCntFrm() const { return bInCnt; }
|
|
|
|
sal_Bool IsFlyFreeFrm() const { return bAtCnt || bLayout; }
|
|
|
|
sal_Bool IsFlyLayFrm() const { return bLayout; }
|
|
|
|
sal_Bool IsFlyAtCntFrm() const { return bAtCnt; }
|
|
|
|
|
|
|
|
sal_Bool IsNotifyBack() const { return bNotifyBack; }
|
|
|
|
void SetNotifyBack() { bNotifyBack = sal_True; }
|
|
|
|
void ResetNotifyBack() { bNotifyBack = sal_False; }
|
|
|
|
sal_Bool IsNoShrink() const { return bNoShrink; }
|
|
|
|
void SetNoShrink( sal_Bool bNew ) { bNoShrink = bNew; }
|
|
|
|
sal_Bool IsLockDeleteContent() const { return bLockDeleteContent; }
|
|
|
|
void SetLockDeleteContent( sal_Bool bNew ) { bLockDeleteContent = bNew; }
|
|
|
|
|
|
|
|
|
|
|
|
sal_Bool IsClipped() const { return bHeightClipped || bWidthClipped; }
|
|
|
|
sal_Bool IsHeightClipped() const { return bHeightClipped; }
|
|
|
|
sal_Bool IsWidthClipped() const { return bWidthClipped; }
|
|
|
|
|
|
|
|
sal_Bool IsLowerOf( const SwLayoutFrm* pUpper ) const;
|
|
|
|
inline sal_Bool IsUpperOf( const SwFlyFrm& _rLower ) const
|
2004-06-28 12:36:12 +00:00
|
|
|
{
|
|
|
|
return _rLower.IsLowerOf( this );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwFrm *FindLastLower();
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i13147# - add parameter <_bForPaint> to avoid load of
|
2003-04-24 08:51:35 +00:00
|
|
|
// the graphic during paint. Default value: sal_False
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool GetContour( PolyPolygon& rContour,
|
2003-04-24 08:51:35 +00:00
|
|
|
const sal_Bool _bForPaint = sal_False ) const;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
//Auf dieser Shell painten (PreView, Print-Flag usw. rekursiv beachten)?.
|
2011-01-17 15:06:54 +01:00
|
|
|
static sal_Bool IsPaint( SdrObject *pObj, const ViewShell *pSh );
|
2002-08-28 10:54:54 +00:00
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
/** SwFlyFrm::IsBackgroundTransparent
|
2002-08-28 10:54:54 +00:00
|
|
|
|
|
|
|
determines, if background of fly frame has to be drawn transparent
|
|
|
|
definition found in /core/layout/paintfrm.cxx
|
|
|
|
|
|
|
|
@return true, if background color is transparent or a existing background
|
|
|
|
graphic is transparent.
|
|
|
|
*/
|
2008-10-10 13:02:43 +00:00
|
|
|
sal_Bool IsBackgroundTransparent() const;
|
2002-08-28 10:54:54 +00:00
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
/** SwFlyFrm::IsShadowTransparent
|
2002-08-28 10:54:54 +00:00
|
|
|
|
|
|
|
determine, if shadow color of fly frame has to be drawn transparent
|
|
|
|
definition found in /core/layout/paintfrm.cxx
|
|
|
|
|
|
|
|
@return true, if shadow color is transparent.
|
|
|
|
*/
|
2008-10-10 13:02:43 +00:00
|
|
|
sal_Bool IsShadowTransparent() const;
|
2004-02-26 14:28:03 +00:00
|
|
|
|
|
|
|
void Chain( SwFrm* _pAnchor );
|
|
|
|
void Unchain();
|
|
|
|
void InsertCnt();
|
|
|
|
void DeleteCnt();
|
|
|
|
void InsertColumns();
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
// #i26791# - pure virtual methods of base class <SwAnchoredObject>
|
2004-06-28 12:36:12 +00:00
|
|
|
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;
|
2004-08-02 13:04:36 +00:00
|
|
|
|
|
|
|
/** method to determine, if a format on the Writer fly frame is possible
|
|
|
|
|
2011-02-12 22:48:50 +01:00
|
|
|
#i28701#
|
2004-08-02 13:04:36 +00:00
|
|
|
refine 'IsFormatPossible'-conditions of method
|
|
|
|
<SwAnchoredObject::IsFormatPossible()> by:
|
|
|
|
format isn't possible, if Writer fly frame is locked resp. col-locked.
|
|
|
|
*/
|
|
|
|
virtual bool IsFormatPossible() const;
|
2010-12-17 09:02:23 +01:00
|
|
|
static void GetAnchoredObjects( std::list<SwAnchoredObject*>&, const SwFmt& rFmt );
|
2010-10-20 10:32:29 +02:00
|
|
|
|
2010-11-03 15:50:00 +01:00
|
|
|
// overwriting "SwFrmFmt *SwLayoutFrm::GetFmt" to provide the correct derived return type.
|
|
|
|
// (This is in order to skip on the otherwise necessary casting of the result to
|
|
|
|
// 'SwFlyFrmFmt *' after calls to this function. The casting is now done in this function.)
|
|
|
|
virtual const SwFlyFrmFmt *GetFmt() const;
|
|
|
|
virtual SwFlyFrmFmt *GetFmt();
|
2011-04-13 15:54:06 +02:00
|
|
|
|
|
|
|
virtual void dumpAsXml( xmlTextWriterPtr writer ) { SwLayoutFrm::dumpAsXml( writer ); };
|
2004-06-28 12:36:12 +00:00
|
|
|
};
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|