1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_BASCTL_SOURCE_INC_DOCSIGNATURE_HXX
20 #define INCLUDED_BASCTL_SOURCE_INC_DOCSIGNATURE_HXX
22 #include <sfx2/signaturestate.hxx>
23 #include <vcl/weld.hxx>
32 /// encapsulates (actions on) the signature/state of a document
33 class DocumentSignature
36 /** creates a DocumentSignature instance for the given document
38 If the given ScriptDocument instance refers to the application, or to a document
39 which does not support being signed, the DocumentSignature instance is invalid afterwards.
41 explicit DocumentSignature (ScriptDocument
const&);
44 /** determines whether the instance is valid
46 An instance is valid if and only if it has been constructed with a document
47 which supports signatures.
49 bool supportsSignatures() const;
51 /** signs the scripting content inside the document
54 isValid returns <TRUE/>
56 void signScriptingContent(weld::Window
* pDialogParent
) const;
58 /** retrieves the state of the signature of the scripting content inside the document
60 If the instance is not valid, then SIGNATURESTATE_NOSIGNATURES is returned.
62 SignatureState
getScriptingSignatureState() const;
65 DocumentSignature() = delete;
69 std::unique_ptr
<Impl
> m_pImpl
;
76 #endif // INCLUDED_BASCTL_SOURCE_INC_DOCSIGNATURE_HXX
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */