merge the formfield patch from ooo-build
[ooovba.git] / xmlsecurity / source / framework / decryptorimpl.hxx
blob768f2f9eb3bdeb855bdcbe6c5f94cee88c5afc3f
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: decryptorimpl.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 _DECRYPTORIMPL_HXX
32 #define _DECRYPTORIMPL_HXX
34 #include <com/sun/star/xml/crypto/sax/XDecryptionResultBroadcaster.hpp>
35 #include <com/sun/star/xml/crypto/sax/XDecryptionResultListener.hpp>
36 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
37 #include <com/sun/star/lang/XInitialization.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <cppuhelper/implbase3.hxx>
41 #include "encryptionengine.hxx"
43 class DecryptorImpl : public cppu::ImplInheritanceHelper3
45 EncryptionEngine,
46 com::sun::star::xml::crypto::sax::XDecryptionResultBroadcaster,
47 com::sun::star::lang::XInitialization,
48 com::sun::star::lang::XServiceInfo
50 /****** DecryptorImpl.hxx/CLASS DecryptorImpl *********************************
52 * NAME
53 * DecryptorImpl -- decrypts an encryption
55 * FUNCTION
56 * Collects all resources for decrypting an encryption, then decrypts the
57 * encryption by invoking a xmlsec-based encryption bridge component.
59 * HISTORY
60 * 05.01.2004 - Interface supported: XDecryptionResultBroadcaster,
61 * XInitialization, XServiceInfo
63 * AUTHOR
64 * Michael Mi
65 * Email: michael.mi@sun.com
66 ******************************************************************************/
68 private:
70 * the Id of the encryption, which is used for the result listener to
71 * identify the encryption.
73 sal_Int32 m_nEncryptionId;
76 * the decryption result,
77 * remembers whether the decryption succeeds.
79 bool m_bDecryptionSucceed;
81 com::sun::star::uno::Reference<
82 com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
84 virtual void notifyResultListener() const
85 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
86 virtual bool checkReady() const;
87 virtual void startEngine( const com::sun::star::uno::Reference<
88 com::sun::star::xml::crypto::XXMLEncryptionTemplate >&
89 xEncryptionTemplate)
90 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
92 public:
93 explicit DecryptorImpl( const com::sun::star::uno::Reference<
94 com::sun::star::lang::XMultiServiceFactory >& rxMSF);
95 virtual ~DecryptorImpl();
97 /* XDecryptionResultBroadcaster */
98 virtual void SAL_CALL addDecryptionResultListener(
99 const com::sun::star::uno::Reference<
100 com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
101 listener )
102 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL removeDecryptionResultListener(
104 const com::sun::star::uno::Reference<
105 com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
106 listener )
107 throw (com::sun::star::uno::RuntimeException);
109 /* XInitialization */
110 virtual void SAL_CALL initialize(
111 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
112 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
114 /* XServiceInfo */
115 virtual rtl::OUString SAL_CALL getImplementationName( )
116 throw (com::sun::star::uno::RuntimeException);
117 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
118 throw (com::sun::star::uno::RuntimeException);
119 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
120 throw (com::sun::star::uno::RuntimeException);
123 rtl::OUString DecryptorImpl_getImplementationName()
124 throw ( com::sun::star::uno::RuntimeException );
126 sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
127 throw ( com::sun::star::uno::RuntimeException );
129 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
130 throw ( com::sun::star::uno::RuntimeException );
132 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
133 SAL_CALL DecryptorImpl_createInstance(
134 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&
135 rSMgr)
136 throw ( com::sun::star::uno::Exception );
138 #endif