merged tag ooo/DEV300_m102
[LibreOffice.git] / filter / source / xmlfilterdetect / filterdetect.hxx
blob965e2ceaa1d76fc09b17c0d42a689121b30bc797
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _FILTERDETECT_HXX
29 #define _FILTERDETECT_HXX
32 #include <com/sun/star/document/XFilter.hpp>
33 #include <com/sun/star/document/XExporter.hpp>
34 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
35 #include <com/sun/star/document/XImporter.hpp>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <cppuhelper/implbase5.hxx>
40 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
41 #include <cppuhelper/implbase3.hxx>
42 #endif
46 enum FilterType
48 FILTER_IMPORT,
49 FILTER_EXPORT
52 /* This component will be instantiated for both import or export. Whether it calls
53 * setSourceDocument or setTargetDocument determines which Impl function the filter
54 * member calls */
56 class FilterDetect : public cppu::WeakImplHelper3
61 com::sun::star::document::XExtendedFilterDetection,
63 com::sun::star::lang::XInitialization,
65 com::sun::star::lang::XServiceInfo
71 protected:
73 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
75 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
77 ::rtl::OUString msFilterName;
79 ::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
81 ::rtl::OUString msTemplateName;
85 sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
87 throw (::com::sun::star::uno::RuntimeException);
89 sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
91 throw (::com::sun::star::uno::RuntimeException);
97 public:
99 FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
101 : mxMSF( rxMSF ) {}
103 virtual ~FilterDetect() {}
110 //XExtendedFilterDetection
111 virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
112 throw( com::sun::star::uno::RuntimeException );
115 // XInitialization
117 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
119 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
123 // XServiceInfo
125 virtual ::rtl::OUString SAL_CALL getImplementationName( )
127 throw (::com::sun::star::uno::RuntimeException);
129 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
131 throw (::com::sun::star::uno::RuntimeException);
133 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
135 throw (::com::sun::star::uno::RuntimeException);
141 ::rtl::OUString FilterDetect_getImplementationName()
143 throw ( ::com::sun::star::uno::RuntimeException );
147 sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
149 throw ( ::com::sun::star::uno::RuntimeException );
153 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
155 throw ( ::com::sun::star::uno::RuntimeException );
159 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
161 SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
163 throw ( ::com::sun::star::uno::Exception );
167 #endif