1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 /* "This product is not manufactured, approved, or supported by
9 * Corel Corporation or Corel Corporation Limited."
11 #ifndef _CMXIMPORTFILTER_HXX
12 #define _CMXIMPORTFILTER_HXX
14 #include <com/sun/star/document/XFilter.hpp>
15 #include <com/sun/star/document/XImporter.hpp>
16 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
17 #include <com/sun/star/lang/XInitialization.hpp>
18 #include <com/sun/star/lang/XServiceInfo.hpp>
19 #include <com/sun/star/uno/XComponentContext.hpp>
20 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
21 #include <cppuhelper/implbase5.hxx>
25 /* This component will be instantiated for both import or export. Whether it calls
26 * setSourceDocument or setTargetDocument determines which Impl function the filter
28 class CMXImportFilter
: public cppu::WeakImplHelper5
30 com::sun::star::document::XFilter
,
31 com::sun::star::document::XImporter
,
32 com::sun::star::document::XExtendedFilterDetection
,
33 com::sun::star::lang::XInitialization
,
34 com::sun::star::lang::XServiceInfo
39 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> mxContext
;
40 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> mxDoc
;
41 OUString msFilterName
;
42 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> mxHandler
;
45 CMXImportFilter( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> &rxContext
)
46 : mxContext( rxContext
) {}
47 virtual ~CMXImportFilter() {}
50 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
)
51 throw (::com::sun::star::uno::RuntimeException
);
52 virtual void SAL_CALL
cancel( )
53 throw (::com::sun::star::uno::RuntimeException
);
56 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
)
57 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
59 //XExtendedFilterDetection
60 virtual OUString SAL_CALL
detect( com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& Descriptor
)
61 throw( com::sun::star::uno::RuntimeException
);
64 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
65 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
68 virtual OUString SAL_CALL
getImplementationName( )
69 throw (::com::sun::star::uno::RuntimeException
);
70 virtual sal_Bool SAL_CALL
supportsService( const OUString
&ServiceName
)
71 throw (::com::sun::star::uno::RuntimeException
);
72 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
73 throw (::com::sun::star::uno::RuntimeException
);
77 OUString
CMXImportFilter_getImplementationName()
78 throw ( ::com::sun::star::uno::RuntimeException
);
80 sal_Bool SAL_CALL
CMXImportFilter_supportsService( const OUString
&ServiceName
)
81 throw ( ::com::sun::star::uno::RuntimeException
);
83 ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
CMXImportFilter_getSupportedServiceNames( )
84 throw ( ::com::sun::star::uno::RuntimeException
);
86 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
87 SAL_CALL
CMXImportFilter_createInstance( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> & rContext
)
88 throw ( ::com::sun::star::uno::Exception
);
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */