2 * Copyright (C) 2000 by Sun Microsystems, Inc.
3 * Copyright (C) 2002-2004 William Lachance (wlach@interlog.com)
4 * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com)
5 * Copyright (C) 2004 Fridrich Strba <fridrich.strba@bluewin.ch>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 * Contributor(s): Martin Gallwey (gallwey@sun.com)
26 /* "This product is not manufactured, approved, or supported by
27 * Corel Corporation or Corel Corporation Limited."
29 #ifndef _WPGIMPORTFILTER_HXX
30 #define _WPGIMPORTFILTER_HXX
32 #ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
33 #include <com/sun/star/document/XFilter.hpp>
35 #ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
36 #include <com/sun/star/document/XImporter.hpp>
38 #ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_
39 #include <com/sun/star/document/XExtendedFilterDetection.hpp>
41 #ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
42 #include <com/sun/star/lang/XInitialization.hpp>
44 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
45 #include <com/sun/star/lang/XServiceInfo.hpp>
47 #ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
48 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
50 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
51 #include <cppuhelper/implbase5.hxx>
61 /* This component will be instantiated for both import or export. Whether it calls
62 * setSourceDocument or setTargetDocument determines which Impl function the filter
64 class WPGImportFilter
: public cppu::WeakImplHelper5
66 com::sun::star::document::XFilter
,
67 com::sun::star::document::XImporter
,
68 com::sun::star::document::XExtendedFilterDetection
,
69 com::sun::star::lang::XInitialization
,
70 com::sun::star::lang::XServiceInfo
75 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> mxMSF
;
76 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> mxDoc
;
77 ::rtl::OUString msFilterName
;
78 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> mxHandler
;
83 WPGImportFilter( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> &rxMSF
)
85 virtual ~WPGImportFilter() {}
88 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
)
89 throw (::com::sun::star::uno::RuntimeException
);
90 virtual void SAL_CALL
cancel( )
91 throw (::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
)
95 throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
97 //XExtendedFilterDetection
98 virtual ::rtl::OUString SAL_CALL
detect( com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& Descriptor
)
99 throw( com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
103 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
106 virtual ::rtl::OUString SAL_CALL
getImplementationName( )
107 throw (::com::sun::star::uno::RuntimeException
);
108 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
109 throw (::com::sun::star::uno::RuntimeException
);
110 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
111 throw (::com::sun::star::uno::RuntimeException
);
115 ::rtl::OUString
WPGImportFilter_getImplementationName()
116 throw ( ::com::sun::star::uno::RuntimeException
);
118 sal_Bool SAL_CALL
WPGImportFilter_supportsService( const ::rtl::OUString
& ServiceName
)
119 throw ( ::com::sun::star::uno::RuntimeException
);
121 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
WPGImportFilter_getSupportedServiceNames( )
122 throw ( ::com::sun::star::uno::RuntimeException
);
124 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
125 SAL_CALL
WPGImportFilter_createInstance( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & rSMgr
)
126 throw ( ::com::sun::star::uno::Exception
);