13334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 53334a7e6SAndrew Rist * distributed with this work for additional information 63334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 83334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 93334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 103334a7e6SAndrew Rist * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 123334a7e6SAndrew Rist * 133334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 143334a7e6SAndrew Rist * software distributed under the License is distributed on an 153334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 173334a7e6SAndrew Rist * specific language governing permissions and limitations 183334a7e6SAndrew Rist * under the License. 193334a7e6SAndrew Rist * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVDOGRAF_HXX 25cdf0e10cSrcweir #define _SVDOGRAF_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp> 28cdf0e10cSrcweir #include <vcl/graph.hxx> 29cdf0e10cSrcweir #include <svx/svdorect.hxx> 30cdf0e10cSrcweir #include <svtools/grfmgr.hxx> 31cdf0e10cSrcweir #include "svx/svxdllapi.h" 32cdf0e10cSrcweir 33cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 34cdf0e10cSrcweir // predeclarations 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace sdr 37cdf0e10cSrcweir { 38cdf0e10cSrcweir namespace properties 39cdf0e10cSrcweir { 40cdf0e10cSrcweir class GraphicProperties; 41cdf0e10cSrcweir } // end of namespace properties 42cdf0e10cSrcweir namespace contact 43cdf0e10cSrcweir { 44cdf0e10cSrcweir class ViewObjectContactOfGraphic; 45cdf0e10cSrcweir } // end of namespace contact 46cdf0e10cSrcweir } // end of namespace sdr 47cdf0e10cSrcweir 48cdf0e10cSrcweir // ----------- 49cdf0e10cSrcweir // - Defines - 50cdf0e10cSrcweir // ----------- 51cdf0e10cSrcweir 52cdf0e10cSrcweir #define SDRGRAFOBJ_TRANSFORMATTR_NONE 0x00000000UL 53cdf0e10cSrcweir #define SDRGRAFOBJ_TRANSFORMATTR_COLOR 0x00000001UL 54cdf0e10cSrcweir #define SDRGRAFOBJ_TRANSFORMATTR_MIRROR 0x00000002UL 55cdf0e10cSrcweir #define SDRGRAFOBJ_TRANSFORMATTR_ROTATE 0x00000004UL 56cdf0e10cSrcweir #define SDRGRAFOBJ_TRANSFORMATTR_ALL 0xffffffffUL 57cdf0e10cSrcweir 58cdf0e10cSrcweir // --------------------- 59cdf0e10cSrcweir // - SdrGrafObjGeoData - 60cdf0e10cSrcweir // --------------------- 61cdf0e10cSrcweir 62cdf0e10cSrcweir // #109872# 63cdf0e10cSrcweir class SdrGrafObjGeoData : public SdrTextObjGeoData 64cdf0e10cSrcweir { 65cdf0e10cSrcweir public: 66cdf0e10cSrcweir sal_Bool bMirrored; 67cdf0e10cSrcweir SdrGrafObjGeoData()68cdf0e10cSrcweir SdrGrafObjGeoData() 69cdf0e10cSrcweir : bMirrored(sal_False) 70cdf0e10cSrcweir { 71cdf0e10cSrcweir } 72cdf0e10cSrcweir }; 73cdf0e10cSrcweir 74cdf0e10cSrcweir // -------------- 75cdf0e10cSrcweir // - SdrGrafObj - 76cdf0e10cSrcweir // -------------- 77cdf0e10cSrcweir 78cdf0e10cSrcweir class GraphicObject; 79cdf0e10cSrcweir class SdrGraphicLink; 80cdf0e10cSrcweir 81cdf0e10cSrcweir class SVX_DLLPUBLIC SdrGrafObj : public SdrRectObj 82cdf0e10cSrcweir { 83cdf0e10cSrcweir private: 84cdf0e10cSrcweir // to allow sdr::properties::GraphicProperties access to SetXPolyDirty() 85cdf0e10cSrcweir friend class sdr::properties::GraphicProperties; 86cdf0e10cSrcweir 87cdf0e10cSrcweir // to allow sdr::contact::ViewObjectContactOfGraphic access to ImpUpdateGraphicLink() 88cdf0e10cSrcweir friend class sdr::contact::ViewObjectContactOfGraphic; 89cdf0e10cSrcweir friend class SdrGraphicLink; 90cdf0e10cSrcweir 91cdf0e10cSrcweir protected: 92cdf0e10cSrcweir virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 93cdf0e10cSrcweir virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 94cdf0e10cSrcweir 95cdf0e10cSrcweir void ImpSetAttrToGrafInfo(); // Werte vom Pool kopieren 96cdf0e10cSrcweir void ImpSetGrafInfoToAttr(); // Werte in den Pool kopieren 97cdf0e10cSrcweir GraphicAttr aGrafInfo; 98cdf0e10cSrcweir 99cdf0e10cSrcweir Rectangle aCropRect; // Wenn aCropRect nicht Empty ist, dann enthaelt es den sichtbaren 100cdf0e10cSrcweir // Ausschnitt der Grafik in logischen Eingeiten der Grafik! Also Bitmap->=Pixel 101cdf0e10cSrcweir String aFileName; // Wenn es sich um einen Link handelt, steht hier der Dateiname drin. 102cdf0e10cSrcweir String aFilterName; 103cdf0e10cSrcweir GraphicObject* pGraphic; // Zur Beschleunigung von Bitmapausgaben, besonders von gedrehten. 104ddde725dSArmin Le Grand GraphicObject* mpReplacementGraphic; 105cdf0e10cSrcweir SdrGraphicLink* pGraphicLink; // Und hier noch ein Pointer fuer gelinkte Grafiken 106cdf0e10cSrcweir bool bMirrored; // True bedeutet, die Grafik ist horizontal, d.h. ueber die Y-Achse gespiegelt auszugeben. 107cdf0e10cSrcweir 108cdf0e10cSrcweir // #111096# 109cdf0e10cSrcweir // Flag for allowing text animation. Default is sal_true. 110cdf0e10cSrcweir unsigned mbGrafAnimationAllowed : 1; 111cdf0e10cSrcweir 112cdf0e10cSrcweir // #i25616# 113cdf0e10cSrcweir unsigned mbInsidePaint : 1; 114cdf0e10cSrcweir unsigned mbIsPreview : 1; 115cdf0e10cSrcweir 116cdf0e10cSrcweir protected: 117cdf0e10cSrcweir 118cdf0e10cSrcweir void ImpLinkAnmeldung(); 119cdf0e10cSrcweir void ImpLinkAbmeldung(); 120cdf0e10cSrcweir sal_Bool ImpUpdateGraphicLink( sal_Bool bAsynchron = sal_True ) const; 121cdf0e10cSrcweir void ImpSetLinkedGraphic( const Graphic& rGraphic ); 122cdf0e10cSrcweir DECL_LINK( ImpSwapHdl, GraphicObject* ); 123172c67b2SArmin Le Grand void onGraphicChanged(); 124cdf0e10cSrcweir 125cdf0e10cSrcweir public: 126cdf0e10cSrcweir 127cdf0e10cSrcweir TYPEINFO(); 128cdf0e10cSrcweir 129cdf0e10cSrcweir SdrGrafObj(); 130cdf0e10cSrcweir SdrGrafObj(const Graphic& rGrf); 131cdf0e10cSrcweir SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect); 132cdf0e10cSrcweir virtual ~SdrGrafObj(); 133cdf0e10cSrcweir 134ddde725dSArmin Le Grand void SetGraphicObject( const GraphicObject& rGrfObj ); 135cdf0e10cSrcweir const GraphicObject& GetGraphicObject( bool bForceSwapIn = false) const; 136ddde725dSArmin Le Grand const GraphicObject* GetReplacementGraphicObject() const; 137cdf0e10cSrcweir 138cdf0e10cSrcweir void NbcSetGraphic(const Graphic& rGrf); 139cdf0e10cSrcweir void SetGraphic(const Graphic& rGrf); 140cdf0e10cSrcweir const Graphic& GetGraphic() const; 141cdf0e10cSrcweir 142cdf0e10cSrcweir Graphic GetTransformedGraphic( sal_uIntPtr nTransformFlags = SDRGRAFOBJ_TRANSFORMATTR_ALL ) const; 143cdf0e10cSrcweir 144cdf0e10cSrcweir GraphicType GetGraphicType() const; 145cdf0e10cSrcweir 146cdf0e10cSrcweir // #111096# 147cdf0e10cSrcweir // Keep ATM for SD. 148cdf0e10cSrcweir sal_Bool IsAnimated() const; 149cdf0e10cSrcweir sal_Bool IsEPS() const; 150cdf0e10cSrcweir sal_Bool IsSwappedOut() const; 151cdf0e10cSrcweir 152cdf0e10cSrcweir const MapMode& GetGrafPrefMapMode() const; 153cdf0e10cSrcweir const Size& GetGrafPrefSize() const; 154cdf0e10cSrcweir 155cdf0e10cSrcweir void SetGrafStreamURL( const String& rGraphicStreamURL ); 156cdf0e10cSrcweir String GetGrafStreamURL() const; 157cdf0e10cSrcweir 158cdf0e10cSrcweir void ForceSwapIn() const; 159cdf0e10cSrcweir void ForceSwapOut() const; 160cdf0e10cSrcweir 161cdf0e10cSrcweir void SetGraphicLink(const String& rFileName, const String& rFilterName); 162cdf0e10cSrcweir void ReleaseGraphicLink(); IsLinkedGraphic() const163cdf0e10cSrcweir sal_Bool IsLinkedGraphic() const { return (sal_Bool)aFileName.Len(); } 164cdf0e10cSrcweir 165cdf0e10cSrcweir void SetFileName(const String& rFileName); GetFileName() const166cdf0e10cSrcweir const String& GetFileName() const { return aFileName; } 167cdf0e10cSrcweir void SetFilterName(const String& rFilterName); GetFilterName() const168cdf0e10cSrcweir const String& GetFilterName() const { return aFilterName; } 169cdf0e10cSrcweir 170cdf0e10cSrcweir void StartAnimation(OutputDevice* pOutDev, const Point& rPoint, const Size& rSize, long nExtraData=0L); 171cdf0e10cSrcweir void StopAnimation(OutputDevice* pOutDev=NULL, long nExtraData=0L); 172cdf0e10cSrcweir 173cdf0e10cSrcweir virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 174cdf0e10cSrcweir virtual sal_uInt16 GetObjIdentifier() const; 175cdf0e10cSrcweir 176cdf0e10cSrcweir virtual void TakeObjNameSingul(String& rName) const; 177cdf0e10cSrcweir virtual void TakeObjNamePlural(String& rName) const; 178cdf0e10cSrcweir 179cdf0e10cSrcweir // #i25616# 180cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 181cdf0e10cSrcweir 182cdf0e10cSrcweir virtual void operator=(const SdrObject& rObj); 183cdf0e10cSrcweir 184cdf0e10cSrcweir virtual sal_uInt32 GetHdlCount() const; 185cdf0e10cSrcweir virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 186cdf0e10cSrcweir 187cdf0e10cSrcweir virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); 188cdf0e10cSrcweir virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs); 189cdf0e10cSrcweir virtual void NbcMirror(const Point& rRef1, const Point& rRef2); 190cdf0e10cSrcweir virtual void NbcShear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear); 191cdf0e10cSrcweir virtual void NbcSetSnapRect(const Rectangle& rRect); 192cdf0e10cSrcweir virtual void NbcSetLogicRect(const Rectangle& rRect); 193cdf0e10cSrcweir virtual SdrObjGeoData* NewGeoData() const; 194cdf0e10cSrcweir virtual void SaveGeoData(SdrObjGeoData& rGeo) const; 195cdf0e10cSrcweir virtual void RestGeoData(const SdrObjGeoData& rGeo); 196cdf0e10cSrcweir 197cdf0e10cSrcweir FASTBOOL HasGDIMetaFile() const; 198cdf0e10cSrcweir const GDIMetaFile* GetGDIMetaFile() const; 199cdf0e10cSrcweir 200cdf0e10cSrcweir virtual void SetPage(SdrPage* pNewPage); 201cdf0e10cSrcweir virtual void SetModel(SdrModel* pNewModel); 202cdf0e10cSrcweir 203ddde725dSArmin Le Grand bool isEmbeddedSvg() const; 204ddde725dSArmin Le Grand GDIMetaFile getMetafileFromEmbeddedSvg() const; 205ddde725dSArmin Le Grand 206ddde725dSArmin Le Grand virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const; 207cdf0e10cSrcweir 208cdf0e10cSrcweir virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false ); 209cdf0e10cSrcweir 210cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 211cdf0e10cSrcweir IsMirrored() const2122376739dSArmin Le Grand bool IsMirrored() const { return bMirrored; } SetMirrored(bool _bMirrored)213cdf0e10cSrcweir void SetMirrored( bool _bMirrored ) { bMirrored = _bMirrored; } 214cdf0e10cSrcweir 215cdf0e10cSrcweir // #111096# 216cdf0e10cSrcweir // Access to GrafAnimationAllowed flag 217cdf0e10cSrcweir sal_Bool IsGrafAnimationAllowed() const; 218cdf0e10cSrcweir void SetGrafAnimationAllowed(sal_Bool bNew); 219cdf0e10cSrcweir 220cdf0e10cSrcweir // #i25616# 221cdf0e10cSrcweir sal_Bool IsObjectTransparent() const; 222cdf0e10cSrcweir 223cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream(); 224cdf0e10cSrcweir 225cdf0e10cSrcweir // #i103116# FullDrag support 226cdf0e10cSrcweir virtual SdrObject* getFullDragClone() const; 227*414a0e15SArmin Le Grand 228*414a0e15SArmin Le Grand // add handles for crop mode when selected 229*414a0e15SArmin Le Grand void addCropHandles(SdrHdlList& rTarget) const; 230cdf0e10cSrcweir }; 231cdf0e10cSrcweir 232cdf0e10cSrcweir #endif //_SVDOGRAF_HXX 233