Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
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/.
6 : : */
7 : :
8 : : #ifndef _MSPUBIMPORTFILTER_HXX
9 : : #define _MSPUBIMPORTFILTER_HXX
10 : :
11 : : #include <com/sun/star/document/XFilter.hpp>
12 : : #include <com/sun/star/document/XImporter.hpp>
13 : : #include <com/sun/star/document/XExtendedFilterDetection.hpp>
14 : : #include <com/sun/star/lang/XInitialization.hpp>
15 : : #include <com/sun/star/lang/XServiceInfo.hpp>
16 : : #include <com/sun/star/uno/XComponentContext.hpp>
17 : : #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
18 : : #include <cppuhelper/implbase5.hxx>
19 : :
20 : : #include <stdio.h>
21 : :
22 : : /* This component will be instantiated for both import or export. Whether it calls
23 : : * setSourceDocument or setTargetDocument determines which Impl function the filter
24 : : * member calls */
25 : : class MSPUBImportFilter : public cppu::WeakImplHelper5
26 : : <
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
32 : : >
33 : : {
34 : : protected:
35 : : // oo.org declares
36 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
37 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
38 : : ::rtl::OUString msFilterName;
39 : : ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
40 : :
41 : : public:
42 : 10 : MSPUBImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
43 : 10 : : mxContext( rxContext ) {}
44 [ - + ]: 20 : virtual ~MSPUBImportFilter() {}
45 : :
46 : : // XFilter
47 : : virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
48 : : throw (::com::sun::star::uno::RuntimeException);
49 : : virtual void SAL_CALL cancel( )
50 : : throw (::com::sun::star::uno::RuntimeException);
51 : :
52 : : // XImporter
53 : : virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
54 : : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
55 : :
56 : : //XExtendedFilterDetection
57 : : virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
58 : : throw( com::sun::star::uno::RuntimeException );
59 : :
60 : : // XInitialization
61 : : virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
62 : : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
63 : :
64 : : // XServiceInfo
65 : : virtual ::rtl::OUString SAL_CALL getImplementationName( )
66 : : throw (::com::sun::star::uno::RuntimeException);
67 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString &ServiceName )
68 : : throw (::com::sun::star::uno::RuntimeException);
69 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
70 : : throw (::com::sun::star::uno::RuntimeException);
71 : :
72 : : };
73 : :
74 : : ::rtl::OUString MSPUBImportFilter_getImplementationName()
75 : : throw ( ::com::sun::star::uno::RuntimeException );
76 : :
77 : : sal_Bool SAL_CALL MSPUBImportFilter_supportsService( const ::rtl::OUString &ServiceName )
78 : : throw ( ::com::sun::star::uno::RuntimeException );
79 : :
80 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL MSPUBImportFilter_getSupportedServiceNames( )
81 : : throw ( ::com::sun::star::uno::RuntimeException );
82 : :
83 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
84 : : SAL_CALL MSPUBImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
85 : : throw ( ::com::sun::star::uno::Exception );
86 : :
87 : : #endif
88 : :
89 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|