1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "xmlelementwrapper_xmlsecimpl.hxx"
23 #include <cppuhelper/typeprovider.hxx>
25 namespace cssu
= com::sun::star::uno
;
27 #define SERVICE_NAME "com.sun.star.xml.wrapper.XMLElementWrapper"
28 #define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"
30 XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode
)
35 /* XXMLElementWrapper */
39 cssu::Sequence
< sal_Int8
> XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId( void )
40 throw (cssu::RuntimeException
)
42 static ::cppu::OImplementationId
* pId
= 0;
45 ::osl::MutexGuard
aGuard( ::osl::Mutex::getGlobalMutex() );
48 static ::cppu::OImplementationId aId
;
52 return pId
->getImplementationId();
55 sal_Int64 SAL_CALL
XMLElementWrapper_XmlSecImpl::getSomething( const cssu::Sequence
< sal_Int8
>& aIdentifier
)
56 throw (cssu::RuntimeException
)
58 if (aIdentifier
.getLength() == 16 &&
60 getUnoTunnelImplementationId().getConstArray(),
61 aIdentifier
.getConstArray(),
64 return reinterpret_cast < sal_Int64
> ( this );
73 OUString
XMLElementWrapper_XmlSecImpl_getImplementationName ()
74 throw (cssu::RuntimeException
)
76 return OUString ( IMPLEMENTATION_NAME
);
79 sal_Bool SAL_CALL
XMLElementWrapper_XmlSecImpl_supportsService( const OUString
& ServiceName
)
80 throw (cssu::RuntimeException
)
82 return ServiceName
== SERVICE_NAME
;
85 cssu::Sequence
< OUString
> SAL_CALL
XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
86 throw (cssu::RuntimeException
)
88 cssu::Sequence
< OUString
> aRet(1);
89 OUString
* pArray
= aRet
.getArray();
90 pArray
[0] = OUString ( SERVICE_NAME
);
95 cssu::Reference
< cssu::XInterface
> SAL_CALL
96 XMLElementWrapper_XmlSecImpl_createInstance(
97 const cssu::Reference
< cssu::XComponentContext
> &)
98 throw( cssu::Exception
)
100 return (cppu::OWeakObject
*) new XMLElementWrapper_XmlSecImpl(NULL
);
104 OUString SAL_CALL
XMLElementWrapper_XmlSecImpl::getImplementationName( )
105 throw (cssu::RuntimeException
)
107 return XMLElementWrapper_XmlSecImpl_getImplementationName();
109 sal_Bool SAL_CALL
XMLElementWrapper_XmlSecImpl::supportsService( const OUString
& rServiceName
)
110 throw (cssu::RuntimeException
)
112 return XMLElementWrapper_XmlSecImpl_supportsService( rServiceName
);
114 cssu::Sequence
< OUString
> SAL_CALL
XMLElementWrapper_XmlSecImpl::getSupportedServiceNames( )
115 throw (cssu::RuntimeException
)
117 return XMLElementWrapper_XmlSecImpl_getSupportedServiceNames();
120 xmlNodePtr
XMLElementWrapper_XmlSecImpl::getNativeElement( ) const
121 /****** XMLElementWrapper_XmlSecImpl/getNativeElement *************************
124 * getNativeElement -- Retrieves the libxml2 node wrapped by this object
127 * pNode = getNativeElement();
136 * pNode - the libxml2 node wrapped by this object
140 * Email: michael.mi@sun.com
141 ******************************************************************************/
146 void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode
)
147 /****** XMLElementWrapper_XmlSecImpl/setNativeElement *************************
150 * setNativeElement -- Configures the libxml2 node wrapped by this object
153 * setNativeElement( pNode );
159 * pNode - the new libxml2 node to be wrapped by this object
166 * Email: michael.mi@sun.com
167 ******************************************************************************/
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */