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

#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
 

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
 
bool DoesObjLayoutInCell () 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 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 58 of file ascharanchoredobjectposition.hxx.

Constructor & Destructor Documentation

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 37 of file ascharanchoredobjectposition.cxx.

References mnFlags, and NONE.

SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition ( )
overridevirtual

destructor

Definition at line 59 of file ascharanchoredobjectposition.cxx.

Member Function Documentation

void 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 78 of file ascharanchoredobjectposition.cxx.

References 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(), SwAnchoredDrawObject::GetObjRect(), SwAnchoredObject::GetObjRect(), SwFormatVertOrient::GetPos(), SwFlyInContentFrame::GetRefPoint(), GetRelPosToBase(), SvxLRSpaceItem::GetRight(), SdrObject::GetSnapRect(), 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, sw::sidebar::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().

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

Definition at line 145 of file ascharanchoredobjectposition.hxx.

References maAnchorPos.

Referenced by SwFlyCntPortion::SetBase().

const SwTextFrame & SwAsCharAnchoredObjectPosition::GetAnchorTextFrame ( ) const
private
sw::LineAlign objectpositioning::SwAsCharAnchoredObjectPosition::GetLineAlignment ( ) const
inline

Definition at line 154 of file ascharanchoredobjectposition.hxx.

References mnLineAlignment.

Referenced by SwFlyCntPortion::SetBase().

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

Definition at line 151 of file ascharanchoredobjectposition.hxx.

References maObjBoundRect.

Referenced by SwFlyCntPortion::SetBase().

SwTwips 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 334 of file ascharanchoredobjectposition.cxx.

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

Referenced by CalcPosition().

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

Definition at line 148 of file ascharanchoredobjectposition.hxx.

References mnRelPos.

Referenced by SwFlyCntPortion::SetBase().

Member Data Documentation

Point objectpositioning::SwAsCharAnchoredObjectPosition::maAnchorPos
private

Definition at line 80 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetAnchorPos().

SwRect objectpositioning::SwAsCharAnchoredObjectPosition::maObjBoundRect
private

Definition at line 82 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetObjBoundRectInclSpacing().

const AsCharFlags objectpositioning::SwAsCharAnchoredObjectPosition::mnFlags
private

Definition at line 72 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition().

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

Definition at line 84 of file ascharanchoredobjectposition.hxx.

Referenced by GetLineAlignment(), and GetRelPosToBase().

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineAscent
private

Definition at line 74 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineAscentInclObjs
private

Definition at line 76 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetRelPosToBase().

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineDescent
private

Definition at line 75 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

const SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnLineDescentInclObjs
private

Definition at line 77 of file ascharanchoredobjectposition.hxx.

Referenced by GetRelPosToBase().

SwTwips objectpositioning::SwAsCharAnchoredObjectPosition::mnRelPos
private

Definition at line 81 of file ascharanchoredobjectposition.hxx.

Referenced by CalcPosition(), and GetRelPosY().

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: