1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLOFF_OOO2OASIS_HXX
25 #define _XMLOFF_OOO2OASIS_HXX
26 
27 #include <com/sun/star/document/XImporter.hpp>
28 #include <com/sun/star/document/XFilter.hpp>
29 #include "ActionMapTypesOOo.hxx"
30 #ifndef _XMLOFF_TRANSFORMERBASE_HXX_
31 #include "TransformerBase.hxx"
32 #endif
33 
34 class XMLTransformerOOoEventMap_Impl;
35 
36 class OOo2OasisTransformer :
37 		public XMLTransformerBase,
38 		public ::com::sun::star::document::XImporter,
39         public ::com::sun::star::document::XFilter
40 {
41 	::rtl::OUString m_aImplName;
42 	::rtl::OUString m_aSubServiceName;
43 
44 	XMLTransformerActions		*m_aActions[MAX_OOO_ACTIONS];
45 	XMLTransformerOOoEventMap_Impl *m_pEventMap;
46 protected:
47 
48 	virtual XMLTransformerContext *CreateUserDefinedContext(
49 									  const TransformerAction_Impl& rAction,
50 									  const ::rtl::OUString& rQName,
51 		   							  sal_Bool bPersistent=sal_False );
52 
53 	virtual XMLTransformerActions *GetUserDefinedActions( sal_uInt16 n );
54 
55 public:
56 	OOo2OasisTransformer( const sal_Char *pImplName=0,
57 						  const sal_Char *pSubServiceName=0 ) throw();
58 	virtual ~OOo2OasisTransformer() throw();
59 
60 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
61 
62 	// XInterface
63 
64     // (XInterface methods need to be implemented to disambigouate
65     // between those inherited through XMLTransformerBase and
66     // the new interfaces).
67 
68     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
69         const ::com::sun::star::uno::Type& aType )
70         throw (::com::sun::star::uno::RuntimeException);
71 
acquire()72     virtual void SAL_CALL acquire(  ) throw ()
73         { XMLTransformerBase::acquire(); };
74 
release()75     virtual void SAL_CALL release(  ) throw ()
76         { XMLTransformerBase::release(); };
77 
78 	// XInitialization
79     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);
80 
81 
82 	// XServiceInfo
83     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
84     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
85     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
86 
87 	// XTypeProvider
88 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
89 
90 	// XUnoTunnel
91     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
92 
93 	// XImporter
94     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);
95 
96     // XFilter
97     virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException);
98     virtual void SAL_CALL cancel(  ) throw (::com::sun::star::uno::RuntimeException);
99 
100     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);
101 
102 	// ::com::sun::star::xml::sax::XDocumentHandler
103 	virtual void SAL_CALL startDocument(void)
104 		throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
105 
106 	virtual ::rtl::OUString GetEventName( const ::rtl::OUString& rName,
107 		  								  sal_Bool bForm = sal_False );
108 };
109 
110 #endif	//  _XMLOFF_TRANSFORMER_BASE_HXX
111