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
;
57 typedef ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> PropertyValues
;
61 namespace writerfilter
{
65 class GraphicImport_Impl
;
68 enum GraphicImportType
72 IMPORT_AS_DETECTED_INLINE
,
73 IMPORT_AS_DETECTED_ANCHOR
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
);
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();
99 virtual void attribute(Id Name
, Value
& val
);
100 virtual void sprm(Sprm
& sprm
);
103 virtual void entry(int pos
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
106 virtual void data(const sal_uInt8
* buf
, size_t len
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
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
;