Branch data 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 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef _FILTERDETECT_HXX
21 : : #define _FILTERDETECT_HXX
22 : :
23 : :
24 : : #include <com/sun/star/document/XFilter.hpp>
25 : : #include <com/sun/star/document/XExporter.hpp>
26 : : #include <com/sun/star/document/XExtendedFilterDetection.hpp>
27 : : #include <com/sun/star/document/XImporter.hpp>
28 : : #include <com/sun/star/lang/XInitialization.hpp>
29 : : #include <com/sun/star/lang/XServiceInfo.hpp>
30 : : #include <cppuhelper/implbase5.hxx>
31 : :
32 : : #include <cppuhelper/implbase3.hxx>
33 : :
34 : :
35 : :
36 : : enum FilterType
37 : : {
38 : : FILTER_IMPORT,
39 : : FILTER_EXPORT
40 : : };
41 : :
42 : : /* This component will be instantiated for both import or export. Whether it calls
43 : : * setSourceDocument or setTargetDocument determines which Impl function the filter
44 : : * member calls */
45 : :
46 : : class FilterDetect : public cppu::WeakImplHelper3
47 : :
48 : : <
49 : :
50 : :
51 : : com::sun::star::document::XExtendedFilterDetection,
52 : :
53 : : com::sun::star::lang::XInitialization,
54 : :
55 : : com::sun::star::lang::XServiceInfo
56 : :
57 : : >
58 : :
59 : : {
60 : :
61 : : protected:
62 : :
63 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
64 : :
65 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
66 : :
67 : : ::rtl::OUString msFilterName;
68 : :
69 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
70 : :
71 : : ::rtl::OUString msTemplateName;
72 : :
73 : :
74 : :
75 : : sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
76 : :
77 : : throw (::com::sun::star::uno::RuntimeException);
78 : :
79 : : sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
80 : :
81 : : throw (::com::sun::star::uno::RuntimeException);
82 : :
83 : :
84 : :
85 : :
86 : :
87 : : public:
88 : :
89 : 16 : FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
90 : :
91 [ + - ]: 16 : : mxMSF( rxMSF ) {}
92 : :
93 [ + - ][ - + ]: 32 : virtual ~FilterDetect() {}
94 : :
95 : :
96 : :
97 : :
98 : :
99 : :
100 : : //XExtendedFilterDetection
101 : : virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
102 : : throw( com::sun::star::uno::RuntimeException );
103 : :
104 : :
105 : : // XInitialization
106 : :
107 : : virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
108 : :
109 : : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
110 : :
111 : :
112 : :
113 : : // XServiceInfo
114 : :
115 : : virtual ::rtl::OUString SAL_CALL getImplementationName( )
116 : :
117 : : throw (::com::sun::star::uno::RuntimeException);
118 : :
119 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
120 : :
121 : : throw (::com::sun::star::uno::RuntimeException);
122 : :
123 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
124 : :
125 : : throw (::com::sun::star::uno::RuntimeException);
126 : :
127 : : };
128 : :
129 : :
130 : :
131 : : ::rtl::OUString FilterDetect_getImplementationName()
132 : :
133 : : throw ( ::com::sun::star::uno::RuntimeException );
134 : :
135 : :
136 : :
137 : : sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
138 : :
139 : : throw ( ::com::sun::star::uno::RuntimeException );
140 : :
141 : :
142 : :
143 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
144 : :
145 : : throw ( ::com::sun::star::uno::RuntimeException );
146 : :
147 : :
148 : :
149 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
150 : :
151 : : SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
152 : :
153 : : throw ( ::com::sun::star::uno::Exception );
154 : :
155 : :
156 : :
157 : : #endif
158 : :
159 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|