| 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 | /* |
| 3 | * This file is part of the LibreOffice project. |
| 4 | * |
| 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/. |
| 8 | */ |
| 9 | |
| 10 | #ifndef INCLUDED_SVX_SIGNATURELINEHELPER_HXX |
| 11 | #define INCLUDED_SVX_SIGNATURELINEHELPER_HXX |
| 12 | |
| 13 | #include <sal/config.h> |
| 14 | |
| 15 | #include <string_view> |
| 16 | |
| 17 | #include <rtl/ustring.hxx> |
| 18 | #include <svx/svxdllapi.h> |
| 19 | #include <svl/cryptosign.hxx> |
| 20 | |
| 21 | #include <com/sun/star/graphic/XGraphic.hpp> |
| 22 | #include <com/sun/star/security/XCertificate.hpp> |
| 23 | |
| 24 | namespace weld |
| 25 | { |
| 26 | class Window; |
| 27 | } |
| 28 | class SdrView; |
| 29 | class SfxObjectShell; |
| 30 | class SfxViewShell; |
| 31 | |
| 32 | namespace svx::SignatureLineHelper |
| 33 | { |
| 34 | /** |
| 35 | * Returns an SVG template. Once placeholders are replaced with real content, the result can be used |
| 36 | * as the graphic of a signature line shape. |
| 37 | */ |
| 38 | SVX_DLLPUBLIC OUString getSignatureImage(const OUString& rType = OUString()); |
| 39 | |
| 40 | /** |
| 41 | * Choose a signature for signature line purposes. |
| 42 | */ |
| 43 | SVX_DLLPUBLIC css::uno::Reference<css::security::XCertificate> |
| 44 | getSignatureCertificate(SfxObjectShell* pShell, SfxViewShell* pViewShell, weld::Window* pParent); |
| 45 | |
| 46 | /** |
| 47 | * Get a signer name out of a certificate. |
| 48 | */ |
| 49 | SVX_DLLPUBLIC OUString getSignerName(const svl::crypto::CertificateOrName& rCertificateOrName); |
| 50 | |
| 51 | /** |
| 52 | * Gets a localized date string. |
| 53 | */ |
| 54 | SVX_DLLPUBLIC OUString getLocalizedDate(); |
| 55 | |
| 56 | /** |
| 57 | * Interprets rSVG as a graphic and gives back the resulting UNO wrapper. |
| 58 | */ |
| 59 | SVX_DLLPUBLIC css::uno::Reference<css::graphic::XGraphic> importSVG(std::u16string_view rSVG); |
| 60 | |
| 61 | /** |
| 62 | * Sets xCertificate as the signing certificate of the selected shape on pView. |
| 63 | */ |
| 64 | SVX_DLLPUBLIC void setShapeCertificate(SfxViewShell* pViewShell, |
| 65 | const svl::crypto::CertificateOrName& rCertificateOrName); |
| 66 | } |
| 67 | |
| 68 | #endif |
| 69 | |
| 70 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |