fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svx / svdoole2.hxx
blobee5542c90def602e4510b17aaa4079b21093b310
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SVDOOLE2_HXX
21 #define _SVDOOLE2_HXX
23 #include <svtools/embedhlp.hxx>
24 #include <com/sun/star/uno/Reference.h>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/datatransfer/XTransferable.hpp>
27 #include "com/sun/star/awt/XWindow.hpp"
28 #include <svx/svdorect.hxx>
29 #include <vcl/graph.hxx>
30 #include <vcl/gdimtf.hxx>
31 #include <sot/storage.hxx>
32 #include "svx/svxdllapi.h"
34 //************************************************************
35 // SdrOle2Obj
36 //************************************************************
38 class SvxUnoShapeModifyListener;
39 class SdrOle2ObjImpl;
41 class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
43 private:
45 SVX_DLLPRIVATE void Connect_Impl();
46 SVX_DLLPRIVATE void Disconnect_Impl();
47 SVX_DLLPRIVATE void Reconnect_Impl();
48 SVX_DLLPRIVATE void AddListeners_Impl();
49 SVX_DLLPRIVATE void RemoveListeners_Impl();
50 SVX_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::datatransfer::XTransferable > GetTransferable_Impl() const;
51 SVX_DLLPRIVATE void GetObjRef_Impl();
52 SVX_DLLPRIVATE void SetGraphic_Impl(const Graphic* pGrf);
54 // #i118485# helper added
55 SdrObject* createSdrGrafObjReplacement(bool bAddText, bool bUseHCGraphic) const;
57 protected:
58 virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
59 virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
61 svt::EmbeddedObjectRef xObjRef;
62 Graphic* pGraphic;
63 String aProgName;
65 // wg. Kompatibilitaet erstmal am SdrTextObj
66 bool bFrame:1;
67 bool bInDestruction:1;
68 // #i118524#
69 bool mbSuppressSetVisAreaSize:1;
70 mutable bool m_bTypeAsked:1;
71 mutable bool m_bChart:1;
73 SdrOle2ObjImpl* mpImpl;
75 SvxUnoShapeModifyListener* pModifyListener;
77 protected:
79 void ImpSetVisAreaSize();
80 void Init();
82 public:
83 TYPEINFO();
85 SdrOle2Obj(bool bFrame_ = false);
86 SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, const String& rNewObjName, const Rectangle& rNewRect, bool bFrame_ = false);
87 virtual ~SdrOle2Obj();
89 // access to svt::EmbeddedObjectRef
90 const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const { return xObjRef; }
92 sal_Int64 GetAspect() const { return xObjRef.GetViewAspect(); }
93 bool isInplaceActive() const;
94 bool isUiActive() const;
95 void SetAspect( sal_Int64 nAspect );
97 // Ein OLE-Zeichenobjekt kann eine StarView-Grafik beinhalten.
98 // Diese wird angezeigt, wenn das OLE-Objekt leer ist.
99 void SetGraphic(const Graphic* pGrf);
100 const Graphic* GetGraphic() const;
101 void GetNewReplacement();
103 // the original size of the object ( size of the icon for iconified object )
104 // no conversion is done if no target mode is provided
105 Size GetOrigObjSize( MapMode* pTargetMapMode = NULL ) const;
107 // #i118524# Allow suppress SetVisAreaSize in changing methods when call
108 // comes from OLE client
109 void setSuppressSetVisAreaSize(bool bNew) { mbSuppressSetVisAreaSize = bNew; }
111 // OLE object has got a separate PersistName member now;
112 // !!! use ::SetPersistName( ... ) only, if you know what you do !!!
113 String GetPersistName() const;
114 void SetPersistName( const String& rPersistName );
116 // Einem SdrOle2Obj kann man ein Applikationsnamen verpassen, den man
117 // spaeter wieder abfragen kann (SD braucht das fuer Praesentationsobjekte).
118 void SetProgName(const String& rNam) { aProgName=rNam; }
119 const String& GetProgName() const { return aProgName; }
120 bool IsEmpty() const;
122 void SetObjRef(const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rNewObjRef);
123 com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObjRef() const;
125 SVX_DLLPRIVATE com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObjRef_NoInit() const;
127 void AbandonObject();
129 virtual void SetPage(SdrPage* pNewPage);
130 virtual void SetModel(SdrModel* pModel);
132 /** Change the IsClosedObj attribute
134 @param bIsClosed
135 Whether the OLE object is closed, i.e. has opaque background
137 void SetClosedObj( bool bIsClosed );
139 // FullDrag support
140 virtual SdrObject* getFullDragClone() const;
142 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
143 virtual sal_uInt16 GetObjIdentifier() const;
144 virtual void TakeObjNameSingul(String& rName) const;
145 virtual void TakeObjNamePlural(String& rName) const;
147 SdrOle2Obj* Clone() const;
148 SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
150 virtual void NbcMove(const Size& rSize);
151 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
152 virtual void NbcSetSnapRect(const Rectangle& rRect);
153 virtual void NbcSetLogicRect(const Rectangle& rRect);
154 virtual void SetGeoData(const SdrObjGeoData& rGeo);
156 static sal_Bool CanUnloadRunningObj( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
157 sal_Int64 nAspect );
158 static sal_Bool Unload( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
159 sal_Bool Unload();
160 void Connect();
161 void Disconnect();
162 void ObjectLoaded();
164 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getXModel() const;
166 // #109985#
167 sal_Bool IsChart() const;
168 sal_Bool IsCalc() const;
170 sal_Bool UpdateLinkURL_Impl();
171 void BreakFileLink_Impl();
172 void DisconnectFileLink_Impl();
173 void CheckFileLink_Impl();
175 // allows to transfer the graphics to the object helper
176 void SetGraphicToObj( const Graphic& aGraphic, const OUString& aMediaType );
177 void SetGraphicToObj( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xGrStream,
178 const OUString& aMediaType );
180 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
181 sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
182 sal_Bool AddOwnLightClient();
184 // handy to get the empty replacement bitmap without accessing all the old stuff
185 static Bitmap GetEmtyOLEReplacementBitmap();
187 void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow);
189 // #i118485# missing converter added
190 virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
193 #endif //_SVDOOLE2_HXX
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */