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 _XMLSIGNATURETEMPLATEIMPL_HXX_
25 #define _XMLSIGNATURETEMPLATEIMPL_HXX_
26 
27 #include <sal/config.h>
28 #include <rtl/ustring.hxx>
29 #include <cppuhelper/factory.hxx>
30 #include <cppuhelper/implbase3.hxx>
31 #include <com/sun/star/uno/Exception.hpp>
32 
33 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
34 #include <com/sun/star/uno/Reference.hxx>
35 #endif
36 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
37 
38 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #endif
41 #include <com/sun/star/lang/XInitialization.hpp>
42 #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp>
43 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
44 
45 #ifndef __SGI_STL_VECTOR
46 #include <vector>
47 #endif
48 
49 class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3<
50 	::com::sun::star::xml::crypto::XXMLSignatureTemplate ,
51 	::com::sun::star::lang::XInitialization ,
52 	::com::sun::star::lang::XServiceInfo >
53 {
54 	private :
55 		::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ;
56 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
57 		std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > targets;
58 		::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding > m_xUriBinding;
59 		::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
60 
61 	public :
62 		XMLSignatureTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
63 		virtual ~XMLSignatureTemplateImpl() ;
64 
65 		//Methods from XXMLSignatureTemplate
66 		virtual void SAL_CALL setTemplate(
67 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement
68 			) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException);
69 
70 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate(
71 		) throw (com::sun::star::uno::RuntimeException);
72 
73 		virtual void SAL_CALL setTarget(
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);
76 
77 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL getTargets(
78 		) throw (com::sun::star::uno::RuntimeException);
79 
80 		virtual void SAL_CALL setBinding(
81 			const ::com::sun::star::uno::Reference<
82 				::com::sun::star::xml::crypto::XUriBinding >& aUriBinding )
83 			throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
84 		virtual ::com::sun::star::uno::Reference<
85 			::com::sun::star::xml::crypto::XUriBinding >
86 			SAL_CALL getBinding(  )
87 			throw (::com::sun::star::uno::RuntimeException);
88 
89 		virtual void SAL_CALL setStatus(
90 			::com::sun::star::xml::crypto::SecurityOperationStatus status )
91 			throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
92 		virtual ::com::sun::star::xml::crypto::SecurityOperationStatus
93 			SAL_CALL getStatus(  )
94 			throw (::com::sun::star::uno::RuntimeException);
95 
96 		//Methods from XInitialization
97 		virtual void SAL_CALL initialize(
98 			const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments
99 		) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
100 
101 		//Methods from XServiceInfo
102 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
103 
104 		virtual sal_Bool SAL_CALL supportsService(
105 			const ::rtl::OUString& ServiceName
106 		) throw( ::com::sun::star::uno::RuntimeException ) ;
107 
108 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ;
109 
110 		//Helper for XServiceInfo
111 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ;
112 
113 		static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
114 
115 		//Helper for registry
116 		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 ) ;
117 
118 		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 ) ;
119 } ;
120 
121 #endif	// _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_
122