Bump version to 5.0-14
[LibreOffice.git] / xmlsecurity / source / framework / encryptorimpl.hxx
blob94b84c5b2c3282f190d7998b3a73b162ac3fcb14
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_ENCRYPTORIMPL_HXX
21 #define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_ENCRYPTORIMPL_HXX
23 #include <com/sun/star/xml/crypto/sax/XEncryptionResultBroadcaster.hpp>
24 #include <com/sun/star/xml/crypto/sax/XEncryptionResultListener.hpp>
25 #include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp>
26 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
27 #include <com/sun/star/lang/XInitialization.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
30 #include <cppuhelper/implbase4.hxx>
32 #include "encryptionengine.hxx"
34 typedef cppu::ImplInheritanceHelper4
36 EncryptionEngine,
37 com::sun::star::xml::crypto::sax::XEncryptionResultBroadcaster,
38 com::sun::star::xml::crypto::sax::XReferenceCollector,
39 com::sun::star::lang::XInitialization,
40 com::sun::star::lang::XServiceInfo
41 > EncryptorImpl_Base;
43 class EncryptorImpl : public EncryptorImpl_Base
44 /****** EncryptorImpl.hxx/CLASS EncryptorImpl *********************************
46 * NAME
47 * EncryptorImpl -- generates an encryption
49 * FUNCTION
50 * Collects all resources for an encryption generation, then generates the
51 * encryption by invoking a xmlsec-based encryption bridge component.
53 * AUTHOR
54 * Michael Mi
55 * Email: michael.mi@sun.com
56 ******************************************************************************/
58 private:
60 * the Id of the element to be encrypted.
62 sal_Int32 m_nReferenceId;
64 com::sun::star::uno::Reference<
65 com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment;
67 virtual void notifyResultListener() const
68 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
69 virtual bool checkReady() const SAL_OVERRIDE;
70 virtual void startEngine( const com::sun::star::uno::Reference<
71 com::sun::star::xml::crypto::XXMLEncryptionTemplate >&
72 xEncryptionTemplate)
73 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
75 public:
76 explicit EncryptorImpl(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & xContext);
77 virtual ~EncryptorImpl();
79 /* XEncryptionResultBroadcaster */
80 virtual void SAL_CALL addEncryptionResultListener(
81 const com::sun::star::uno::Reference<
82 com::sun::star::xml::crypto::sax::XEncryptionResultListener >&
83 listener )
84 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 virtual void SAL_CALL removeEncryptionResultListener(
86 const com::sun::star::uno::Reference<
87 com::sun::star::xml::crypto::sax::XEncryptionResultListener >&
88 listener )
89 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 /* XReferenceCollector */
92 virtual void SAL_CALL setReferenceCount( sal_Int32 count )
93 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 virtual void SAL_CALL setReferenceId( sal_Int32 id )
96 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 /* XInitialization */
99 virtual void SAL_CALL initialize(
100 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
101 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 /* XServiceInfo */
104 virtual OUString SAL_CALL getImplementationName( )
105 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
107 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
109 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 OUString EncryptorImpl_getImplementationName()
113 throw ( com::sun::star::uno::RuntimeException );
115 com::sun::star::uno::Sequence< OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( )
116 throw ( com::sun::star::uno::RuntimeException );
118 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
119 SAL_CALL EncryptorImpl_createInstance(
120 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr)
121 throw ( com::sun::star::uno::Exception );
123 #endif
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */