Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License or as specified alternatively below. You may obtain a copy of
8 : * the License at http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Initial Developer of the Original Code is
16 : * Fong Lin <pflin@novell.com>
17 : * Portions created by the Initial Developer are Copyright (C) 2010 the
18 : * Initial Developer. All Rights Reserved.
19 : *
20 : * Contributor(s):
21 : * Fong Lin <pflin@novell.com>
22 : * Noel Power <noel.power@novell.com>
23 : *
24 : * For minor contributions see the git repository.
25 : *
26 : * Alternatively, the contents of this file may be used under the terms of
27 : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
28 : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
29 : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
30 : * instead of those above.
31 : */
32 : #ifndef _LOTUSWORDPROIMPORTFILTER_HXX
33 : #define _LOTUSWORDPROIMPORTFILTER_HXX
34 :
35 : #include <com/sun/star/document/XFilter.hpp>
36 : #include <com/sun/star/document/XImporter.hpp>
37 : #include <com/sun/star/document/XExtendedFilterDetection.hpp>
38 : #include <com/sun/star/lang/XInitialization.hpp>
39 : #include <com/sun/star/lang/XServiceInfo.hpp>
40 : #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
41 : #include <cppuhelper/implbase5.hxx>
42 : #include <rtl/ustrbuf.hxx>
43 :
44 : enum FilterType
45 : {
46 : FILTER_IMPORT,
47 : FILTER_EXPORT
48 : };
49 : /* This component will be instantiated for both import or export. Whether it calls
50 : * setSourceDocument or setTargetDocument determines which Impl function the filter
51 : * member calls */
52 : class LotusWordProImportFilter : public cppu::WeakImplHelper5
53 : <
54 : com::sun::star::document::XFilter,
55 : com::sun::star::document::XImporter,
56 : com::sun::star::document::XExtendedFilterDetection,
57 : com::sun::star::lang::XInitialization,
58 : com::sun::star::lang::XServiceInfo
59 : >
60 : {
61 : private:
62 :
63 : protected:
64 : // oo.org declares
65 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
66 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
67 : ::rtl::OUString msFilterName;
68 : ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
69 :
70 : FilterType meType;
71 :
72 : sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
73 : throw (::com::sun::star::uno::RuntimeException);
74 :
75 : public:
76 1 : LotusWordProImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
77 1 : : mxMSF( rxMSF ) {}
78 2 : virtual ~LotusWordProImportFilter() {}
79 :
80 : // XFilter
81 : virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
82 : throw (::com::sun::star::uno::RuntimeException);
83 : virtual void SAL_CALL cancel( )
84 : throw (::com::sun::star::uno::RuntimeException);
85 :
86 : // XImporter
87 : virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
88 : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
89 :
90 : //XExtendedFilterDetection
91 : virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
92 : throw( com::sun::star::uno::RuntimeException );
93 :
94 : // XInitialization
95 : virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
96 : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
97 :
98 : // XServiceInfo
99 : virtual ::rtl::OUString SAL_CALL getImplementationName( )
100 : throw (::com::sun::star::uno::RuntimeException);
101 : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
102 : throw (::com::sun::star::uno::RuntimeException);
103 : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
104 : throw (::com::sun::star::uno::RuntimeException);
105 :
106 : };
107 :
108 : ::rtl::OUString LotusWordProImportFilter_getImplementationName()
109 : throw ( ::com::sun::star::uno::RuntimeException );
110 :
111 : sal_Bool SAL_CALL LotusWordProImportFilter_supportsService( const ::rtl::OUString& ServiceName )
112 : throw ( ::com::sun::star::uno::RuntimeException );
113 :
114 : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames( )
115 : throw ( ::com::sun::star::uno::RuntimeException );
116 :
117 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
118 : SAL_CALL LotusWordProImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
119 : throw ( ::com::sun::star::uno::Exception );
120 :
121 : #endif
122 :
123 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|