LibreOffice Module sw (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
objectpositioning::SwToContentAnchoredObjectPosition Class Reference

#include <tocntntanchoredobjectposition.hxx>

Inheritance diagram for objectpositioning::SwToContentAnchoredObjectPosition:
[legend]
Collaboration diagram for objectpositioning::SwToContentAnchoredObjectPosition:
[legend]

Public Member Functions

 SwToContentAnchoredObjectPosition (SdrObject &_rDrawObj)
 
virtual ~SwToContentAnchoredObjectPosition () override
 
virtual void CalcPosition () override
 calculate position of object More...
 
const SwLayoutFrameGetVertPosOrientFrame () const
 frame, at which the vertical position is oriented at More...
 
void CalcOverlap (const SwTextFrame *pAnchorFrameForVertPos, Point &rRelPos, const SwTwips nTopOfAnch)
 In case overlap is not allowed, re-position the current object. More...
 

Private Member Functions

virtual bool IsAnchoredToChar () const override
 
virtual const SwFrameToCharOrientFrame () const override
 
virtual const SwRectToCharRect () const override
 
virtual SwTwips ToCharTopOfLine () const override
 
SwTextFrameGetAnchorTextFrame () const
 
const SwFrameGetHoriVirtualAnchor (const SwLayoutFrame &_pProposedFrame) const
 determine frame for horizontal position More...
 

Private Attributes

const SwLayoutFramempVertPosOrientFrame
 
Point maOffsetToFrameAnchorPos
 
bool mbAnchorToChar
 
const SwFramempToCharOrientFrame
 
const SwRectmpToCharRect
 
SwTwips mnToCharTopOfLine
 

Additional Inherited Members

- Protected Member Functions inherited from objectpositioning::SwAnchoredObjectPosition
 SwAnchoredObjectPosition (SdrObject &_rDrawObj)
 
virtual ~SwAnchoredObjectPosition ()
 
SdrObjectGetObject () const
 
bool IsObjFly () const
 
SwAnchoredObjectGetAnchoredObj () const
 
SwFrameGetAnchorFrame () const
 
const SwFrameFormatGetFrameFormat () const
 
bool DoesObjFollowsTextFlow () const
 
SwTwips GetTopForObjPos (const SwFrame &_rFrame, const SwRectFn &_fnRect, const bool _bVert) const
 helper method to determine top of a frame for the vertical object positioning More...
 
void GetVertAlignmentValues (const SwFrame &_rVertOrientFrame, const SwFrame &_rPageAlignLayFrame, const sal_Int16 _eRelOrient, SwTwips &_orAlignAreaHeight, SwTwips &_orAlignAreaOffset) const
 
SwTwips GetVertRelPos (const SwFrame &_rVertOrientFrame, const SwFrame &_rPageAlignLayFrame, const sal_Int16 _eVertOrient, const sal_Int16 _eRelOrient, const SwTwips _nVertPos, const SvxLRSpaceItem &_rLRSpacing, const SvxULSpaceItem &_rULSpacing, SwTwips &_roVertOffsetToFrameAnchorPos) const
 
SwTwips AdjustVertRelPos (const SwTwips nTopOfAnch, const bool bVert, const bool bVertL2R, const SwFrame &rPageAlignLayFrame, const SwTwips nProposedRelPosY, const bool bFollowTextFlow, const bool bCheckBottom=true) const
 adjust calculated vertical in order to keep object inside 'page' alignment layout frame. More...
 
SwTwips CalcRelPosX (const SwFrame &_rHoriOrientFrame, const SwEnvironmentOfAnchoredObject &_rEnvOfObj, const SwFormatHoriOrient &_rHoriOrient, const SvxLRSpaceItem &_rLRSpacing, const SvxULSpaceItem &_rULSpacing, const bool _bObjWrapThrough, const SwTwips _nRelPosY, SwTwips &_roHoriOffsetToFrameAnchorPos) const
 calculate relative horizontal position More...
 
SwTwips AdjustHoriRelPos (const SwFrame &_rPageAlignLayFrame, const SwTwips _nProposedRelPosX) const
 adjust calculated horizontal in order to keep object inside 'page' alignment layout frame for object type position TO_CNTNT More...
 
void GetHoriAlignmentValues (const SwFrame &_rHoriOrientFrame, const SwFrame &_rPageAlignLayFrame, const sal_Int16 _eRelOrient, const bool _bObjWrapThrough, SwTwips &_orAlignAreaWidth, SwTwips &_orAlignAreaOffset, bool &_obAlignedRelToPage) const
 determine alignment values for horizontal position of object More...
 
SwTwips AdjustHoriRelPosForDrawAside (const SwFrame &_rHoriOrientFrame, const SwTwips _nProposedRelPosX, const SwTwips _nRelPosY, const sal_Int16 _eHoriOrient, const sal_Int16 _eRelOrient, const SvxLRSpaceItem &_rLRSpacing, const SvxULSpaceItem &_rULSpacing, const bool _bEvenPage) const
 adjust calculated horizontal position in order to draw object aside other objects with same positioning More...
 
bool DrawAsideFly (const SwFlyFrame *_pFly, const SwRect &_rObjRect, const SwFrame *_pObjContext, const sal_uLong _nObjIndex, const bool _bEvenPage, const sal_Int16 _eHoriOrient, const sal_Int16 _eRelOrient) const
 determine, if object has to draw aside given fly frame More...
 
- Static Protected Member Functions inherited from objectpositioning::SwAnchoredObjectPosition
static void ToggleHoriOrientAndAlign (const bool _bToggleLeftRight, sal_Int16 &_ioeHoriOrient, sal_Int16 &_iopeRelOrient)
 toggle given horizontal orientation and relative alignment More...
 
static bool Minor_ (sal_Int16 _eRelOrient1, sal_Int16 _eRelOrient2, bool _bLeft)
 determine, if object has to draw aside another object More...
 

Detailed Description

Definition at line 30 of file tocntntanchoredobjectposition.hxx.

Constructor & Destructor Documentation

SwToContentAnchoredObjectPosition::SwToContentAnchoredObjectPosition ( SdrObject _rDrawObj)

Definition at line 52 of file tocntntanchoredobjectposition.cxx.

SwToContentAnchoredObjectPosition::~SwToContentAnchoredObjectPosition ( )
overridevirtual

Definition at line 64 of file tocntntanchoredobjectposition.cxx.

Member Function Documentation

void SwToContentAnchoredObjectPosition::CalcOverlap ( const SwTextFrame pAnchorFrameForVertPos,
Point rRelPos,
const SwTwips  nTopOfAnch 
)
void SwToContentAnchoredObjectPosition::CalcPosition ( )
overridevirtual

calculate position of object

Implements objectpositioning::SwAnchoredObjectPosition.

Definition at line 141 of file tocntntanchoredobjectposition.cxx.

References objectpositioning::SwAnchoredObjectPosition::AdjustVertRelPos(), SwRectFnSet::BottomDist(), CalcOverlap(), objectpositioning::SwAnchoredObjectPosition::CalcRelPosX(), SwAnchoredObject::CheckCharRectAndTopOfLine(), objectpositioning::SwAnchoredObjectPosition::DoesObjFollowsTextFlow(), SwFrame::FindFooterOrHeader(), SwFrame::FindPageFrame(), SwFrame::FindSctFrame(), SwFrame::FindTabFrame(), SwRectFnSet::FnRect(), SwFormat::GetAnchor(), objectpositioning::SwAnchoredObjectPosition::GetAnchoredObj(), objectpositioning::SwAnchoredObjectPosition::GetAnchorFrame(), SwFormatAnchor::GetAnchorId(), GetAnchorTextFrame(), SwRectFnSet::GetBottom(), SwViewOption::getBrowseMode(), SwFormatAnchor::GetContentAnchor(), SwRootFrame::GetCurrShell(), SwTextFrame::GetFollow(), SwFrameAreaDefinition::getFrameArea(), objectpositioning::SwAnchoredObjectPosition::GetFrameFormat(), SwFrameAreaDefinition::getFramePrintArea(), SwFormat::GetFrameSize(), SwRectFnSet::GetHeight(), SwFormatFrameSize::GetHeightPercent(), SwFormat::GetHoriOrient(), GetHoriVirtualAnchor(), SwFrame::GetIndPrev(), SwAnchoredObject::GetLastCharRect(), SwAnchoredObject::GetLastTopOfLine(), SwFrame::GetLeaf(), SvxLRSpaceItem::GetLeft(), SvxULSpaceItem::GetLower(), SwFormat::GetLRSpace(), SwFrame::GetNext(), SwRectFnSet::GetPrtBottom(), SwRectFnSet::GetPrtTop(), SvxLRSpaceItem::GetRight(), SwFrame::getRootFrame(), SwFormatSurround::GetSurround(), SwFormat::GetSurround(), SwRectFnSet::GetTop(), objectpositioning::SwAnchoredObjectPosition::GetTopForObjPos(), SwRectFnSet::GetTopMargin(), SwFormat::GetULSpace(), SvxULSpaceItem::GetUpper(), SwFrame::GetUpper(), objectpositioning::SwAnchoredObjectPosition::GetVertAlignmentValues(), objectpositioning::SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrame(), SwFormat::GetVertOrient(), SwViewShell::GetViewOptions(), SwFrame::Grow(), Height, SwFlowFrame::IsAnFollow(), SwFrame::IsColumnFrame(), SwFrame::IsFooterFrame(), SwFrame::IsFootnoteFrame(), SwFrame::IsInDocBody(), SwFrame::IsInFootnote(), SwFrame::IsInSct(), SwFrame::IsInTab(), SwFrame::IsMoveable(), SwFrame::IsSctFrame(), SwFrame::IsTextFrame(), SwRectFnSet::IsVert(), SwRectFnSet::IsVertL2R(), lcl_DoesVertPosFits(), SwRect::Left(), SwLayoutFrame::Lower(), MAKEPAGE_APPEND, MAKEPAGE_NONE, MAKEPAGE_NOSECTION, maOffsetToFrameAnchorPos, SwTextFrame::MapModelToViewPos(), mbAnchorToChar, mnToCharTopOfLine, mpToCharOrientFrame, mpToCharRect, mpVertPosOrientFrame, SwPostItHelper::NONE, nTopMargin, SwRectFnSet::Refresh(), SwAnchoredObject::SetCurrRelPos(), SwAnchoredObject::SetObjLeft(), SwAnchoredObject::SetObjTop(), Point::setX(), Point::setY(), ToCharRect(), ToCharTopOfLine(), SwRect::Top(), Width, SwRect::Width(), Point::X(), Point::Y(), and SwRectFnSet::YDiff().

Referenced by SwFlyAtContentFrame::MakeObjPos(), and SwAnchoredDrawObject::MakeObjPosAnchoredAtPara().

SwTextFrame & SwToContentAnchoredObjectPosition::GetAnchorTextFrame ( ) const
private
const SwFrame & SwToContentAnchoredObjectPosition::GetHoriVirtualAnchor ( const SwLayoutFrame _pProposedFrame) const
private

determine frame for horizontal position

Determine frame for horizontal position.

if the given proposed frame is a content frame, the proposed frame is returned. otherwise (given proposed frame is a layout frame), the lower content frames of the proposed frame are checked for the first, that the anchor or a follow of the anchor. If none is found, the proposed frame is returned.

Parameters
_pProposedFrameinput parameter - proposed frame for horizontal position
Returns
constant reference to <SwFrame> object, at which the horizontal position is determined.

Definition at line 1166 of file tocntntanchoredobjectposition.cxx.

References GetAnchorTextFrame(), SwFrame::GetNext(), SwFlowFrame::IsAnFollow(), SwFrame::IsContentFrame(), and SwLayoutFrame::Lower().

Referenced by CalcPosition().

const SwLayoutFrame& objectpositioning::SwToContentAnchoredObjectPosition::GetVertPosOrientFrame ( ) const
inline

frame, at which the vertical position is oriented at

Definition at line 83 of file tocntntanchoredobjectposition.hxx.

References mpVertPosOrientFrame.

Referenced by SwFlyAtContentFrame::MakeObjPos(), and SwAnchoredDrawObject::MakeObjPosAnchoredAtPara().

bool SwToContentAnchoredObjectPosition::IsAnchoredToChar ( ) const
overrideprivatevirtual

Reimplemented from objectpositioning::SwAnchoredObjectPosition.

Definition at line 67 of file tocntntanchoredobjectposition.cxx.

References mbAnchorToChar.

const SwFrame * SwToContentAnchoredObjectPosition::ToCharOrientFrame ( ) const
overrideprivatevirtual

Reimplemented from objectpositioning::SwAnchoredObjectPosition.

Definition at line 72 of file tocntntanchoredobjectposition.cxx.

References mpToCharOrientFrame.

const SwRect * SwToContentAnchoredObjectPosition::ToCharRect ( ) const
overrideprivatevirtual

Reimplemented from objectpositioning::SwAnchoredObjectPosition.

Definition at line 77 of file tocntntanchoredobjectposition.cxx.

References mpToCharRect.

Referenced by CalcPosition().

SwTwips SwToContentAnchoredObjectPosition::ToCharTopOfLine ( ) const
overrideprivatevirtual

Reimplemented from objectpositioning::SwAnchoredObjectPosition.

Definition at line 83 of file tocntntanchoredobjectposition.cxx.

References mnToCharTopOfLine.

Referenced by CalcPosition().

Member Data Documentation

Point objectpositioning::SwToContentAnchoredObjectPosition::maOffsetToFrameAnchorPos
private

Definition at line 38 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition().

bool objectpositioning::SwToContentAnchoredObjectPosition::mbAnchorToChar
private

Definition at line 41 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition(), and IsAnchoredToChar().

SwTwips objectpositioning::SwToContentAnchoredObjectPosition::mnToCharTopOfLine
private

Definition at line 44 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition(), and ToCharTopOfLine().

const SwFrame* objectpositioning::SwToContentAnchoredObjectPosition::mpToCharOrientFrame
private

Definition at line 42 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition(), and ToCharOrientFrame().

const SwRect* objectpositioning::SwToContentAnchoredObjectPosition::mpToCharRect
private

Definition at line 43 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition(), and ToCharRect().

const SwLayoutFrame* objectpositioning::SwToContentAnchoredObjectPosition::mpVertPosOrientFrame
private

Definition at line 34 of file tocntntanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetVertPosOrientFrame().


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