1*b8a377c6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*b8a377c6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*b8a377c6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*b8a377c6SAndrew Rist * distributed with this work for additional information 6*b8a377c6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*b8a377c6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*b8a377c6SAndrew Rist * "License"); you may not use this file except in compliance 9*b8a377c6SAndrew Rist * with the License. You may obtain a copy of the License at 10*b8a377c6SAndrew Rist * 11*b8a377c6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*b8a377c6SAndrew Rist * 13*b8a377c6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*b8a377c6SAndrew Rist * software distributed under the License is distributed on an 15*b8a377c6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b8a377c6SAndrew Rist * KIND, either express or implied. See the License for the 17*b8a377c6SAndrew Rist * specific language governing permissions and limitations 18*b8a377c6SAndrew Rist * under the License. 19*b8a377c6SAndrew Rist * 20*b8a377c6SAndrew Rist *************************************************************/ 21*b8a377c6SAndrew Rist 22*b8a377c6SAndrew Rist 23cdf0e10cSrcweir #ifndef INCLUDED_OLEHANDLER_HXX 24cdf0e10cSrcweir #define INCLUDED_OLEHANDLER_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef INCLUDED_WRITERFILTERDLLAPI_H 27cdf0e10cSrcweir #include <WriterFilterDllApi.hxx> 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir #include <resourcemodel/LoggedResources.hxx> 30cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 31cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp> 32cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp> 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace com{ namespace sun{ namespace star{ 37cdf0e10cSrcweir namespace embed{ 38cdf0e10cSrcweir class XEmbeddedObject; 39cdf0e10cSrcweir } 40cdf0e10cSrcweir namespace graphic{ 41cdf0e10cSrcweir class XGraphic; 42cdf0e10cSrcweir } 43cdf0e10cSrcweir namespace io{ 44cdf0e10cSrcweir class XInputStream; 45cdf0e10cSrcweir } 46cdf0e10cSrcweir namespace text{ 47cdf0e10cSrcweir class XTextDocument; 48cdf0e10cSrcweir } 49cdf0e10cSrcweir namespace uno{ 50cdf0e10cSrcweir class XComponentContext; 51cdf0e10cSrcweir } 52cdf0e10cSrcweir }}} 53cdf0e10cSrcweir namespace writerfilter { 54cdf0e10cSrcweir namespace dmapper 55cdf0e10cSrcweir { 56cdf0e10cSrcweir //class PropertyMap; 57cdf0e10cSrcweir /** Handler for OLE objects 58cdf0e10cSrcweir */ 59cdf0e10cSrcweir class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties 60cdf0e10cSrcweir { 61cdf0e10cSrcweir ::rtl::OUString m_sObjectType; 62cdf0e10cSrcweir ::rtl::OUString m_sProgId; 63cdf0e10cSrcweir ::rtl::OUString m_sShapeId; 64cdf0e10cSrcweir ::rtl::OUString m_sDrawAspect; 65cdf0e10cSrcweir ::rtl::OUString m_sObjectId; 66cdf0e10cSrcweir ::rtl::OUString m_sr_id; 67cdf0e10cSrcweir 68cdf0e10cSrcweir sal_Int32 m_nDxaOrig; 69cdf0e10cSrcweir sal_Int32 m_nDyaOrig; 70cdf0e10cSrcweir sal_Int32 m_nWrapMode; 71cdf0e10cSrcweir 72cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xShape; 73cdf0e10cSrcweir 74cdf0e10cSrcweir ::com::sun::star::awt::Size m_aShapeSize; 75cdf0e10cSrcweir ::com::sun::star::awt::Point m_aShapePosition; 76cdf0e10cSrcweir 77cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; 78cdf0e10cSrcweir 79cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; 80cdf0e10cSrcweir 81cdf0e10cSrcweir // Properties 82cdf0e10cSrcweir virtual void lcl_attribute(Id Name, Value & val); 83cdf0e10cSrcweir virtual void lcl_sprm(Sprm & sprm); 84cdf0e10cSrcweir 85cdf0e10cSrcweir public: 86cdf0e10cSrcweir OLEHandler(); 87cdf0e10cSrcweir virtual ~OLEHandler(); 88cdf0e10cSrcweir getShape()89cdf0e10cSrcweir inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; }; 90cdf0e10cSrcweir isOLEObject()91cdf0e10cSrcweir inline bool isOLEObject( ) { return m_xInputStream.is( ); }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir ::rtl::OUString copyOLEOStream( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xTextDocument ); 94cdf0e10cSrcweir getSize() const95cdf0e10cSrcweir ::com::sun::star::awt::Size getSize() const { return m_aShapeSize;} getPosition() const96cdf0e10cSrcweir ::com::sun::star::awt::Point getPosition() const { return m_aShapePosition;} 97cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getReplacement() const98cdf0e10cSrcweir getReplacement() const { return m_xReplacement; } 99cdf0e10cSrcweir 100cdf0e10cSrcweir }; 101cdf0e10cSrcweir typedef boost::shared_ptr< OLEHandler > OLEHandlerPtr; 102cdf0e10cSrcweir }} 103cdf0e10cSrcweir 104cdf0e10cSrcweir #endif // 105