1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef _XMLOFF_OOO2OASIS_HXX
29 #define _XMLOFF_OOO2OASIS_HXX
30 
31 #include <com/sun/star/document/XImporter.hpp>
32 #include <com/sun/star/document/XFilter.hpp>
33 #include "ActionMapTypesOOo.hxx"
34 #ifndef _XMLOFF_TRANSFORMERBASE_HXX_
35 #include "TransformerBase.hxx"
36 #endif
37 
38 class XMLTransformerOOoEventMap_Impl;
39 
40 class OOo2OasisTransformer :
41 		public XMLTransformerBase,
42 		public ::com::sun::star::document::XImporter,
43         public ::com::sun::star::document::XFilter
44 {
45 	::rtl::OUString m_aImplName;
46 	::rtl::OUString m_aSubServiceName;
47 
48 	XMLTransformerActions		*m_aActions[MAX_OOO_ACTIONS];
49 	XMLTransformerOOoEventMap_Impl *m_pEventMap;
50 protected:
51 
52 	virtual XMLTransformerContext *CreateUserDefinedContext(
53 									  const TransformerAction_Impl& rAction,
54 									  const ::rtl::OUString& rQName,
55 		   							  sal_Bool bPersistent=sal_False );
56 
57 	virtual XMLTransformerActions *GetUserDefinedActions( sal_uInt16 n );
58 
59 public:
60 	OOo2OasisTransformer( const sal_Char *pImplName=0,
61 						  const sal_Char *pSubServiceName=0 ) throw();
62 	virtual ~OOo2OasisTransformer() throw();
63 
64 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
65 
66 	// XInterface
67 
68     // (XInterface methods need to be implemented to disambigouate
69     // between those inherited through XMLTransformerBase and
70     // the new interfaces).
71 
72     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
73         const ::com::sun::star::uno::Type& aType )
74         throw (::com::sun::star::uno::RuntimeException);
75 
76     virtual void SAL_CALL acquire(  ) throw ()
77         { XMLTransformerBase::acquire(); };
78 
79     virtual void SAL_CALL release(  ) throw ()
80         { XMLTransformerBase::release(); };
81 
82 	// XInitialization
83     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
84 
85 
86 	// XServiceInfo
87     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
88     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
89     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
90 
91 	// XTypeProvider
92 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
93 
94 	// XUnoTunnel
95     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
96 
97 	// XImporter
98     virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
99 
100     // XFilter
101     virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException);
102     virtual void SAL_CALL cancel(  ) throw (::com::sun::star::uno::RuntimeException);
103 
104     void SAL_CALL Initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
105 
106 	// ::com::sun::star::xml::sax::XDocumentHandler
107 	virtual void SAL_CALL startDocument(void)
108 		throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
109 
110 	virtual ::rtl::OUString GetEventName( const ::rtl::OUString& rName,
111 		  								  sal_Bool bForm = sal_False );
112 };
113 
114 #endif	//  _XMLOFF_TRANSFORMER_BASE_HXX
115