Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_OLEHANDLER_HXX
20 : #define INCLUDED_OLEHANDLER_HXX
21 :
22 : #include <resourcemodel/LoggedResources.hxx>
23 : #include <boost/shared_ptr.hpp>
24 : #include <com/sun/star/awt/Size.hpp>
25 : #include <com/sun/star/awt/Point.hpp>
26 :
27 : #include <com/sun/star/drawing/XShape.hpp>
28 :
29 : namespace com{ namespace sun{ namespace star{
30 : namespace graphic{
31 : class XGraphic;
32 : }
33 : namespace io{
34 : class XInputStream;
35 : }
36 : namespace text{
37 : class XTextDocument;
38 : }
39 : }}}
40 : namespace writerfilter {
41 : namespace dmapper
42 : {
43 : /** Handler for OLE objects
44 : */
45 : class OLEHandler : public LoggedProperties
46 : {
47 : OUString m_sObjectType;
48 : OUString m_sProgId;
49 : OUString m_sShapeId;
50 : OUString m_sDrawAspect;
51 : OUString m_sObjectId;
52 : OUString m_sr_id;
53 :
54 : sal_Int32 m_nDxaOrig;
55 : sal_Int32 m_nDyaOrig;
56 : sal_Int32 m_nWrapMode;
57 :
58 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xShape;
59 :
60 : ::com::sun::star::awt::Size m_aShapeSize;
61 : ::com::sun::star::awt::Point m_aShapePosition;
62 :
63 : ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement;
64 :
65 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream;
66 :
67 : // Properties
68 : virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE;
69 : virtual void lcl_sprm(Sprm & sprm) SAL_OVERRIDE;
70 :
71 : // Interoperability
72 : virtual void saveInteropProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xTextDocument,
73 : const OUString& sObjectName );
74 :
75 : public:
76 : OLEHandler();
77 : virtual ~OLEHandler();
78 :
79 0 : inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
80 :
81 0 : inline bool isOLEObject( ) { return m_xInputStream.is( ); };
82 :
83 : OUString copyOLEOStream( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument > xTextDocument );
84 :
85 0 : ::com::sun::star::awt::Size getSize() const { return m_aShapeSize;}
86 : ::com::sun::star::awt::Point getPosition() const { return m_aShapePosition;}
87 : ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
88 0 : getReplacement() const { return m_xReplacement; }
89 :
90 : };
91 : typedef boost::shared_ptr< OLEHandler > OLEHandlerPtr;
92 : }}
93 :
94 : #endif
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|