20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_FRAME_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_FRAME_HXX
31 #include <com/sun/star/style/TabStop.hpp>
101 #define FRM_LAYOUT SwFrameType(0x3bFF)
102 #define FRM_ALL SwFrameType(0xfbff)
103 #define FRM_CNTNT (SwFrameType::Txt | SwFrameType::NoTxt)
104 #define FRM_FTNBOSS (SwFrameType::Page | SwFrameType::Column)
105 #define FRM_ACCESSIBLE (SwFrameType::Root | SwFrameType::Page | SwFrameType::Header | SwFrameType::Footer | SwFrameType::Ftn | SwFrameType::Fly | SwFrameType::Tab | SwFrameType::Cell | SwFrameType::Txt)
106 #define FRM_NEIGHBOUR (SwFrameType::Column | SwFrameType::Cell)
107 #define FRM_NOTE_VERT (SwFrameType::FtnCont | SwFrameType::Ftn | SwFrameType::Section | SwFrameType::Tab | SwFrameType::Row | SwFrameType::Cell | SwFrameType::Txt)
108 #define FRM_HEADFOOT (SwFrameType::Header | SwFrameType::Footer)
109 #define FRM_BODYFTNC (SwFrameType::FtnCont | SwFrameType::Body)
146 bool mbFrameAreaPositionValid : 1;
147 bool mbFrameAreaSizeValid : 1;
148 bool mbFramePrintAreaValid : 1;
157 void setFrameAreaPositionValid(
bool bNew);
158 void setFrameAreaSizeValid(
bool bNew);
159 void setFramePrintAreaValid(
bool bNew);
229 virtual void transform_translate(
const Point& rOffset);
248 : mrSwFrameAreaDefinition(rSwFrameAreaDefinition),
249 maFrameAreaTransformation(),
250 maFramePrintAreaTransformation()
406 void SetDirFlags(
bool bVert );
408 const SwLayoutFrame* ImplGetNextLayoutLeaf(
bool bFwd )
const;
417 bool mbInvalidR2L : 1;
418 bool mbDerivedR2L : 1;
419 bool mbRightToLeft : 1;
420 bool mbInvalidVert : 1;
421 bool mbDerivedVert : 1;
427 bool mbValidLineNum : 1;
433 bool mbCompletePaint : 1;
437 bool mbInfInvalid : 1;
441 bool mbInfFootnote : 1;
443 bool mbColLocked : 1;
445 bool m_isInDestroy : 1;
451 virtual void DestroyImpl();
459 void OptPrepareMake();
460 virtual void MakePos();
471 virtual SwTwips ShrinkFrame(
SwTwips,
bool bTst =
false,
bool bInfo =
false ) = 0;
472 virtual SwTwips GrowFrame (
SwTwips,
bool bTst =
false,
bool bInfo =
false ) = 0;
483 void CheckDir(
SvxFrameDirection nDir,
bool bVert,
bool bOnlyBiDi,
bool bBrowse );
490 INVALID_SIZE, INVALID_PRTAREA, INVALID_POS, INVALID_LINENUM, INVALID_ALL
496 virtual bool InvalidationAllowed(
const InvalidationType _nInvalid )
const;
504 virtual void ActionOnInvalidation(
const InvalidationType _nInvalid );
515 return css::uno::Sequence< css::style::TabStop >();
538 void RemoveFromLayout();
566 void SetDrawObjsAsDeleted(
bool bDeleted );
568 void InvalidateObjs(
const bool _bNoInvaOfAsCharAnchoredObjs =
true );
570 virtual void PaintSwFrameShadowAndBorder(
575 const bool bOnlyTextBackground =
false)
const;
578 const bool bLowerMode =
false,
579 const bool bLowerBorder =
false,
580 const bool bOnlyTextBackground =
false )
const;
585 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> CreateProcessor2D( )
const;
591 bool GetBackgroundBrush(
594 std::optional<Color>& rxColor,
597 bool bConsiderTextBox )
const;
600 inline void ResetCompletePaint()
const;
603 inline void SetRetouche()
const;
604 inline void ResetRetouche()
const;
609 inline bool IsInDocBody()
const;
610 inline bool IsInFootnote()
const;
611 inline bool IsInTab()
const;
612 inline bool IsInFly()
const;
613 inline bool IsInSct()
const;
623 bool IsInBalancedSection()
const;
625 inline bool IsVertical()
const;
626 inline bool IsVertLR()
const;
627 inline bool IsVertLRBT()
const;
631 inline bool IsRightToLeft()
const;
634 void CheckDirChange();
637 Point GetFrameAnchorPos(
bool bIgnoreFlysAnchoredAtThisFrame )
const;
652 bool IsMoveable(
const SwLayoutFrame* _pLayoutFrame =
nullptr )
const;
656 bool IsFootnoteAllowed()
const;
660 virtual void CheckDirection(
bool bVert );
662 void ReinitializeFrameSizeAttrFlags();
673 static void CheckPageDescs(
SwPageFrame *pStart,
bool bNotifyFields =
true,
SwPageFrame** ppPrev =
nullptr);
701 SwContentFrame* FindNextCnt(
const bool _bInSameFootnote =
false );
705 inline const SwFrame *FindColFrame()
const;
706 inline const SwFrame *FindFooterOrHeader()
const;
707 inline const SwTabFrame *FindTabFrame()
const;
709 inline const SwFlyFrame *FindFlyFrame()
const;
712 inline const SwFrame *FindNext()
const;
714 const SwContentFrame* FindNextCnt(
const bool _bInSameFootnote =
false )
const;
715 inline const SwFrame *FindPrev()
const;
716 const SwFrame *GetLower()
const;
725 {
return ( mpPrev || !IsInSct() ) ? mpPrev : GetIndPrev_(); }
728 {
return ( mpNext || !IsInSct() ) ? mpNext : GetIndNext_(); }
731 sal_uInt16 GetPhyPageNum()
const;
732 sal_uInt16 GetVirtPageNum()
const;
734 bool WannaRightPage()
const;
735 bool OnFirstPage()
const;
743 inline void OptCalc()
const;
745 Point GetRelPos()
const;
749 SwRect GetPaintArea()
const;
753 SwRect UnionFrame(
bool bBorder =
false )
const;
755 virtual Size ChgSize(
const Size& aNewSize );
757 virtual void Cut() = 0;
776 ActionOnInvalidation( INVALID_SIZE );
784 ActionOnInvalidation( INVALID_PRTAREA );
792 ActionOnInvalidation( INVALID_POS );
797 if ( mbValidLineNum && InvalidationAllowed( INVALID_LINENUM ) )
799 mbValidLineNum =
false;
800 ActionOnInvalidation( INVALID_LINENUM );
810 ActionOnInvalidation( INVALID_ALL );
817 inline void InvalidateLineNum();
818 inline void InvalidateAll();
819 void ImplInvalidateSize();
820 void ImplInvalidatePrt();
821 void ImplInvalidatePos();
822 void ImplInvalidateLineNum();
825 void ImplInvalidateNextPos(
bool bNoFootnote );
830 void InvalidateNextPrtArea();
832 void InvalidatePage(
const SwPageFrame *pPage =
nullptr )
const;
836 virtual bool GetModelPositionForViewPoint(
SwPosition *, Point&,
841 SwPrintData const*
const pPrintData =
nullptr )
const;
847 const void *pVoid =
nullptr,
bool bNotify =
true );
850 inline bool IsLayoutFrame()
const;
851 inline bool IsRootFrame()
const;
852 inline bool IsPageFrame()
const;
853 inline bool IsColumnFrame()
const;
854 inline bool IsFootnoteBossFrame()
const;
855 inline bool IsHeaderFrame()
const;
856 inline bool IsFooterFrame()
const;
857 inline bool IsFootnoteContFrame()
const;
858 inline bool IsFootnoteFrame()
const;
859 inline bool IsBodyFrame()
const;
860 inline bool IsColBodyFrame()
const;
861 inline bool IsPageBodyFrame()
const;
862 inline bool IsFlyFrame()
const;
863 inline bool IsSctFrame()
const;
864 inline bool IsTabFrame()
const;
865 inline bool IsRowFrame()
const;
866 inline bool IsCellFrame()
const;
867 inline bool IsContentFrame()
const;
868 inline bool IsTextFrame()
const;
871 inline bool IsNoTextFrame()
const;
874 inline bool IsFlowFrame()
const;
877 inline bool IsRetoucheFrame()
const;
878 inline bool IsAccessibleFrame()
const;
880 void PrepareCursor();
884 bool IsProtected()
const;
890 static void DestroyFrame(
SwFrame *
const pFrame);
918 virtual bool IsLeaveUpperAllowed()
const;
919 virtual bool IsCoveredCell()
const;
920 bool IsInCoveredCell()
const;
923 bool KnowsFormat(
const SwFormat& rFormat )
const;
924 void RegisterToFormat(
SwFormat& rFormat );
925 void ValidateThisAndAllLowers(
const sal_uInt16 nStage );
928 void AllowDelete() { assert(mnForbidDelete > 0); --mnForbidDelete; }
931 bool supportsFullDrawingLayerFillAttributeSet()
const;
940 bool IsCollapse()
const;
1265 : m_pForbidFrame(pFrame)
1351 :
m_bVert(pFrame->IsVertical())
SwFrame * FindFooterOrHeader()
void SetTop(SwRect &rRect, tools::Long nNew) const
Base class of the Writer layout elements.
Base class that provides the general functionalities for frames that are allowed at page breaks (flow...
Represents the visualization of a paragraph.
const SwFrame * GetIndNext() const
void InvalidateInfFlags()
SwFrameGet fnGetPrtBottom
tools::Long GetRight(const SwRect &rRect) const
bool(SwRect::* SwRectMax)(tools::Long) const
Point GetPos(const SwRect &rRect) const
const SwSortedObjs * GetDrawObjs() const
Marks a position in the document model.
void AddHeight(SwRect &rRect, tools::Long nNew) const
tools::Long GetPrtRight(const SwFrame &rFrame) const
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
void SetPosY(SwRect &rRect, tools::Long nNew) const
Size GetSize(const SwRect &rRect) const
tools::Long BottomDist(const SwRect &rRect, tools::Long nPos) const
SwFootnoteFrame * ImplFindFootnoteFrame()
const SwBodyFrame * ImplFindBodyFrame() const
tools::Long GetLeftMargin(const SwFrame &rFrame) const
void Refresh(const SwFrame *pFrame)
void SetCompletePaint() const
void ImplInvalidateSize()
bool IsInFootnote() const
SwFrameType GetType() const
SwRectSetTwice fnSetLeftAndWidth
void setSwRect(const SwRect &rNew)
void SetDerivedR2L(bool bNew)
const SwRect & getFramePrintArea() const
void InvalidateLineNum_()
static SwCache & GetCache()
SwTabFrame is one table in the document layout, containing rows (which contain cells).
tools::Long XInc(tools::Long n1, tools::Long n2) const
const SwFrame * GetNext() const
virtual bool InvalidationAllowed(const InvalidationType _nInvalid) const
method to determine, if an invalidation is allowed.
const SwBodyFrame * FindBodyFrame() const
bool GetValidLineNumFlag() const
This class is used as parameter for creation of a block cursor selection.
void SubTop(SwRect &rRect, tools::Long nNew) const
SwFrameAreaDefinition & mrTarget
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Of course Writer needs its own rectangles.
tools::Long GetWidth(const SwRect &rRect) const
void AddBottom(SwRect &rRect, tools::Long nNew) const
The root element of a Writer document layout.
bool IsFootnoteFrame() const
void SetXMargins(SwFrame &rFrame, tools::Long nLeft, tools::Long nRight) const
FrameAreaWriteAccess(SwFrameAreaDefinition &rTarget)
SwFrame * sw_FormatNextContentForKeep(SwTabFrame *pTabFrame)
bool isFrameAreaDefinitionValid() const
void AddRight(SwRect &rRect, tools::Long nNew) const
void ValidateSz(SwFrame *pFrame)
tools::Long TopDist(const SwRect &rRect, tools::Long nPos) const
SwRectFnSet(const SwFrame *pFrame)
tools::Long GetTop(const SwRect &rRect) const
SwSectionFrame * ImplFindSctFrame()
void SetBottom(SwRect &rRect, tools::Long nNew) const
wrapper class for the positioning of Writer fly frames and drawing objects
tools::Long(SwRect::* SwRectDist)(tools::Long) const
SwFrameGet fnGetRightMargin
const SwLayoutFrame * GetPrevLayoutLeaf() const
static void SetCache(SwCache *pNew)
const SwRect & getFrameArea() const
void setRootFrame(SwRootFrame *pRoot)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
tools::Long GetPrtLeft(const SwFrame &rFrame) const
void setFramePrintAreaValid(bool bNew)
const SwLayoutFrame * GetUpper() const
SwFrameGet fnGetLeftMargin
SwFlyFrame * FindFlyFrame()
SwFrameAreaDefinition & mrTarget
tools::Long GetLeft(const SwRect &rRect) const
SwFrameGet fnGetTopMargin
void SetLimit(SwFrame &rFrame, tools::Long nNew) const
helper class to check if a frame has been deleted during an operation WARNING! This should only be us...
bool IsColumnFrame() const
SwRectFn fnRectVertL2RB2T
void(SwRect::* SwRectSet)(const tools::Long nNew)
SwFootnoteFrame * FindFootnoteFrame()
tools::Long XDiff(tools::Long n1, tools::Long n2) const
void SetInvalidVert(bool bNew)
void(SwFrame::* SwFrameMakePos)(const SwFrame *, const SwFrame *, bool)
void SetDerivedVert(bool bNew)
void AddWidth(SwRect &rRect, tools::Long nNew) const
SwTabFrame * ImplFindTabFrame()
FramePrintAreaWriteAccess(SwFrameAreaDefinition &rTarget)
void SetDirFlags(bool bVert)
Updates the vertical or the righttoleft-flags.
void FriendHackInvalidateRowFrame(SwFrameAreaDefinition &rRowFrame)
bool IsContentFrame() const
virtual css::uno::Sequence< css::style::TabStop > GetTabStopInfo(SwTwips)
SwFrame * GetIndPrev() const
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
tools::Long GetPrtBottom(const SwFrame &rFrame) const
SwPageFrame * FindPageFrame()
virtual bool IsDeleteForbidden() const
static tools::Long GetLeftMargin(SwView const &rView)
const SwLayoutFrame * ImplGetNextLayoutLeaf(bool bFwd) const
Finds the next layout leaf.
tools::Long YInc(tools::Long n1, tools::Long n2) const
bool IsCompletePaint() const
void setSwRect(const SwRect &rNew)
tools::Long GetHeight(const SwRect &rRect) const
void SubLeft(SwRect &rRect, tools::Long nNew) const
tools::Long(* SwOperator)(tools::Long, tools::Long)
bool(SwFrame::* SwFrameMax)(tools::Long)
void SetRight(SwRect &rRect, tools::Long nNew) const
SwLayoutFrame * GetUpper()
bool PosDiff(const SwRect &rRect1, const SwRect &rRect2) const
bool isFramePrintAreaValid() const
tools::Long GetPrtTop(const SwFrame &rFrame) const
SwFlyFrame * ImplFindFlyFrame()
SwFootnoteBossFrame * FindFootnoteBossFrame(bool bFootnotes=false)
bool IsRetoucheFrame() const
const SwRootFrame * getRootFrame() const
tools::Long GetTopMargin(const SwFrame &rFrame) const
void ImplInvalidateNextPos(bool bNoFootnote)
bool isFrameAreaPositionValid() const
tools::Long YDiff(tools::Long n1, tools::Long n2) const
SwFrameDeleteGuard(SwFrame *pFrame)
tools::Long GetRightMargin(const SwFrame &rFrame) const
bool isFrameAreaSizeValid() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
A page of the document layout.
tools::Long(SwFrame::* SwFrameGet)() const
void(SwRect::* SwRectSetTwice)(tools::Long, tools::Long)
void ResetCompletePaint() const
SwSectionFrame * FindSctFrame()
static SwCache * GetCachePtr()
const sal_uInt32 mnFrameId
void ResetRetouche() const
SwRectFnCollection * SwRectFn
void setFrameAreaPositionValid(bool bNew)
void SetTopAndHeight(SwRect &rRect, tools::Long nTop, tools::Long nHeight) const
void SetPosX(SwRect &rRect, tools::Long nNew) const
bool IsLayoutFrame() const
static sal_uInt32 snLastFrameId
bool OverStep(const SwRect &rRect, tools::Long nPos) const
SwRectSetTwice fnSetTopAndHeight
void SetYMargins(SwFrame &rFrame, tools::Long nTop, tools::Long nBottom) const
void MakeNxt(SwFrame *pFrame, SwFrame *pNxt)
void SetWidth(SwRect &rRect, tools::Long nNew) const
tools::Long GetBottomMargin(const SwFrame &rFrame) const
general base class for all free-flowing frames
tools::Long(SwRect::* SwRectGet)() const
void(SwFrame::* SwFrameSet)(tools::Long, tools::Long)
tools::Long LeftDist(const SwRect &rRect, tools::Long nPos) const
SwFrameDeleteGuard & operator=(const SwFrameDeleteGuard &)=delete
void SetHeight(SwRect &rRect, tools::Long nNew) const
SwSortedObjs * GetDrawObjs()
bool IsNoTextFrame() const
const sw::BroadcastingModify * GetDep() const
void InvalidateNextPos(bool bNoFootnote=false)
bool IsRightToLeft() const
const SwModify * GetRegisteredIn() const
void setFrameAreaSizeValid(bool bNew)
virtual void ActionOnInvalidation(const InvalidationType _nInvalid)
method to perform additional actions on an invalidation
void SetPos(SwRect &rRect, const Point &rNew) const
Helper class to isolate geometry-defining members of SwFrame and to control their accesses...
Size(SwRect::* SwRectSize)() const
void MakePos(SwFrame &rFrame, const SwFrame *pUp, const SwFrame *pPrv, bool bNotify) const
tools::Long GetBottom(const SwRect &rRect) const
SwModify * GetRegisteredInNonConst() const
void ImplInvalidateLineNum()
bool IsAccessibleFrame() const
void SetLeft(SwRect &rRect, tools::Long nNew) const
struct _xmlTextWriter * xmlTextWriterPtr
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
bool IsFootnoteBossFrame() const
const SwLayoutFrame * GetNextLayoutLeaf() const
const SwFrame * GetPrev() const
tools::Long RightDist(const SwRect &rRect, tools::Long nPos) const
bool IsFootnoteContFrame() const
Point(SwRect::* SwRectPoint)() const
bool IsNeighbourFrame() const
void SetLeftAndWidth(SwRect &rRect, tools::Long nLeft, tools::Long nWidth) const
class for collecting anchored objects
Container of body content (i.e.
std::unique_ptr< SwSortedObjs > m_pDrawObjs
InvalidationType
enumeration for the different invalidations #i28701#
bool IsFooterFrame() const
void(SwRect::* SwRectSetPos)(const Point &)
SwRootFrame * getRootFrame()
sal_uInt32 GetFrameId() const
SwRowFrame is one table row in the document layout.
bool IsHeaderFrame() const
SwTabFrame * FindTabFrame()
SwFrameGet fnGetBottomMargin