Update ooo320-m1
[ooovba.git] / writerfilter / source / dmapper / GraphicImport.hxx
blob6ff1c3fee9a5ab4d86e53b5a998ec348c29deb3b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: GraphicImport.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_GRAPHICIMPORT_HXX
31 #define INCLUDED_GRAPHICIMPORT_HXX
33 //#ifndef INCLUDED_WRITERFILTERDLLAPI_H
34 //#include <WriterFilterDllApi.hxx>
35 //#endif
36 #include <resourcemodel/WW8ResourceModel.hxx>
37 //#include <com/sun/star/lang/XComponent.hpp>
38 namespace com{ namespace sun { namespace star {
39 namespace uno{
40 class XComponentContext;
42 namespace lang
44 class XMultiServiceFactory;
46 namespace text
48 class XTextContent;
50 namespace drawing
52 class XShape;
54 namespace beans
56 class PropertyValue;
57 typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > PropertyValues;
59 }}}
61 namespace writerfilter {
62 namespace dmapper
64 using namespace std;
65 class GraphicImport_Impl;
66 class DomainMapper;
68 enum GraphicImportType
70 IMPORT_AS_GRAPHIC,
71 IMPORT_AS_SHAPE,
72 IMPORT_AS_DETECTED_INLINE,
73 IMPORT_AS_DETECTED_ANCHOR
74 };
76 class WRITERFILTER_DLLPRIVATE GraphicImport : public Properties, public Table
77 ,public BinaryObj, public Stream
79 GraphicImport_Impl* m_pImpl;
80 ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > m_xComponentContext;
81 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xTextFactory;
83 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > m_xGraphicObject;
85 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> m_xShape;
86 void ProcessShapeOptions(Value & val);
88 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > createGraphicObject(
89 const ::com::sun::star::beans::PropertyValues& aMediaProperties );
91 public:
92 explicit GraphicImport(::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > xComponentContext,
93 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xTextFactory,
94 DomainMapper& rDomainMapper,
95 GraphicImportType eGraphicImportType);
96 virtual ~GraphicImport();
98 // Properties
99 virtual void attribute(Id Name, Value & val);
100 virtual void sprm(Sprm & sprm);
102 // Table
103 virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
105 // BinaryObj
106 virtual void data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t ref);
108 // Stream
109 virtual void startSectionGroup();
110 virtual void endSectionGroup();
111 virtual void startParagraphGroup();
112 virtual void endParagraphGroup();
113 virtual void startCharacterGroup();
114 virtual void endCharacterGroup();
115 virtual void text(const sal_uInt8 * data, size_t len);
116 virtual void utext(const sal_uInt8 * data, size_t len);
117 virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
118 virtual void table(Id name,
119 writerfilter::Reference<Table>::Pointer_t ref);
120 virtual void substream(Id name,
121 ::writerfilter::Reference<Stream>::Pointer_t ref);
122 virtual void info(const string & info);
123 virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
124 virtual void endShape( );
126 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > GetGraphicObject();
127 bool IsGraphic() const;
129 typedef boost::shared_ptr< GraphicImport > GraphicImportPtr;
132 #endif //