Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svtools / securityoptions.hxx
blob319509c1156939e3aa026c9eac6ca5f651897666
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: securityoptions.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_SVTOOLS_SECURITYOPTIONS_HXX
31 #define INCLUDED_SVTOOLS_SECURITYOPTIONS_HXX
33 //_________________________________________________________________________________________________________________
34 // includes
35 //_________________________________________________________________________________________________________________
37 #ifndef _SAL_TYPES_H_
38 #include <sal/types.h>
39 #endif
41 #ifndef _OSL_MUTEX_HXX_
42 #include <osl/mutex.hxx>
43 #endif
45 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
46 #include <com/sun/star/uno/Sequence.h>
47 #endif
49 #ifndef _RTL_USTRING_HXX_
50 #include <rtl/ustring.hxx>
51 #endif
53 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
54 #include <bf_svtools/options.hxx>
55 #endif
57 namespace binfilter
60 //_________________________________________________________________________________________________________________
61 // forward declarations
62 //_________________________________________________________________________________________________________________
64 /*-************************************************************************************************************//**
65 @short forward declaration to our private date container implementation
66 @descr We use these class as internal member to support small memory requirements.
67 You can create the container if it is neccessary. The class which use these mechanism
68 is faster and smaller then a complete implementation!
69 *//*-*************************************************************************************************************/
71 class SvtSecurityOptions_Impl;
73 //_________________________________________________________________________________________________________________
74 // declarations
75 //_________________________________________________________________________________________________________________
77 /*-************************************************************************************************************//**
78 @descr These values present modes to handle StarOffice basic scripts.
79 see GetBasicMode/SetBasicMode() for further informations
80 *//*-*************************************************************************************************************/
82 enum EBasicSecurityMode
84 eNEVER_EXECUTE = 0,
85 eFROM_LIST = 1,
86 eALWAYS_EXECUTE = 2
89 /*-************************************************************************************************************//**
90 @short collect informations about security features
91 @descr -
93 @implements -
94 @base -
96 @ATTENTION This class is partially threadsafe.
98 @devstatus ready to use
99 *//*-*************************************************************************************************************/
101 class SvtSecurityOptions: public Options
103 //-------------------------------------------------------------------------------------------------------------
104 // public types
105 //-------------------------------------------------------------------------------------------------------------
106 public:
108 enum EOption
110 E_SECUREURLS,
111 E_BASICMODE, // xmlsec05 depricated
112 E_EXECUTEPLUGINS, // xmlsec05 depricated
113 E_WARNING, // xmlsec05 depricated
114 E_CONFIRMATION, // xmlsec05 depricated
115 E_DOCWARN_SAVEORSEND,
116 E_DOCWARN_SIGNING,
117 E_DOCWARN_PRINT,
118 E_DOCWARN_CREATEPDF,
119 E_DOCWARN_REMOVEPERSONALINFO,
120 E_DOCWARN_RECOMMENDPASSWORD,
121 E_MACRO_SECLEVEL,
122 E_MACRO_TRUSTEDAUTHORS,
123 E_MACRO_DISABLE,
124 E_CTRLCLICK_HYPERLINK
127 enum MacroAction
129 MA_DONTRUN = 0,
130 MA_CONFIRM,
131 MA_RUN
134 typedef ::com::sun::star::uno::Sequence< ::rtl::OUString > Certificate;
137 // MT: Doesn't work for sequence...
138 struct Certificate
140 ::rtl::OUString SubjectName;
141 ::rtl::OUString SerialNumber;
142 ::rtl::OUString RawData;
146 //-------------------------------------------------------------------------------------------------------------
147 // public methods
148 //-------------------------------------------------------------------------------------------------------------
150 public:
152 //---------------------------------------------------------------------------------------------------------
153 // constructor / destructor
154 //---------------------------------------------------------------------------------------------------------
156 /*-****************************************************************************************************//**
157 @short standard constructor and destructor
158 @descr This will initialize an instance with default values.
159 We implement these class with a refcount mechanism! Every instance of this class increase it
160 at create and decrease it at delete time - but all instances use the same data container!
161 He is implemented as a static member ...
163 @seealso member m_nRefCount
164 @seealso member m_pDataContainer
166 @param -
167 @return -
169 @onerror -
170 *//*-*****************************************************************************************************/
172 SvtSecurityOptions();
173 virtual ~SvtSecurityOptions();
175 //-------------------------------------------------------------------------------------------------------------
176 // private methods
177 //-------------------------------------------------------------------------------------------------------------
179 private:
181 /*-****************************************************************************************************//**
182 @short return a reference to a static mutex
183 @descr These class is partially threadsafe (for de-/initialization only).
184 All access methods are'nt safe!
185 We create a static mutex only for one ime and use at different times.
187 @seealso -
189 @param -
190 @return A reference to a static mutex member.
192 @onerror -
193 *//*-*****************************************************************************************************/
195 static ::osl::Mutex& GetInitMutex();
197 //-------------------------------------------------------------------------------------------------------------
198 // private member
199 //-------------------------------------------------------------------------------------------------------------
201 private:
203 /*Attention
205 Don't initialize these static member in these header!
206 a) Double dfined symbols will be detected ...
207 b) and unresolved externals exist at linking time.
208 Do it in your source only.
211 static SvtSecurityOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
212 static sal_Int32 m_nRefCount ; /// internal ref count mechanism
214 }; // class SvtSecurityOptions
218 #endif // #ifndef INCLUDED_SVTOOLS_SECURITYOPTIONS_HXX