class SwFrame; class SwLayoutFrame; class SwTextFrame; class SwFlyFrame; class SwPageFrame;
class SwFrameFormat; class SwFormatAnchor; enumclass RndStdIds;
/** wrapper class for the positioning of Writer fly frames and drawing objects
Purposeofthisclassistoprovideaunifiedinterfaceforthepositioning ofWriterflyframes(derivedclassesof<SwFlyFrame>)andofdrawingobjects (derivedclassesof<SwAnchoredDrawObject>).
*/ class SAL_DLLPUBLIC_RTTI SwAnchoredObject
{ private: // drawing object representing the anchored object in the drawing layer
rtl::Reference<SdrObject> mpDrawObj; /// Frame the object is anchored at. /// For at-char/at-para anchor, this is always the master SwTextFrame.
SwFrame* mpAnchorFrame; // #i28701 - page frame the object is registered at // note: no page frame for as-character anchored objects
SwPageFrame* mpPageFrame; // current relative position (relative to anchor position of anchor frame)
Point maRelPos;
// for to-character anchored objects: // Last known anchor character rectangle. // Used to decide, if invalidation has to been performed, if anchor position // has changed, and used to position object.
SwRect maLastCharRect;
// for to-character anchored objects: // Last known top of line, in which the anchor character is in. // Used to decide, if invalidation has to been performed, if anchor position // has changed, and used to position object.
SwTwips mnLastTopOfLine;
// for to-paragraph and to-character anchored objects: // Layout frame vertical position is orient at - typically it's the upper // of the anchor frame, but it could also by the upper of a follow or // a following layout frame in the text flow. const SwLayoutFrame* mpVertPosOrientFrame;
// i#i28701 boolean, indicating that the object // positioning algorithm is in progress. bool mbPositioningInProgress;
// Booleans needed for the layout process. // Values only of relevance for to-paragraph and to-character anchored // floating screen object, for whose the 'straight-forward positioning // process are applied // Otherwise value of <mbConsiderForTextWrap> is treated as <true>, // value of <mbPositionLocked> is treated as <false> and // value of <mbRestartLayoutProcess> is treated as <false>. // i#35911 - add boolean <mbClearEnvironment> // Indicates that due to its position and wrapping style its layout // environment is cleared - all content is moved forward. // Treated as <false>, if not the 'straight-forward positioning process" // is applied. bool mbConsiderForTextWrap; bool mbPositionLocked; // boolean needed to keep position of // anchored object locked due to special object positioning for sections. bool mbKeepPositionLockedForSection;
// i#i3317 - boolean, indicating that temporarily // the wrapping style influence of the anchored object has to be // considered during its positioning. // This boolean is used, if compatibility option 'Consider wrapping style // influence on object positioning' is OFF and a positioning loop is // detected in method <SwFlyAtContentFrame::MakeAll()> or method // <SwAnchoredDrawObject::MakeObjPosAnchoredAtPara()>. // The boolean is reset to <false>, when the layout process for a // page frame starts. bool mbTmpConsiderWrapInfluence;
/** method to assure that anchored object is registered at the correct pageframe
*/ virtualvoid RegisterAtCorrectPage() = 0;
/** method to indicate, that anchored object is attached to an anchor frame */ virtualvoid ObjectAttachedToAnchorFrame();
/** method to determine, if other anchored objects, also attached at totheanchorframe,havetoconsideritswrapinfluence.
*/ bool ConsiderObjWrapInfluenceOfOtherObjs() const;
/** method to apply temporary consideration of wrapping style influence totheanchoredobjects,whichareanchoredatthesameanchorframe
*/ void SetTmpConsiderWrapInfluenceOfOtherObjs();
// accessors to data of position calculation: // frame vertical position is orient at const SwLayoutFrame* GetVertPosOrientFrame() const
{ return mpVertPosOrientFrame;
} // method to clear member <mpVertPosOrientFrame> void ClearVertPosOrientFrame();
/** check anchor character rectangle and top of line
// accessor to member <nmLastTopOfLine>
SwTwips GetLastTopOfLine() const { return mnLastTopOfLine;} void AddLastTopOfLineY( SwTwips _nDiff );
/** reset members <maLastCharRect> and <mnLastTopOfLine> */ void ClearCharRectAndTopOfLine();
/** method to determine position for the object and set the position attheobject
*/ virtualvoid MakeObjPos() = 0;
/** is positioning of anchored object in progress */ bool IsPositioningInProgress() const
{ return mbPositioningInProgress;
}
/** method to determine, if invalidation of position is allowed */ bool InvalidationOfPosAllowed() const;
/** method to invalidate position of the anchored object */ virtualvoid InvalidateObjPos() = 0;
virtualvoid RegisterAtPage(SwPageFrame &) = 0;
/** method to perform necessary invalidations for the positioning of objects,forwhosethewrappingstyleinfluencehastobeconsidered ontheobjectpositioning.
*/ void InvalidateObjPosForConsiderWrapInfluence();
/** method to trigger notification of 'background' */ virtualvoid NotifyBackground( SwPageFrame* _pPageFrame, const SwRect& _rRect,
PrepareHint _eHint ) = 0;
// accessors to the current relative position (relative to anchor // position of anchor frame) const Point& GetCurrRelPos() const { return maRelPos;} void SetCurrRelPos( Point _aRelPos );
// accessors to the format virtual SwFrameFormat* GetFrameFormat() = 0; virtualconst SwFrameFormat* GetFrameFormat() const = 0;
// accessors to the object area and its position virtual SwRect GetObjRect() const = 0;
@returnPoint-determinedrelativeposition
*/
Point GetRelPosToPageFrame( constbool _bFollowTextFlow, bool& _obRelToTableCell ) const;
/** method to determine position of anchored object relative to anchorcharacter
Usage:NeededlayoutinformationforWW8export
@returnPoint-determinedrelativeposition
*/
Point GetRelPosToChar() const;
/** method to determine position of anchored object relative to topofline
Usage:NeededlayoutinformationforWW8export
@returnPoint-determinedrelativeposition
*/
Point GetRelPosToLine() const;
/** Dump a bunch of useful data to an XML representation to ease layoutunderstanding,debuggingandtesting.
*/ virtualvoid dumpAsXml( xmlTextWriterPtr pWriter = nullptr ) const;
/** The element name to show in the XML dump. */ virtualconstchar* getElementName( ) const { return"SwAnchoredObject"; }
/// Helper class for notify that positioning of an anchored object is in progress. class SwObjPositioningInProgress
{ private:
SwAnchoredObject* mpAnchoredObj; // boolean indicating old state // of anchored object regarding positioning in progress in order to // consider nested usage of class <SwObjPositioningInProgress> bool mbOldObjPositioningInProgress;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.