xref: /aoo42x/main/basctl/source/inc/docsignature.hxx (revision 96821c26)
1*96821c26SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96821c26SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96821c26SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96821c26SAndrew Rist  * distributed with this work for additional information
6*96821c26SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96821c26SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96821c26SAndrew Rist  * "License"); you may not use this file except in compliance
9*96821c26SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96821c26SAndrew Rist  *
11*96821c26SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96821c26SAndrew Rist  *
13*96821c26SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96821c26SAndrew Rist  * software distributed under the License is distributed on an
15*96821c26SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96821c26SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96821c26SAndrew Rist  * specific language governing permissions and limitations
18*96821c26SAndrew Rist  * under the License.
19*96821c26SAndrew Rist  *
20*96821c26SAndrew Rist  *************************************************************/
21*96821c26SAndrew Rist 
22*96821c26SAndrew Rist 
23cdf0e10cSrcweir #ifndef BASCTL_DOCSIGNATURE_HXX
24cdf0e10cSrcweir #define BASCTL_DOCSIGNATURE_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir /** === begin UNO includes === **/
27cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
28cdf0e10cSrcweir /** === end UNO includes === **/
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <memory>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //........................................................................
33cdf0e10cSrcweir namespace basctl
34cdf0e10cSrcweir {
35cdf0e10cSrcweir //........................................................................
36cdf0e10cSrcweir 
37cdf0e10cSrcweir     class ScriptDocument;
38cdf0e10cSrcweir 	//====================================================================
39cdf0e10cSrcweir 	//= DocumentSignature
40cdf0e10cSrcweir 	//====================================================================
41cdf0e10cSrcweir     struct DocumentSignature_Data;
42cdf0e10cSrcweir     /// encapsulates (actions on) the signature/state of a document
43cdf0e10cSrcweir 	class DocumentSignature
44cdf0e10cSrcweir 	{
45cdf0e10cSrcweir     public:
46cdf0e10cSrcweir         /** creates a DocumentSignature instance for the given document
47cdf0e10cSrcweir 
48cdf0e10cSrcweir             If the given ScriptDocument instance refers to the application, or to a document
49cdf0e10cSrcweir             which does not support being signed, the DocumentSignature instance is invalid afterwards.
50cdf0e10cSrcweir         */
51cdf0e10cSrcweir         DocumentSignature( const ScriptDocument& _rDocument );
52cdf0e10cSrcweir         ~DocumentSignature();
53cdf0e10cSrcweir 
54cdf0e10cSrcweir         /** determines whether the instance is valid
55cdf0e10cSrcweir 
56cdf0e10cSrcweir             An instance is valid if and only if it has been constructed with a document
57cdf0e10cSrcweir             which supports signatures.
58cdf0e10cSrcweir         */
59cdf0e10cSrcweir         bool    supportsSignatures() const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir         /** signs the scripting content inside the document
62cdf0e10cSrcweir 
63cdf0e10cSrcweir             @precond
64cdf0e10cSrcweir                 isValid returns <TRUE/>
65cdf0e10cSrcweir         */
66cdf0e10cSrcweir         void        signScriptingContent() const;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         /** retrieves the state of the signature of the scripting content inside the document
69cdf0e10cSrcweir 
70cdf0e10cSrcweir             If the instance is not valid, then SIGNATURESTATE_NOSIGNATURES is returned.
71cdf0e10cSrcweir         */
72cdf0e10cSrcweir         sal_uInt16  getScriptingSignatureState() const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     private:
75cdf0e10cSrcweir         DocumentSignature();        // not implemented
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     private:
78cdf0e10cSrcweir         ::std::auto_ptr< DocumentSignature_Data >   m_pData;
79cdf0e10cSrcweir 	};
80cdf0e10cSrcweir 
81cdf0e10cSrcweir //........................................................................
82cdf0e10cSrcweir } // namespace basctl
83cdf0e10cSrcweir //........................................................................
84cdf0e10cSrcweir 
85cdf0e10cSrcweir #endif // BASCTL_DOCSIGNATURE_HXX
86