android: Update app-specific/MIME type icons
[LibreOffice.git] / include / oox / crypto / StrongEncryptionDataSpace.hxx
blobcd7156515ab37d3fb188b1532653cef113cc6f2d
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 */
11 #ifndef INCLUDED_OOX_CRYPTO_STRONGENCRYPTINDATASPACE_HXX
12 #define INCLUDED_OOX_CRYPTO_STRONGENCRYPTINDATASPACE_HXX
14 #include <sal/config.h>
16 #include <memory>
18 #include <cppuhelper/implbase.hxx>
19 #include <com/sun/star/lang/XServiceInfo.hpp>
20 #include <com/sun/star/packages/XPackageEncryption.hpp>
21 #include <com/sun/star/io/XInputStream.hpp>
22 #include <oox/crypto/CryptoEngine.hxx>
24 namespace com::sun::star::uno
26 class XComponentContext;
29 namespace oox::crypto
31 class StrongEncryptionDataSpace final
32 : public cppu::WeakImplHelper<css::lang::XServiceInfo, css::packages::XPackageEncryption>
34 css::uno::Reference<css::uno::XComponentContext> mxContext;
35 std::unique_ptr<CryptoEngine> mCryptoEngine;
37 css::uno::Reference<css::io::XInputStream>
38 getStream(const css::uno::Sequence<css::beans::NamedValue>& rStreams,
39 std::u16string_view sStreamName);
41 public:
42 StrongEncryptionDataSpace(const css::uno::Reference<css::uno::XComponentContext>& rxContext);
44 // Decryption
46 virtual sal_Bool SAL_CALL generateEncryptionKey(const OUString& rPassword) override;
47 virtual sal_Bool SAL_CALL
48 readEncryptionInfo(const css::uno::Sequence<css::beans::NamedValue>& aStreams) override;
49 virtual sal_Bool SAL_CALL
50 decrypt(const css::uno::Reference<css::io::XInputStream>& rxInputStream,
51 css::uno::Reference<css::io::XOutputStream>& rxOutputStream) override;
53 virtual sal_Bool SAL_CALL checkDataIntegrity() override;
55 // Encryption
57 virtual css::uno::Sequence<css::beans::NamedValue>
58 SAL_CALL encrypt(const css::uno::Reference<css::io::XInputStream>& rxInputStream) override;
60 virtual sal_Bool SAL_CALL
61 setupEncryption(const css::uno::Sequence<css::beans::NamedValue>& rMediaEncData) override;
63 virtual css::uno::Sequence<css::beans::NamedValue>
64 SAL_CALL createEncryptionData(const OUString& rPassword) override;
66 // com.sun.star.lang.XServiceInfo
67 virtual OUString SAL_CALL getImplementationName() override;
68 virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
69 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
72 } // namespace oox::crypto
74 #endif
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */