LibreOffice Module sw (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwAnchoredDrawObject Class Referencefinal

class for the positioning of drawing objects More...

#include <anchoreddrawobject.hxx>

Inheritance diagram for SwAnchoredDrawObject:
[legend]
Collaboration diagram for SwAnchoredDrawObject:
[legend]

Public Member Functions

 SwAnchoredDrawObject ()
 
virtual ~SwAnchoredDrawObject () override
 
virtual void MakeObjPos () override
 method to determine position for the object and set the position at the object More...
 
virtual void InvalidateObjPos () override
 method to invalidate position of the anchored object More...
 
virtual void RegisterAtPage (SwPageFrame &) override
 
bool IsValidPos () const
 
virtual SwFrameFormatGetFrameFormat () override
 
virtual const SwFrameFormatGetFrameFormat () const override
 
virtual SwRect GetObjRect () const override
 
std::optional< tools::Rectangle > const & GetLastObjRect () const
 
void SetLastObjRect (const tools::Rectangle &_rNewObjRect)
 
void AdjustPositioningAttr (const SwFrame *_pNewAnchorFrame, const SwRect *_pNewObjRect=nullptr)
 adjust positioning and alignment attributes for new anchor frame More...
 
virtual void NotifyBackground (SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint) override
 method to notify background of drawing object More...
 
bool NotYetPositioned () const
 
virtual void UpdateLayoutDir () override
 method update layout direction the layout direction, the anchored object is assigned to More...
 
bool IsOutsidePage () const
 
void ValidateThis ()
 
virtual const char * getElementName () const override
 The element name to show in the XML dump. More...
 
- Public Member Functions inherited from SwAnchoredObject
virtual ~SwAnchoredObject ()
 
void SetDrawObj (SdrObject &_rDrawObj)
 
const SdrObjectGetDrawObj () const
 
SdrObjectDrawObj ()
 
void ClearDrawObj ()
 
const SwFrameGetAnchorFrame () const
 
SwFrameAnchorFrame ()
 
void ChgAnchorFrame (SwFrame *_pNewAnchorFrame)
 
SwFrameGetAnchorFrameContainingAnchPos ()
 determine anchor frame containing the anchor position More...
 
SwPageFrameGetPageFrame ()
 
const SwPageFrameGetPageFrame () const
 
void SetPageFrame (SwPageFrame *_pNewPageFrame)
 
SwPageFrameFindPageFrameOfAnchor ()
 method to determine the page frame, on which the 'anchor' of the given anchored object is. More...
 
SwTextFrameFindAnchorCharFrame ()
 get frame, which contains the anchor character, if the object is anchored at-character or as-character. More...
 
const SwLayoutFrameGetVertPosOrientFrame () const
 
void ClearVertPosOrientFrame ()
 
void CheckCharRectAndTopOfLine (const bool _bCheckForParaPorInf)
 check anchor character rectangle and top of line More...
 
const SwRectGetLastCharRect () const
 
SwTwips GetRelCharX (const SwFrame *pFrame) const
 
SwTwips GetRelCharY (const SwFrame *pFrame) const
 
void AddLastCharY (tools::Long nDiff)
 
void ResetLastCharRectHeight ()
 
SwTwips GetLastTopOfLine () const
 
void AddLastTopOfLineY (SwTwips _nDiff)
 
void ClearCharRectAndTopOfLine ()
 reset members <maLastCharRect> and <mnLastTopOfLine> More...
 
virtual void MakeObjPos ()=0
 method to determine position for the object and set the position at the object More...
 
bool IsPositioningInProgress () const
 is positioning of anchored object in progress More...
 
bool InvalidationOfPosAllowed () const
 method to determine, if invalidation of position is allowed More...
 
virtual void InvalidateObjPos ()=0
 method to invalidate position of the anchored object More...
 
virtual void RegisterAtPage (SwPageFrame &)=0
 
void InvalidateObjPosForConsiderWrapInfluence ()
 method to perform necessary invalidations for the positioning of objects, for whose the wrapping style influence has to be considered on the object positioning. More...
 
virtual void NotifyBackground (SwPageFrame *_pPageFrame, const SwRect &_rRect, PrepareHint _eHint)=0
 method to trigger notification of 'background' More...
 
const PointGetCurrRelPos () const
 
void SetCurrRelPos (Point _aRelPos)
 
virtual SwFrameFormatGetFrameFormat ()=0
 
virtual const SwFrameFormatGetFrameFormat () const =0
 
virtual SwRect GetObjRect () const =0
 
void SetObjTop (const SwTwips _nTop)
 
void SetObjLeft (const SwTwips _nLeft)
 
virtual void UpdateLayoutDir ()
 method update layout direction the layout direction, the anchored object is assigned to More...
 
const SwRectGetObjRectWithSpaces () const
 method to determine object area inclusive its spacing More...
 
void InvalidateObjRectWithSpaces () const
 
bool ConsiderObjWrapInfluenceOnObjPos () const
 method to determine, if wrapping style influence of the anchored object has to be considered on the object positioning More...
 
bool ConsiderForTextWrap () const
 
void SetConsiderForTextWrap (const bool _bConsiderForTextWrap)
 
bool PositionLocked () const
 
void LockPosition ()
 
void UnlockPosition ()
 
void SetKeepPosLocked (const bool _bKeepPosLocked)
 
bool RestartLayoutProcess () const
 
void SetRestartLayoutProcess (const bool _bRestartLayoutProcess)
 
bool ClearedEnvironment () const
 
void SetClearedEnvironment (const bool _bClearedEnvironment)
 
void ResetLayoutProcessBools ()
 
bool HasClearedEnvironment () const
 method to determine, if due to anchored object size and wrapping style, its layout environment is cleared. More...
 
void UpdateObjInSortedList ()
 method to update anchored object in the <SwSortedObjs> lists More...
 
virtual bool IsFormatPossible () const
 method to determine, if a format on the anchored object is possible More...
 
void SetTmpConsiderWrapInfluence (const bool _bTmpConsiderWrapInfluence)
 
bool IsTmpConsiderWrapInfluence () const
 
void ClearTmpConsiderWrapInfluence ()
 
bool IsForceNotifyNewBackground ()
 
void SetForceNotifyNewBackground (bool const b)
 
bool OverlapsPrevColumn () const
 method to determine, if the anchored object is overlapping with a previous column More...
 
Point GetRelPosToAnchorFrame () const
 method to determine position of anchored object relative to anchor frame More...
 
Point GetRelPosToPageFrame (const bool _bFollowTextFlow, bool &_obRelToTableCell) const
 method to determine position of anchored object relative to page frame More...
 
Point GetRelPosToChar () const
 method to determine position of anchored object relative to anchor character More...
 
Point GetRelPosToLine () const
 method to determine position of anchored object relative to top of line More...
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter=nullptr) const
 Dump a bunch of useful data to an XML representation to ease layout understanding, debugging and testing. More...
 
virtual const char * getElementName () const
 The element name to show in the XML dump. More...
 
virtual const SwFlyFrameDynCastFlyFrame () const
 
virtual SwFlyFrameDynCastFlyFrame ()
 

Private Member Functions

void MakeObjPosAnchoredAtPara ()
 method for the intrinsic positioning of an at-paragraph|at-character anchored drawing object More...
 
void MakeObjPosAnchoredAtLayout ()
 method for the intrinsic positioning of an at-page|at-frame anchored drawing object More...
 
void SetPositioningAttr ()
 method to set positioning attributes (not for as-character anchored) More...
 
void SetDrawObjAnchor ()
 method to set internal anchor position of <SdrObject> instance of the drawing object More...
 
void InvalidatePage_ (SwPageFrame *_pPageFrame)
 method to invalidate the given page frame More...
 
virtual void ObjectAttachedToAnchorFrame () override
 method to indicate, that anchored object is attached to an anchor frame More...
 
virtual void RegisterAtCorrectPage () override
 method to assure that anchored object is registered at the correct page frame More...
 
virtual bool SetObjTop_ (const SwTwips _nTop) override
 
virtual bool SetObjLeft_ (const SwTwips _nLeft) override
 
virtual SwRect GetObjBoundRect () const override
 

Private Attributes

bool mbValidPos
 
std::optional< tools::RectanglemaLastObjRect
 
bool mbNotYetAttachedToAnchorFrame
 
bool mbNotYetPositioned
 
bool mbCaptureAfterLayoutDirChange
 

Additional Inherited Members

- Static Public Member Functions inherited from SwAnchoredObject
static bool IsDraggingOffPageAllowed (const SwFrameFormat *)
 method to determine if dragging objects off page is allowed More...
 
- Protected Member Functions inherited from SwAnchoredObject
 SwAnchoredObject ()
 
void SetVertPosOrientFrame (const SwLayoutFrame &_rVertPosOrientFrame)
 
virtual void RegisterAtCorrectPage ()=0
 method to assure that anchored object is registered at the correct page frame More...
 
virtual void ObjectAttachedToAnchorFrame ()
 method to indicate, that anchored object is attached to an anchor frame More...
 
bool ConsiderObjWrapInfluenceOfOtherObjs () const
 method to determine, if other anchored objects, also attached at to the anchor frame, have to consider its wrap influence. More...
 
void SetTmpConsiderWrapInfluenceOfOtherObjs ()
 method to apply temporary consideration of wrapping style influence to the anchored objects, which are anchored at the same anchor frame More...
 
virtual bool SetObjTop_ (const SwTwips _nTop)=0
 
virtual bool SetObjLeft_ (const SwTwips _nLeft)=0
 
virtual SwRect GetObjBoundRect () const =0
 

Detailed Description

class for the positioning of drawing objects

Definition at line 28 of file anchoreddrawobject.hxx.

Constructor & Destructor Documentation

◆ SwAnchoredDrawObject()

SwAnchoredDrawObject::SwAnchoredDrawObject ( )

Definition at line 200 of file anchoreddrawobject.cxx.

◆ ~SwAnchoredDrawObject()

SwAnchoredDrawObject::~SwAnchoredDrawObject ( )
overridevirtual

Definition at line 210 of file anchoreddrawobject.cxx.

Member Function Documentation

◆ AdjustPositioningAttr()

void SwAnchoredDrawObject::AdjustPositioningAttr ( const SwFrame _pNewAnchorFrame,
const SwRect _pNewObjRect = nullptr 
)

adjust positioning and alignment attributes for new anchor frame

Set horizontal and vertical position/alignment to manual position relative to anchor frame area using the anchor position of the new anchor frame and the current absolute drawing object position. Note: For correct Undo/Redo method should only be called inside a Undo-/Redo-action.

Parameters
<_pNewAnchorFrame>input parameter - new anchor frame for the anchored object.
<_pNewObjRect>optional input parameter - proposed new object rectangle. If not provided the current object rectangle is taken.

#i33313# - add second optional parameter <_pNewObjRect>

Definition at line 782 of file anchoreddrawobject.cxx.

References SwFormat::GetDoc(), SwAnchoredObject::GetDrawObj(), SwFrame::GetFrameAnchorPos(), GetFrameFormat(), GetObjRect(), HasWrap(), SwFrame::IsRightToLeft(), SwFrame::IsVertical(), SwRect::Left(), SwPostItHelper::NONE, SfxItemSet::Put(), SwRect::Right(), SwDoc::SetAttr(), SwRect::Top(), Point::X(), and Point::Y().

◆ getElementName()

virtual const char * SwAnchoredDrawObject::getElementName ( ) const
inlineoverridevirtual

The element name to show in the XML dump.


Reimplemented from SwAnchoredObject.

Definition at line 164 of file anchoreddrawobject.hxx.

◆ GetFrameFormat() [1/2]

const SwFrameFormat & SwAnchoredDrawObject::GetFrameFormat ( ) const
overridevirtual

Implements SwAnchoredObject.

Definition at line 623 of file anchoreddrawobject.cxx.

References SwAnchoredObject::GetDrawObj(), GetFormat(), and GetUserCall().

◆ GetFrameFormat() [2/2]

SwFrameFormat & SwAnchoredDrawObject::GetFrameFormat ( )
overridevirtual

◆ GetLastObjRect()

std::optional< tools::Rectangle > const & SwAnchoredDrawObject::GetLastObjRect ( ) const
inline

Definition at line 124 of file anchoreddrawobject.hxx.

References maLastObjRect.

Referenced by SwDrawContact::Changed_().

◆ GetObjBoundRect()

SwRect SwAnchoredDrawObject::GetObjBoundRect ( ) const
overrideprivatevirtual

◆ GetObjRect()

SwRect SwAnchoredDrawObject::GetObjRect ( ) const
overridevirtual

◆ InvalidateObjPos()

void SwAnchoredDrawObject::InvalidateObjPos ( )
overridevirtual

◆ InvalidatePage_()

void SwAnchoredDrawObject::InvalidatePage_ ( SwPageFrame _pPageFrame)
private

◆ IsOutsidePage()

bool SwAnchoredDrawObject::IsOutsidePage ( ) const

◆ IsValidPos()

bool SwAnchoredDrawObject::IsValidPos ( ) const
inline

Definition at line 112 of file anchoreddrawobject.hxx.

References mbValidPos.

◆ MakeObjPos()

void SwAnchoredDrawObject::MakeObjPos ( )
overridevirtual

◆ MakeObjPosAnchoredAtLayout()

void SwAnchoredDrawObject::MakeObjPosAnchoredAtLayout ( )
private

◆ MakeObjPosAnchoredAtPara()

void SwAnchoredDrawObject::MakeObjPosAnchoredAtPara ( )
private

◆ NotifyBackground()

void SwAnchoredDrawObject::NotifyBackground ( SwPageFrame _pPageFrame,
const SwRect _rRect,
PrepareHint  _eHint 
)
overridevirtual

method to notify background of drawing object

Implements SwAnchoredObject.

Definition at line 912 of file anchoreddrawobject.cxx.

References SwAnchoredObject::GetDrawObj(), and Notify_Background().

◆ NotYetPositioned()

bool SwAnchoredDrawObject::NotYetPositioned ( ) const
inline

◆ ObjectAttachedToAnchorFrame()

void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame ( )
overrideprivatevirtual

method to indicate, that anchored object is attached to an anchor frame

Reimplemented from SwAnchoredObject.

Definition at line 823 of file anchoreddrawobject.cxx.

References mbNotYetAttachedToAnchorFrame, and SwAnchoredObject::ObjectAttachedToAnchorFrame().

◆ RegisterAtCorrectPage()

void SwAnchoredDrawObject::RegisterAtCorrectPage ( )
overrideprivatevirtual

method to assure that anchored object is registered at the correct page frame

#i28701#

Implements SwAnchoredObject.

Definition at line 924 of file anchoreddrawobject.cxx.

References SwFrame::FindPageFrame(), SwAnchoredObject::GetPageFrame(), SwAnchoredObject::GetVertPosOrientFrame(), and RegisterAtPage().

◆ RegisterAtPage()

void SwAnchoredDrawObject::RegisterAtPage ( SwPageFrame rPageFrame)
overridevirtual

◆ SetDrawObjAnchor()

void SwAnchoredDrawObject::SetDrawObjAnchor ( )
private

method to set internal anchor position of <SdrObject> instance of the drawing object

For drawing objects the internal anchor position of the <SdrObject> instance has to be set. Note: This adjustment is not be done for as-character anchored drawing object - the positioning code takes care of this. #i31698# - API for drawing objects in Writer has been adjusted. Thus, this method will only set the internal anchor position of the <SdrObject> instance to the anchor position given by its anchor frame.

Definition at line 504 of file anchoreddrawobject.cxx.

References SwTextBoxHelper::changeAnchor(), SwAnchoredObject::DrawObj(), SwAnchoredObject::GetAnchorFrame(), SdrObject::GetAnchorPos(), SwAnchoredObject::GetDrawObj(), SwFrame::GetFrameAnchorPos(), GetFrameFormat(), Point::getX(), Point::getY(), HasWrap(), SwAnchoredObject::InvalidateObjRectWithSpaces(), SwTextBoxHelper::isTextBox(), SdrObject::Move(), RES_DRAWFRMFMT(), and SdrObject::SetAnchorPos().

Referenced by MakeObjPosAnchoredAtPara().

◆ SetLastObjRect()

void SwAnchoredDrawObject::SetLastObjRect ( const tools::Rectangle _rNewObjRect)

◆ SetObjLeft_()

bool SwAnchoredDrawObject::SetObjLeft_ ( const SwTwips  _nLeft)
overrideprivatevirtual

◆ SetObjTop_()

bool SwAnchoredDrawObject::SetObjTop_ ( const SwTwips  _nTop)
overrideprivatevirtual

◆ SetPositioningAttr()

void SwAnchoredDrawObject::SetPositioningAttr ( )
private

method to set positioning attributes (not for as-character anchored)

method to set positioning attributes

During load the positioning attributes aren't set. Thus, the positioning attributes are set by the current object geometry. This method is also used for the conversion for drawing objects (not anchored as-character) imported from OpenOffice.org file format once and directly before the first positioning.

#i35798# During load the positioning attributes aren't set. Thus, the positioning attributes are set by the current object geometry. This method is also used for the conversion for drawing objects (not anchored as-character) imported from OpenOffice.org file format once and directly before the first positioning.

Definition at line 843 of file anchoreddrawobject.cxx.

References SwAnchoredObject::GetDrawObj(), GetFrameFormat(), SwFrameFormat::GetLayoutDir(), GetObjRect(), SwFormatVertOrient::GetPos(), SwFormatHoriOrient::GetPos(), GetUserCall(), SwFrameFormat::HORI_L2R, SwFrameFormat::HORI_R2L, SwAnchoredObject::InvalidateObjRectWithSpaces(), SwRect::Left(), SwContact::ObjAnchoredAsChar(), SwFormat::SetFormatAttr(), SwFormatVertOrient::SetPos(), SwFormatHoriOrient::SetPos(), SwFrameFormat::SetPositionLayoutDir(), SwRect::Top(), SwFrameFormat::VERT_R2L, and SwRect::Width().

Referenced by MakeObjPos().

◆ UpdateLayoutDir()

void SwAnchoredDrawObject::UpdateLayoutDir ( )
overridevirtual

method update layout direction the layout direction, the anchored object is assigned to

method update layout direction the layout direction, the anchored object is in

method has typically to be called, if the anchored object gets its anchor frame assigned and if the anchor frame changes its layout direction

#i31698# method has typically to be called, if the anchored object gets its anchor frame assigned.

Reimplemented from SwAnchoredObject.

Definition at line 215 of file anchoreddrawobject.cxx.

References DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, sw::proofreadingiterator::get(), GetFrameFormat(), IsOutsidePage(), mbCaptureAfterLayoutDirChange, NotYetPositioned(), and SwAnchoredObject::UpdateLayoutDir().

◆ ValidateThis()

void SwAnchoredDrawObject::ValidateThis ( )
inline

Definition at line 161 of file anchoreddrawobject.hxx.

References mbValidPos.

Member Data Documentation

◆ maLastObjRect

std::optional<tools::Rectangle> SwAnchoredDrawObject::maLastObjRect
private

Definition at line 36 of file anchoreddrawobject.hxx.

Referenced by GetLastObjRect(), and SetLastObjRect().

◆ mbCaptureAfterLayoutDirChange

bool SwAnchoredDrawObject::mbCaptureAfterLayoutDirChange
private

Definition at line 52 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos(), and UpdateLayoutDir().

◆ mbNotYetAttachedToAnchorFrame

bool SwAnchoredDrawObject::mbNotYetAttachedToAnchorFrame
private

Definition at line 41 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos(), and ObjectAttachedToAnchorFrame().

◆ mbNotYetPositioned

bool SwAnchoredDrawObject::mbNotYetPositioned
private

Definition at line 46 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos(), and NotYetPositioned().

◆ mbValidPos

bool SwAnchoredDrawObject::mbValidPos
private

The documentation for this class was generated from the following files: