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

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...
 
bool IsValidPos () const
 
virtual SwFrameFormatGetFrameFormat () override
 
virtual const SwFrameFormatGetFrameFormat () const override
 
virtual SwRect GetObjRect () const override
 
boost::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 ()
 
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 (long nDiff)
 
void ResetLastCharRectHeight ()
 
SwTwips GetLastTopOfLine () const
 
void AddLastTopOfLineY (SwTwips _nDiff)
 
void ClearCharRectAndTopOfLine ()
 reset members <maLastCharRect> and <mnLastTopOfLine> 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...
 
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...
 
const PointGetCurrRelPos () const
 
void SetCurrRelPos (Point _aRelPos)
 
void SetObjTop (const SwTwips _nTop)
 
void SetObjLeft (const SwTwips _nLeft)
 
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 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) const
 Dump a bunch of useful data to an XML representation to ease layout understanding, debugging and testing. More...
 

Protected Member Functions

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
 
- Protected Member Functions inherited from SwAnchoredObject
 SwAnchoredObject ()
 
void SetVertPosOrientFrame (const SwLayoutFrame &_rVertPosOrientFrame)
 
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...
 

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...
 

Private Attributes

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

Detailed Description

class for the positioning of drawing objects

Definition at line 28 of file anchoreddrawobject.hxx.

Constructor & Destructor Documentation

SwAnchoredDrawObject::SwAnchoredDrawObject ( )

Definition at line 185 of file anchoreddrawobject.cxx.

SwAnchoredDrawObject::~SwAnchoredDrawObject ( )
overridevirtual

Definition at line 196 of file anchoreddrawobject.cxx.

Member Function Documentation

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 696 of file anchoreddrawobject.cxx.

References SwAnchoredObject::GetDrawObj(), SwFrame::GetFrameAnchorPos(), GetFrameFormat(), GetObjRect(), HasWrap(), SwFrame::IsRightToLeft(), SwFrame::IsVertical(), SwRect::Left(), sw::sidebar::NONE, SwRect::Right(), SwFormat::SetFormatAttr(), SwRect::Top(), Point::X(), and Point::Y().

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.

SwFrameFormat & SwAnchoredDrawObject::GetFrameFormat ( )
overridevirtual
const SwFrameFormat & SwAnchoredDrawObject::GetFrameFormat ( ) const
overridevirtual

Implements SwAnchoredObject.

Definition at line 602 of file anchoreddrawobject.cxx.

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

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

Definition at line 124 of file anchoreddrawobject.hxx.

References SwAnchoredObject::maLastObjRect.

Referenced by SwDrawContact::Changed_().

SwRect SwAnchoredDrawObject::GetObjBoundRect ( ) const
overrideprotectedvirtual
SwRect SwAnchoredDrawObject::GetObjRect ( ) const
overridevirtual
void SwAnchoredDrawObject::InvalidateObjPos ( )
overridevirtual
void SwAnchoredDrawObject::InvalidatePage_ ( SwPageFrame _pPageFrame)
private
bool SwAnchoredDrawObject::IsOutsidePage ( ) const
bool SwAnchoredDrawObject::IsValidPos ( ) const
inline

Definition at line 112 of file anchoreddrawobject.hxx.

void SwAnchoredDrawObject::MakeObjPos ( )
overridevirtual
void SwAnchoredDrawObject::MakeObjPosAnchoredAtLayout ( )
private
void SwAnchoredDrawObject::MakeObjPosAnchoredAtPara ( )
private
void SwAnchoredDrawObject::NotifyBackground ( SwPageFrame _pPageFrame,
const SwRect _rRect,
PrepareHint  _eHint 
)
overridevirtual

method to notify background of drawing object

Implements SwAnchoredObject.

Definition at line 822 of file anchoreddrawobject.cxx.

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

Referenced by SwPosNotify::~SwPosNotify().

bool SwAnchoredDrawObject::NotYetPositioned ( ) const
inline
void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame ( )
overrideprotectedvirtual

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

Reimplemented from SwAnchoredObject.

Definition at line 733 of file anchoreddrawobject.cxx.

References mbNotYetAttachedToAnchorFrame, and SwAnchoredObject::ObjectAttachedToAnchorFrame().

void SwAnchoredDrawObject::RegisterAtCorrectPage ( )
overrideprotectedvirtual

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

#i28701#

Implements SwAnchoredObject.

Definition at line 834 of file anchoreddrawobject.cxx.

References SwPageFrame::AppendDrawObjToPage(), SwFrame::FindPageFrame(), SwAnchoredObject::GetPageFrame(), SwAnchoredObject::GetVertPosOrientFrame(), and SwPageFrame::RemoveDrawObjFromPage().

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 490 of file anchoreddrawobject.cxx.

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

Referenced by MakeObjPosAnchoredAtPara().

void SwAnchoredDrawObject::SetLastObjRect ( const tools::Rectangle _rNewObjRect)
bool SwAnchoredDrawObject::SetObjLeft_ ( const SwTwips  _nLeft)
overrideprotectedvirtual
bool SwAnchoredDrawObject::SetObjTop_ ( const SwTwips  _nTop)
overrideprotectedvirtual
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 753 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().

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 201 of file anchoreddrawobject.cxx.

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

void SwAnchoredDrawObject::ValidateThis ( )
inline

Definition at line 161 of file anchoreddrawobject.hxx.

Member Data Documentation

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

Definition at line 36 of file anchoreddrawobject.hxx.

Referenced by SetLastObjRect().

bool SwAnchoredDrawObject::mbCaptureAfterLayoutDirChange
private

Definition at line 52 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos(), and UpdateLayoutDir().

bool SwAnchoredDrawObject::mbNotYetAttachedToAnchorFrame
private

Definition at line 41 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos(), and ObjectAttachedToAnchorFrame().

bool SwAnchoredDrawObject::mbNotYetPositioned
private

Definition at line 46 of file anchoreddrawobject.hxx.

Referenced by MakeObjPos().

bool SwAnchoredDrawObject::mbValidPos
private

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