diff options
Diffstat (limited to 'sw/inc/ndgrf.hxx')
-rw-r--r-- | sw/inc/ndgrf.hxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index bf01d924ce46..e970615e9fe8 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -37,7 +37,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode { friend class SwNodes; - GraphicObject aGrfObj; + GraphicObject maGrfObj; GraphicObject *mpReplacementGraphic; ::sfx2::SvBaseLinkRef refLink; ///< If graphics only as link then pointer is set. Size nGrfSize; @@ -76,7 +76,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode void InsertLink( const String& rGrfName, const String& rFltName ); sal_Bool ImportGraphic( SvStream& rStrm ); - sal_Bool HasStreamName() const { return aGrfObj.HasUserData(); } + sal_Bool HasStreamName() const { return maGrfObj.HasUserData(); } /** adjust return type and rename method to indicate that its an private one. */ @@ -128,20 +128,31 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode public: virtual ~SwGrfNode(); - const Graphic& GetGrf() const { return aGrfObj.GetGraphic(); } - const GraphicObject& GetGrfObj() const { return aGrfObj; } - GraphicObject& GetGrfObj() { return aGrfObj; } + const Graphic& GetGrf() const { return maGrfObj.GetGraphic(); } + const GraphicObject& GetGrfObj() const { return maGrfObj; } const GraphicObject* GetReplacementGrfObj() const; - virtual SwCntntNode *SplitCntntNode( const SwPosition & ); + /// isolated only way to set GraphicObject to allow more actions when doing so + void SetGraphic(const Graphic& rGraphic, const String& rLink); + + /// wrappers for non-const calls at GraphicObject + void ReleaseGraphicFromCache() { maGrfObj.ReleaseFromCache(); } + void DrawGraphicWithPDFHandling(OutputDevice& rOutDev, const Point& rPt, const Size& rSz, const GraphicAttr* pGrfAttr = NULL, const sal_uLong nFlags = GRFMGR_DRAW_STANDARD) { maGrfObj.DrawWithPDFHandling(rOutDev, rPt, rSz, pGrfAttr, nFlags); } + void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0, const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD, OutputDevice* pFirstFrameOutDev = NULL) { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pAttr, nFlags, pFirstFrameOutDev); } + void StopGraphicAnimation(OutputDevice* pOut = NULL, long nExtraData = 0) { maGrfObj.StopAnimation(pOut, nExtraData); } + + /// allow reaction on change of content of GraphicObject, so always call + /// when GraphicObject content changes + void onGraphicChanged(); + virtual Size GetTwipSize() const; #ifndef _FESHVIEW_ONLY_INLINE_NEEDED void SetTwipSize( const Size& rSz ); sal_Bool IsTransparent() const; - inline sal_Bool IsAnimated() const { return aGrfObj.IsAnimated(); } + inline sal_Bool IsAnimated() const { return maGrfObj.IsAnimated(); } inline sal_Bool IsChgTwipSize() const { return bChgTwipSize; } inline sal_Bool IsChgTwipSizeFromPixel() const { return bChgTwipSizeFromPixel; } @@ -171,7 +182,7 @@ public: /// Remove graphic in order to free memory. short SwapOut(); /// Access to storage stream-name. - void SetStreamName( const String& r ) { aGrfObj.SetUserData( r ); } + void SetStreamName( const String& r ) { maGrfObj.SetUserData( r ); } void SetNewStreamName( const String& r ) { aNewStrmName = r; } /// Is this node selected by any shell? sal_Bool IsSelected() const; |