Update ooo320-m1
[ooovba.git] / xmlsecurity / source / framework / xmlsignaturetemplateimpl.hxx
blob3e7c357c67890fc32323accf8feb8dc52aa6234d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlsignaturetemplateimpl.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLSIGNATURETEMPLATEIMPL_HXX_
32 #define _XMLSIGNATURETEMPLATEIMPL_HXX_
34 #include <sal/config.h>
35 #include <rtl/ustring.hxx>
36 #include <cppuhelper/factory.hxx>
37 #include <cppuhelper/implbase3.hxx>
38 #include <com/sun/star/uno/Exception.hpp>
40 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
41 #include <com/sun/star/uno/Reference.hxx>
42 #endif
43 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
45 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
46 #include <com/sun/star/lang/XServiceInfo.hpp>
47 #endif
48 #include <com/sun/star/lang/XInitialization.hpp>
49 #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp>
50 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
52 #ifndef __SGI_STL_VECTOR
53 #include <vector>
54 #endif
56 class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3<
57 ::com::sun::star::xml::crypto::XXMLSignatureTemplate ,
58 ::com::sun::star::lang::XInitialization ,
59 ::com::sun::star::lang::XServiceInfo >
61 private :
62 ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ;
63 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
64 std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > targets;
65 ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding > m_xUriBinding;
66 ::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
68 public :
69 XMLSignatureTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
70 virtual ~XMLSignatureTemplateImpl() ;
72 //Methods from XXMLSignatureTemplate
73 virtual void SAL_CALL setTemplate(
74 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement
75 ) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException);
77 virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate(
78 ) throw (com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL setTarget(
81 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement
82 ) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException);
84 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL getTargets(
85 ) throw (com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL setBinding(
88 const ::com::sun::star::uno::Reference<
89 ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding )
90 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
91 virtual ::com::sun::star::uno::Reference<
92 ::com::sun::star::xml::crypto::XUriBinding >
93 SAL_CALL getBinding( )
94 throw (::com::sun::star::uno::RuntimeException);
96 virtual void SAL_CALL setStatus(
97 ::com::sun::star::xml::crypto::SecurityOperationStatus status )
98 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
99 virtual ::com::sun::star::xml::crypto::SecurityOperationStatus
100 SAL_CALL getStatus( )
101 throw (::com::sun::star::uno::RuntimeException);
103 //Methods from XInitialization
104 virtual void SAL_CALL initialize(
105 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments
106 ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
108 //Methods from XServiceInfo
109 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
111 virtual sal_Bool SAL_CALL supportsService(
112 const ::rtl::OUString& ServiceName
113 ) throw( ::com::sun::star::uno::RuntimeException ) ;
115 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ;
117 //Helper for XServiceInfo
118 static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ;
120 static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
122 //Helper for registry
123 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ;
125 static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
128 #endif // _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_