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 /* "This product is not manufactured, approved, or supported by
11 * Corel Corporation or Corel Corporation Limited."
13 #ifndef _WPGIMPORTFILTER_HXX
14 #define _WPGIMPORTFILTER_HXX
16 #include <com/sun/star/document/XFilter.hpp>
17 #include <com/sun/star/document/XImporter.hpp>
18 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
19 #include <com/sun/star/lang/XInitialization.hpp>
20 #include <com/sun/star/lang/XServiceInfo.hpp>
21 #include <com/sun/star/uno/XComponentContext.hpp>
22 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
23 #include <cppuhelper/implbase5.hxx>
27 /* This component will be instantiated for both import or export. Whether it calls
28 * setSourceDocument or setTargetDocument determines which Impl function the filter
30 class WPGImportFilter
: public cppu::WeakImplHelper5
32 com::sun::star::document::XFilter
,
33 com::sun::star::document::XImporter
,
34 com::sun::star::document::XExtendedFilterDetection
,
35 com::sun::star::lang::XInitialization
,
36 com::sun::star::lang::XServiceInfo
41 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> mxContext
;
42 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> mxDoc
;
43 OUString msFilterName
;
44 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> mxHandler
;
47 WPGImportFilter( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> &rxContext
)
48 : mxContext( rxContext
) {}
49 virtual ~WPGImportFilter() {}
52 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
)
53 throw (::com::sun::star::uno::RuntimeException
);
54 virtual void SAL_CALL
cancel( )
55 throw (::com::sun::star::uno::RuntimeException
);
58 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
)
59 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
61 //XExtendedFilterDetection
62 virtual OUString SAL_CALL
detect( com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& Descriptor
)
63 throw( com::sun::star::uno::RuntimeException
);
66 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
67 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
70 virtual OUString SAL_CALL
getImplementationName( )
71 throw (::com::sun::star::uno::RuntimeException
);
72 virtual sal_Bool SAL_CALL
supportsService( const OUString
&ServiceName
)
73 throw (::com::sun::star::uno::RuntimeException
);
74 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
75 throw (::com::sun::star::uno::RuntimeException
);
79 OUString
WPGImportFilter_getImplementationName()
80 throw ( ::com::sun::star::uno::RuntimeException
);
82 sal_Bool SAL_CALL
WPGImportFilter_supportsService( const OUString
&ServiceName
)
83 throw ( ::com::sun::star::uno::RuntimeException
);
85 ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
WPGImportFilter_getSupportedServiceNames( )
86 throw ( ::com::sun::star::uno::RuntimeException
);
88 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
89 SAL_CALL
WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> & rContext
)
90 throw ( ::com::sun::star::uno::Exception
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */