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

#include <ascharanchoredobjectposition.hxx>

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

Public Member Functions

 SwAsCharAnchoredObjectPosition (SdrObject &_rDrawObj, const Point &_rProposedAnchorPos, const AsCharFlags _nFlags, const SwTwips _nLineAscent, const SwTwips _nLineDescent, const SwTwips _nLineAscentInclObjs, const SwTwips _nLineDescentInclObjs)
 constructor; provided object to be positioned and needed data for calculation of the object position More...
 
virtual ~SwAsCharAnchoredObjectPosition () override
 destructor More...
 
virtual void CalcPosition () override
 calculate position for object position More...
 
const PointGetAnchorPos () const
 
SwTwips GetRelPosY () const
 
const SwRectGetObjBoundRectInclSpacing () const
 
sw::LineAlign GetLineAlignment () const
 
virtual void CalcPosition ()=0
 

Private Member Functions

const SwTextFrameGetAnchorTextFrame () const
 method to cast <SwAnchoredObjectPosition::GetAnchorFrame()> to needed type More...
 
SwTwips GetRelPosToBase (const SwTwips _nObjBoundHeight, const SwFormatVertOrient &_rVert)
 determine the relative position to base line for object position More...
 

Private Attributes

const PointmrProposedAnchorPos
 
const AsCharFlags mnFlags
 
const SwTwips mnLineAscent
 
const SwTwips mnLineDescent
 
const SwTwips mnLineAscentInclObjs
 
const SwTwips mnLineDescentInclObjs
 
Point maAnchorPos
 
SwTwips mnRelPos
 
SwRect maObjBoundRect
 
sw::LineAlign mnLineAlignment
 

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
 
virtual bool IsAnchoredToChar () const
 
virtual const SwFrameToCharOrientFrame () const
 
virtual const SwRectToCharRect () const
 
virtual SwTwips ToCharTopOfLine () 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 SwNodeOffset _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 58 of file ascharanchoredobjectposition.hxx.

Constructor & Destructor Documentation

◆ SwAsCharAnchoredObjectPosition()

objectpositioning::SwAsCharAnchoredObjectPosition::SwAsCharAnchoredObjectPosition ( SdrObject _rDrawObj,
const Point _rProposedAnchorPos,
const AsCharFlags  _nFlags,
const SwTwips  _nLineAscent,
const SwTwips  _nLineDescent,
const SwTwips  _nLineAscentInclObjs,
const SwTwips  _nLineDescentInclObjs 
)

constructor; provided object to be positioned and needed data for calculation of the object position

constructor

Parameters
_rDrawObjinput parameter - object, that is be positioned.
_rProposedAnchorPosproposed anchor position; starting point for the calculation of the anchor position
_nFlagsflags that influences the calculation of the anchor position AsCharFlags::Quick : quick formatting - calculated position not set at object AsCharFlags::UlSpace : consider upper/lower spacing - adjustment of anchor position AsCharFlags::Init : initial calculation AsCharFlags::Rotate : object is rotated by 90 degrees AsCharFlags::Reverse : object is reversed (rotated by 270 degrees) AsCharFlags::Bidi : object belongs to a BIDI-multi-portion
_nLineAscent,_nLineDescent,_nLineAscentInclObjs,_nLineDescentInclObjs- needed line values for the different alignments.

Definition at line 40 of file ascharanchoredobjectposition.cxx.

References mnFlags, and NONE.

◆ ~SwAsCharAnchoredObjectPosition()

objectpositioning::SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition ( )
overridevirtual

destructor

Definition at line 60 of file ascharanchoredobjectposition.cxx.

Member Function Documentation

◆ CalcPosition()

void objectpositioning::SwAsCharAnchoredObjectPosition::CalcPosition ( )
overridevirtual

calculate position for object position

calculate position for object

members <maAnchorPos>, <mnRelPos>, <maObjBoundRect> and <mnLineAlignment> are calculated. calculated position is set at the given object.

OD 30.07.2003 #110978# members <maAnchorPos>, <mnRelPos>, <maObjBoundRect> and <mnLineAlignment> are calculated. calculated position is set at the given object.

Implements objectpositioning::SwAnchoredObjectPosition.

Definition at line 79 of file ascharanchoredobjectposition.cxx.

References SwRect::AddHeight(), SwRect::AddLeft(), SwRect::AddTop(), SwRect::AddWidth(), Point::AdjustX(), Point::AdjustY(), Bidi, objectpositioning::SwAnchoredObjectPosition::GetAnchoredObj(), GetAnchorTextFrame(), SwAnchoredObject::GetCurrRelPos(), SwFrameAreaDefinition::getFrameArea(), objectpositioning::SwAnchoredObjectPosition::GetFrameFormat(), SwRectFnSet::GetHeight(), SvxLRSpaceItem::GetLeft(), SvxULSpaceItem::GetLower(), SwFormat::GetLRSpace(), objectpositioning::SwAnchoredObjectPosition::GetObject(), SwAnchoredObject::GetObjRect(), SwAnchoredDrawObject::GetObjRect(), SwFormatVertOrient::GetPos(), SwFlyInContentFrame::GetRefPoint(), GetRelPosToBase(), SvxLRSpaceItem::GetRight(), SwFormat::GetULSpace(), SvxULSpaceItem::GetUpper(), SwFormatVertOrient::GetVertOrient(), SwFormat::GetVertOrient(), SwRectFnSet::GetWidth(), SwRect::Height(), Init, objectpositioning::SwAnchoredObjectPosition::IsObjFly(), SwFrame::IsRightToLeft(), SwFrame::IsVertical(), SwRect::Left(), maAnchorPos, maObjBoundRect, mnFlags, mnLineAscentInclObjs, mnRelPos, SdrObject::Move(), mrProposedAnchorPos, SwPostItHelper::NONE, Quick, Reverse, Rotate, SdrObject::SetAnchorPos(), SwAnchoredDrawObject::SetLastObjRect(), SwFormatVertOrient::SetPos(), SwFlyInContentFrame::SetRefPoint(), Point::setX(), Point::setY(), SwRect::SVRect(), SwTextFrame::SwitchHorizontalToVertical(), SwTextFrame::SwitchLTRtoRTL(), SwTextFrame::SwitchVerticalToHorizontal(), SwRect::Top(), SwRect::TopLeft(), UlSpace, SwRect::Width(), Point::X(), and Point::Y().

Referenced by SwFlyCntPortion::SetBase().

◆ GetAnchorPos()

const Point & objectpositioning::SwAsCharAnchoredObjectPosition::GetAnchorPos ( ) const
inline

Definition at line 145 of file ascharanchoredobjectposition.hxx.

References maAnchorPos.

Referenced by SwFlyCntPortion::SetBase().

◆ GetAnchorTextFrame()

const SwTextFrame & objectpositioning::SwAsCharAnchoredObjectPosition::GetAnchorTextFrame ( ) const
private

◆ GetLineAlignment()

sw::LineAlign objectpositioning::SwAsCharAnchoredObjectPosition::GetLineAlignment ( ) const
inline

Definition at line 154 of file ascharanchoredobjectposition.hxx.

References mnLineAlignment.

Referenced by SwFlyCntPortion::SetBase().

◆ GetObjBoundRectInclSpacing()

const SwRect & objectpositioning::SwAsCharAnchoredObjectPosition::GetObjBoundRectInclSpacing ( ) const
inline

Definition at line 151 of file ascharanchoredobjectposition.hxx.

References maObjBoundRect.

Referenced by SwFlyCntPortion::SetBase().

◆ GetRelPosToBase()

SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::GetRelPosToBase ( const SwTwips  _nObjBoundHeight,
const SwFormatVertOrient _rVert 
)
private

determine the relative position to base line for object position

determine the relative position to base line for object position type AS_CHAR

Parameters
_ObjBoundHeightheight including corresponding spacing of the object, for which the Y-position has to be calculated.
_rVertgiven vertical positioning and alignment
Returns
relative position to the base line

OD 29.07.2003 #110978# Note about values set at member <mnLineAlignment> - value gives feedback for the line formatting. 0 - no feedback; 1|2|3 - proposed formatting of characters at top|at center|at bottom of line.

Definition at line 335 of file ascharanchoredobjectposition.cxx.

References sw::BOTTOM, sw::CENTER, SwFormatVertOrient::GetPos(), SwFormatVertOrient::GetVertOrient(), mnLineAlignment, mnLineAscent, mnLineAscentInclObjs, mnLineDescent, mnLineDescentInclObjs, SwPostItHelper::NONE, sw::NONE, and sw::TOP.

Referenced by CalcPosition().

◆ GetRelPosY()

SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::GetRelPosY ( ) const
inline

Definition at line 148 of file ascharanchoredobjectposition.hxx.

References mnRelPos.

Referenced by SwFlyCntPortion::SetBase().

Member Data Documentation

◆ maAnchorPos

Point objectpositioning::SwAsCharAnchoredObjectPosition::maAnchorPos
private

Definition at line 80 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetAnchorPos().

◆ maObjBoundRect

SwRect objectpositioning::SwAsCharAnchoredObjectPosition::maObjBoundRect
private

Definition at line 82 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetObjBoundRectInclSpacing().

◆ mnFlags

const AsCharFlags objectpositioning::SwAsCharAnchoredObjectPosition::mnFlags
private

Definition at line 72 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition().

◆ mnLineAlignment

sw::LineAlign objectpositioning::SwAsCharAnchoredObjectPosition::mnLineAlignment
private

Definition at line 84 of file ascharanchoredobjectposition.hxx.

Referenced by GetLineAlignment(), and GetRelPosToBase().

◆ mnLineAscent

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineAscent
private

Definition at line 74 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

◆ mnLineAscentInclObjs

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineAscentInclObjs
private

Definition at line 76 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetRelPosToBase().

◆ mnLineDescent

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineDescent
private

Definition at line 75 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

◆ mnLineDescentInclObjs

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineDescentInclObjs
private

Definition at line 77 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

◆ mnRelPos

SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnRelPos
private

Definition at line 81 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetRelPosY().

◆ mrProposedAnchorPos

const Point& objectpositioning::SwAsCharAnchoredObjectPosition::mrProposedAnchorPos
private

Definition at line 64 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition().


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