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 _XMLELEMENTWRAPPER_XMLSECIMPL_HXX
25 #define _XMLELEMENTWRAPPER_XMLSECIMPL_HXX
26 
27 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
28 #include <com/sun/star/lang/XUnoTunnel.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <cppuhelper/implbase3.hxx>
32 
33 #include <libxml/tree.h>
34 
35 class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3
36 <
37 	com::sun::star::xml::wrapper::XXMLElementWrapper,
38 	com::sun::star::lang::XUnoTunnel,
39 	com::sun::star::lang::XServiceInfo
40 >
41 /****** XMLElementWrapper_XmlSecImpl.hxx/CLASS XMLElementWrapper_XmlSecImpl ***
42  *
43  *   NAME
44  *	XMLElementWrapper_XmlSecImpl -- Class to wrap a libxml2 node
45  *
46  *   FUNCTION
47  *	Used as a wrapper class to transfer a libxml2 node structure
48  *	between different UNO components.
49  *
50  *   HISTORY
51  *	05.01.2004 -	Interface supported: XXMLElementWrapper, XUnoTunnel
52  *			XServiceInfo
53  *
54  *   AUTHOR
55  *	Michael Mi
56  *	Email: michael.mi@sun.com
57  ******************************************************************************/
58 {
59 private:
60 	/* the libxml2 node wrapped by this object */
61 	xmlNodePtr m_pElement;
62 
63 public:
64 	explicit XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode);
~XMLElementWrapper_XmlSecImpl()65 	virtual ~XMLElementWrapper_XmlSecImpl() {};
66 
67 	/* XXMLElementWrapper */
68 
69 	/* com::sun::star::lang::XUnoTunnel */
70 	virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
71 		throw (com::sun::star::uno::RuntimeException);
72 	static com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void )
73 		throw(com::sun::star::uno::RuntimeException);
74 
75 	/* com::sun::star::lang::XServiceInfo */
76 	virtual rtl::OUString SAL_CALL getImplementationName(  )
77 		throw (com::sun::star::uno::RuntimeException);
78 	virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
79 		throw (com::sun::star::uno::RuntimeException);
80 	virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(  )
81 		throw (com::sun::star::uno::RuntimeException);
82 
83 public:
84 	xmlNodePtr getNativeElement( ) const;
85 	void setNativeElement(const xmlNodePtr pNode);
86 };
87 
88 rtl::OUString XMLElementWrapper_XmlSecImpl_getImplementationName()
89 	throw ( com::sun::star::uno::RuntimeException );
90 
91 sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName )
92 	throw ( com::sun::star::uno::RuntimeException );
93 
94 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames(  )
95 	throw ( com::sun::star::uno::RuntimeException );
96 
97 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
98 SAL_CALL XMLElementWrapper_XmlSecImpl_createInstance(
99 	const com::sun::star::uno::Reference<
100 		com::sun::star::lang::XMultiServiceFactory > & rSMgr)
101 	throw ( com::sun::star::uno::Exception );
102 
103 #endif
104 
105