bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / xmlfilterdetect / filterdetect.hxx
blob0672ff24c726b6136d00e078fe07a23ea2d5a0b2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _FILTERDETECT_HXX
21 #define _FILTERDETECT_HXX
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>
32 #include <cppuhelper/implbase3.hxx>
34 namespace com { namespace sun { namespace star { namespace uno {
35 class XComponentContext;
36 } } } }
38 enum FilterType
40 FILTER_IMPORT,
41 FILTER_EXPORT
44 /* This component will be instantiated for both import or export. Whether it calls
45 * setSourceDocument or setTargetDocument determines which Impl function the filter
46 * member calls */
48 class FilterDetect : public cppu::WeakImplHelper3
53 com::sun::star::document::XExtendedFilterDetection,
55 com::sun::star::lang::XInitialization,
57 com::sun::star::lang::XServiceInfo
63 protected:
65 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCtx;
67 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxDoc;
69 OUString msFilterName;
71 ::com::sun::star::uno::Sequence< OUString > msUserData;
73 OUString msTemplateName;
77 sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
79 throw (::com::sun::star::uno::RuntimeException);
81 sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
83 throw (::com::sun::star::uno::RuntimeException);
89 public:
91 FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxCtx)
93 : mxCtx( rxCtx ) {}
95 virtual ~FilterDetect() {}
102 //XExtendedFilterDetection
103 virtual OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
104 throw( com::sun::star::uno::RuntimeException );
107 // XInitialization
109 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
111 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
115 // XServiceInfo
117 virtual OUString SAL_CALL getImplementationName( )
119 throw (::com::sun::star::uno::RuntimeException);
121 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
123 throw (::com::sun::star::uno::RuntimeException);
125 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
127 throw (::com::sun::star::uno::RuntimeException);
131 OUString SAL_CALL FilterDetect_getImplementationName();
133 com::sun::star::uno::Sequence< OUString > SAL_CALL
134 FilterDetect_getSupportedServiceNames();
136 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
137 FilterDetect_createInstance(
138 com::sun::star::uno::Reference<
139 com::sun::star::uno::XComponentContext > const & context);
141 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */