1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #ifndef _MWAWIMPORTFILTER_HXX
11 #define _MWAWIMPORTFILTER_HXX
13 #include <com/sun/star/document/XFilter.hpp>
14 #include <com/sun/star/document/XImporter.hpp>
15 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
16 #include <com/sun/star/lang/XInitialization.hpp>
17 #include <com/sun/star/lang/XServiceInfo.hpp>
18 #include <com/sun/star/uno/XComponentContext.hpp>
19 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
20 #include <cppuhelper/implbase5.hxx>
22 /* This component will be instantiated for both import or export. Whether it calls
23 * setSourceDocument or setTargetDocument determines which Impl function the filter
25 class MWAWImportFilter
: public cppu::WeakImplHelper5
27 com::sun::star::document::XFilter
,
28 com::sun::star::document::XImporter
,
29 com::sun::star::document::XExtendedFilterDetection
,
30 com::sun::star::lang::XInitialization
,
31 com::sun::star::lang::XServiceInfo
35 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> mxContext
;
36 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> mxDoc
;
37 OUString msFilterName
;
38 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> mxHandler
;
40 sal_Bool SAL_CALL
importImpl( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> &aDescriptor
)
41 throw (::com::sun::star::uno::RuntimeException
);
44 MWAWImportFilter( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> &rxContext
)
45 : mxContext( rxContext
) {}
46 virtual ~MWAWImportFilter() {}
49 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> &aDescriptor
)
50 throw (::com::sun::star::uno::RuntimeException
);
51 virtual void SAL_CALL
cancel( )
52 throw (::com::sun::star::uno::RuntimeException
);
55 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> &xDoc
)
56 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
58 //XExtendedFilterDetection
59 virtual OUString SAL_CALL
detect( com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> &Descriptor
)
60 throw( com::sun::star::uno::RuntimeException
);
63 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> &aArguments
)
64 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
67 virtual OUString SAL_CALL
getImplementationName( )
68 throw (::com::sun::star::uno::RuntimeException
);
69 virtual sal_Bool SAL_CALL
supportsService( const OUString
&ServiceName
)
70 throw (::com::sun::star::uno::RuntimeException
);
71 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
72 throw (::com::sun::star::uno::RuntimeException
);
76 OUString
MWAWImportFilter_getImplementationName()
77 throw ( ::com::sun::star::uno::RuntimeException
);
79 sal_Bool SAL_CALL
MWAWImportFilter_supportsService( const OUString
&ServiceName
)
80 throw ( ::com::sun::star::uno::RuntimeException
);
82 ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
MWAWImportFilter_getSupportedServiceNames( )
83 throw ( ::com::sun::star::uno::RuntimeException
);
85 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
86 SAL_CALL
MWAWImportFilter_createInstance( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> &rContext
)
87 throw ( ::com::sun::star::uno::Exception
);
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */