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