update dev300-m58
[ooovba.git] / filter / source / xmlfilterdetect / filterdetect.hxx
blob34d5ddcdb25679c00c2aa64c1299d4f5aaec1f2b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filterdetect.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _FILTERDETECT_HXX
32 #define _FILTERDETECT_HXX
35 #include <com/sun/star/document/XFilter.hpp>
36 #include <com/sun/star/document/XExporter.hpp>
37 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
38 #include <com/sun/star/document/XImporter.hpp>
39 #include <com/sun/star/lang/XInitialization.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <cppuhelper/implbase5.hxx>
43 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
44 #include <cppuhelper/implbase3.hxx>
45 #endif
49 enum FilterType
51 FILTER_IMPORT,
52 FILTER_EXPORT
55 /* This component will be instantiated for both import or export. Whether it calls
56 * setSourceDocument or setTargetDocument determines which Impl function the filter
57 * member calls */
59 class FilterDetect : public cppu::WeakImplHelper3
64 com::sun::star::document::XExtendedFilterDetection,
66 com::sun::star::lang::XInitialization,
68 com::sun::star::lang::XServiceInfo
74 protected:
76 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
78 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
80 ::rtl::OUString msFilterName;
82 ::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
84 ::rtl::OUString msTemplateName;
88 sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
90 throw (::com::sun::star::uno::RuntimeException);
92 sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
94 throw (::com::sun::star::uno::RuntimeException);
100 public:
102 FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
104 : mxMSF( rxMSF ) {}
106 virtual ~FilterDetect() {}
113 //XExtendedFilterDetection
114 virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
115 throw( com::sun::star::uno::RuntimeException );
118 // XInitialization
120 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
122 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
126 // XServiceInfo
128 virtual ::rtl::OUString SAL_CALL getImplementationName( )
130 throw (::com::sun::star::uno::RuntimeException);
132 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
134 throw (::com::sun::star::uno::RuntimeException);
136 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
138 throw (::com::sun::star::uno::RuntimeException);
144 ::rtl::OUString FilterDetect_getImplementationName()
146 throw ( ::com::sun::star::uno::RuntimeException );
150 sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
152 throw ( ::com::sun::star::uno::RuntimeException );
156 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
158 throw ( ::com::sun::star::uno::RuntimeException );
162 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
164 SAL_CALL FilterDetect_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
166 throw ( ::com::sun::star::uno::Exception );
170 #endif