class SwFlyFrame; class SwFrame; class SwPageFrame; class SwVirtFlyDrawObj; class SwFlyDrawObj; class SwRect; class SwDrawContact; class SdrTextObj; class SwContact;
/** The other way round: Search format for given object. IfobjectisaSwVirtFlyDrawObjtheformatwillbeobtainedfromit. IfnotitisasimpleDrawObject.IthasaUserCallwhich isclientoftheformatwearelookingfor.
Implementation in dcontact.cxx. */
SW_DLLPUBLIC SwFrameFormat *FindFrameFormat( SdrObject *pObj ); inlineconst SwFrameFormat *FindFrameFormat( const SdrObject *pObj )
{ return ::FindFrameFormat( const_cast<SdrObject*>(pObj) ); } bool HasWrap( const SdrObject* pObj );
/// @return UserCall of group object (if applicable).
SAL_RET_MAYBENULL SwContact* GetUserCall( const SdrObject* );
/// @return TRUE if the SrdObject is a Marquee object. bool IsMarqueeTextObj( const SdrObject& rObj );
/// Base class for the following contact objects (frame + draw objects). class SAL_DLLPUBLIC_RTTI SwContact : public SdrObjUserCall, public SwClient
{ /** boolean, indicating destruction of contact object importantnote:booleanhastobesetatthebeginningofeachdestructor
in the subclasses using method <SetInDTOR()>. */ bool mbInDTOR;
/** method to move object to visible/invisible layer
/** some virtual helper methods for information
about the object (Writer fly frame resp. drawing object) */ const SwFormatAnchor& GetAnchorFormat() const
{
assert( GetFormat() );
/** get data collection of anchored objects, handled by with contact */ virtualvoid GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
/** get minimum order number of anchored objects handled by with contact
*/
sal_uInt32 GetMinOrdNum() const;
/** get maximum order number of anchored objects handled by with contact
*/
sal_uInt32 GetMaxOrdNum() const;
};
/** ContactObject for connection between frames (or their formats respectively)
in SwClient and the drawobjects of Drawing (SdrObjUserCall). */
class SW_DLLPUBLIC SwFlyDrawContact final : public SwContact
{ private:
rtl::Reference<SwFlyDrawObj> mpMasterObj; void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
sal_uInt32 GetOrdNumForNewRef(const SwFlyFrame* pFly, SwFrame const& rAnchorFrame);
public:
/// Creates DrawObject and registers it with the Model.
SwFlyDrawContact(SwFlyFrameFormat* pToRegisterIn, SdrModel& rTargetModel); static SwVirtFlyDrawObj* CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFormat* pFormat, SwFrame const& rAnchorFrame); virtual ~SwFlyDrawContact() override;
/** override methods to control Writer fly frames, whicharelinked,andtoassurethatallobjectsanchoredat/insidethe
Writer fly frame are also made visible/invisible. */ virtualvoid MoveObjToVisibleLayer( SdrObject* _pDrawObj ) override; virtualvoid MoveObjToInvisibleLayer( SdrObject* _pDrawObj ) override;
/** get data collection of anchored objects handled by with contact */ virtualvoid GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const override;
};
/** new class for re-direct methods calls at a 'virtual' drawingobjecttoitsreferencedobject. Forexample,ifanSdrObjectisanchoredinaheader,thenlaterpageswillhaveaSwDrawVirtObj
in later headers. */ class SwDrawVirtObj final : public SdrVirtObj
{ private: // data for connection to writer layout /** anchored drawing object instance for the
'virtual' drawing object */
SwAnchoredDrawObject maAnchoredDrawObj;
/** writer-drawing contact object the 'virtual' drawing object is controlled by. Thisobjectisalsothe<UserCall>ofthedrawingobject,ifit's
inserted into the drawing layer. */
SwDrawContact& mrDrawContact;
/** AW: Need own sdr::contact::ViewContact since AnchorPos from parent is notusedbutsomethingown(topleftofnewSnapRectminustopleft
of original SnapRect) */ virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
/** ContactObject for connection of formats as representatives of draw objects
in SwClient and the objects themselves in Drawing (SDrObjUserCall). */
class SAL_DLLPUBLIC_RTTI SwDrawContact final : public SwContact
{ private: /** anchored drawing object instance for the
'master' drawing object */
SwAnchoredDrawObject maAnchoredDrawObj;
/** container for 'virtual' drawing object supporting drawing objects in headers/footers. */
std::vector< rtl::Reference<SwDrawVirtObj> > maDrawVirtObjs;
/** boolean indicating set 'master' drawing
object has been cleared. */ bool mbMasterObjCleared : 1;
/** internal flag to indicate that disconnect
from layout is in progress */ bool mbDisconnectInProgress : 1;
/** Needed data for handling of nested <SdrObjUserCall> events in
method <Changed_(..)> */ bool mbUserCallActive : 1; /** event type, which is handled for <mpSdrObjHandledByCurrentUserCall>.
Note: value only valid, if <mbUserCallActive> is true. */
SdrUserCallType meEventTypeOfCurrentUserCall;
/** Inserts SdrObject in the arrays of the layout ((SwPageFrame and SwFrame). TheanchorisdeterminedaccordingtotheattributeSwFormatAnchor.
If required the object gets unregistered with the old anchor. */ void ConnectToLayout( const SwFormatAnchor *pAnch = nullptr ); /** method to insert 'master' drawing object
into drawing page */ void InsertMasterIntoDrawPage();
void DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer = true ); /** disconnect for a dedicated drawing object -
could be 'master' or 'virtual'. */ void DisconnectObjFromLayout( SdrObject* _pDrawObj ); /** method to remove 'master' drawing object fromdrawingpage. Tobeusedbytheundofordeleteofobject.Callitaftermethod <DisconnectFromLayout(bool=true)>isalreadyperformed. Note:<DisconnectFromLayout(bool)>nolongerremovesthe'master'
drawing object from drawing page. */ void RemoveMasterFromDrawPage();
void RemoveAllVirtObjs();
/** get drawing object ('master' or 'virtual')
by frame. */
SdrObject* GetDrawObjectByAnchorFrame( const SwFrame& _rAnchorFrame );
/** Used by Changed() and by UndoDraw.
Notifies paragraphs that have to get out of the way. */ void Changed_(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle* pOldBoundRect);
/// Moves all SW-connections to new Master) void ChangeMasterObject( SdrObject *pNewMaster );
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.