1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: GraphicImport.hxx,v $
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>
36 #include <resourcemodel/WW8ResourceModel.hxx>
37 //#include <com/sun/star/lang/XComponent.hpp>
38 namespace com
{ namespace sun
{ namespace star
{
40 class XComponentContext
;
44 class XMultiServiceFactory
;
56 namespace writerfilter
{
60 class GraphicImport_Impl
;
63 enum GraphicImportType
67 IMPORT_AS_DETECTED_INLINE
,
68 IMPORT_AS_DETECTED_ANCHOR
71 class WRITERFILTER_DLLPRIVATE GraphicImport
: public Properties
, public Table
72 ,public BinaryObj
, public Stream
74 GraphicImport_Impl
* m_pImpl
;
75 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xComponentContext
;
76 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xTextFactory
;
78 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextContent
> m_xGraphicObject
;
80 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> m_xShape
;
81 void ProcessShapeOptions(Value
& val
);
84 explicit GraphicImport(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xComponentContext
,
85 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xTextFactory
,
86 DomainMapper
& rDomainMapper
,
87 GraphicImportType eGraphicImportType
);
88 virtual ~GraphicImport();
91 virtual void attribute(Id Name
, Value
& val
);
92 virtual void sprm(Sprm
& sprm
);
95 virtual void entry(int pos
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
98 virtual void data(const sal_uInt8
* buf
, size_t len
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
101 virtual void startSectionGroup();
102 virtual void endSectionGroup();
103 virtual void startParagraphGroup();
104 virtual void endParagraphGroup();
105 virtual void startCharacterGroup();
106 virtual void endCharacterGroup();
107 virtual void text(const sal_uInt8
* data
, size_t len
);
108 virtual void utext(const sal_uInt8
* data
, size_t len
);
109 virtual void props(writerfilter::Reference
<Properties
>::Pointer_t ref
);
110 virtual void table(Id name
,
111 writerfilter::Reference
<Table
>::Pointer_t ref
);
112 virtual void substream(Id name
,
113 ::writerfilter::Reference
<Stream
>::Pointer_t ref
);
114 virtual void info(const string
& info
);
116 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextContent
> GetGraphicObject();
117 bool IsGraphic() const;
119 typedef boost::shared_ptr
< GraphicImport
> GraphicImportPtr
;