Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : */
9 :
10 : /* "This product is not manufactured, approved, or supported by
11 : * Corel Corporation or Corel Corporation Limited."
12 : */
13 : #ifndef _WPGIMPORTFILTER_HXX
14 : #define _WPGIMPORTFILTER_HXX
15 :
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>
24 :
25 : #include <stdio.h>
26 :
27 : /* This component will be instantiated for both import or export. Whether it calls
28 : * setSourceDocument or setTargetDocument determines which Impl function the filter
29 : * member calls */
30 : class WPGImportFilter : public cppu::WeakImplHelper5
31 : <
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
37 : >
38 : {
39 : protected:
40 : // oo.org declares
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;
45 :
46 : public:
47 0 : WPGImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
48 0 : : mxContext( rxContext ) {}
49 0 : virtual ~WPGImportFilter() {}
50 :
51 : // XFilter
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, std::exception) SAL_OVERRIDE;
54 : virtual void SAL_CALL cancel( )
55 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
56 :
57 : // XImporter
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, std::exception) SAL_OVERRIDE;
60 :
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, std::exception ) SAL_OVERRIDE;
64 :
65 : // XInitialization
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, std::exception) SAL_OVERRIDE;
68 :
69 : // XServiceInfo
70 : virtual OUString SAL_CALL getImplementationName( )
71 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
73 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
75 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 :
77 : };
78 :
79 : OUString WPGImportFilter_getImplementationName()
80 : throw ( ::com::sun::star::uno::RuntimeException );
81 :
82 : ::com::sun::star::uno::Sequence< OUString > SAL_CALL WPGImportFilter_getSupportedServiceNames( )
83 : throw ( ::com::sun::star::uno::RuntimeException );
84 :
85 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
86 : SAL_CALL WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
87 : throw ( ::com::sun::star::uno::Exception );
88 :
89 : #endif
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|