1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
24 #define INCLUDED_unotools_WORKINGSETOPTIONS_HXX
25 
26 //_________________________________________________________________________________________________________________
27 //	includes
28 //_________________________________________________________________________________________________________________
29 
30 #include <sal/types.h>
31 #include <osl/mutex.hxx>
32 #include <com/sun/star/uno/Sequence.h>
33 #include <rtl/ustring.hxx>
34 #include <unotools/options.hxx>
35 
36 //_________________________________________________________________________________________________________________
37 //	forward declarations
38 //_________________________________________________________________________________________________________________
39 
40 /*-************************************************************************************************************//**
41 	@short			forward declaration to our private date container implementation
42 	@descr			We use these class as internal member to support small memory requirements.
43 					You can create the container if it is neccessary. The class which use these mechanism
44 					is faster and smaller then a complete implementation!
45 *//*-*************************************************************************************************************/
46 
47 class SvtWorkingSetOptions_Impl;
48 
49 //_________________________________________________________________________________________________________________
50 //	declarations
51 //_________________________________________________________________________________________________________________
52 
53 /*-************************************************************************************************************//**
54 	@short			collect informations about security features
55 	@descr          -
56 
57 	@implements		-
58 	@base			-
59 
60 	@devstatus		ready to use
61 *//*-*************************************************************************************************************/
62 
63 class SvtWorkingSetOptions: public utl::detail::Options
64 {
65 	//-------------------------------------------------------------------------------------------------------------
66 	//	public methods
67 	//-------------------------------------------------------------------------------------------------------------
68 
69 	public:
70 
71 		//---------------------------------------------------------------------------------------------------------
72 		//	constructor / destructor
73 		//---------------------------------------------------------------------------------------------------------
74 
75 		/*-****************************************************************************************************//**
76 			@short		standard constructor and destructor
77 			@descr		This will initialize an instance with default values.
78 						We implement these class with a refcount mechanism! Every instance of this class increase it
79 						at create and decrease it at delete time - but all instances use the same data container!
80 						He is implemented as a static member ...
81 
82 			@seealso	member m_nRefCount
83 			@seealso	member m_pDataContainer
84 
85 			@param		-
86 			@return		-
87 
88 			@onerror	-
89 		*//*-*****************************************************************************************************/
90 
91          SvtWorkingSetOptions();
92         virtual ~SvtWorkingSetOptions();
93 
94 		//---------------------------------------------------------------------------------------------------------
95 		//	interface
96 		//---------------------------------------------------------------------------------------------------------
97 
98 		/*-****************************************************************************************************//**
99 			@short		interface methods to get and set value of config key "org.openoffice.Office.Common/Security/Scripting/SecureURL"
100 			@descr		These value defines the editing view for documents and windows, which have to be restored
101 						when restarting StarOffice. The list gets filled, if Save/WorkingSet = true.
102 
103 			@seealso	-
104 
105 			@param		"seqWindowList", new values to set it in configuration.
106 			@return		The values which represent current state of internal variable.
107 
108 			@onerror	No error should occurre!
109 		*//*-*****************************************************************************************************/
110 
111 		::com::sun::star::uno::Sequence< ::rtl::OUString >	GetWindowList(																			) const	;
112 		void												SetWindowList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqWindowList	)		;
113 
114 	//-------------------------------------------------------------------------------------------------------------
115 	//	private methods
116 	//-------------------------------------------------------------------------------------------------------------
117 
118 		/*-****************************************************************************************************//**
119 			@short		return a reference to a static mutex
120 			@descr		These class use his own static mutex to be threadsafe.
121 						We create a static mutex only for one ime and use at different times.
122 
123 			@seealso	-
124 
125 			@param		-
126 			@return		A reference to a static mutex member.
127 
128 			@onerror	-
129 		*//*-*****************************************************************************************************/
130 
131 		static ::osl::Mutex& GetOwnStaticMutex();
132 
133 	//-------------------------------------------------------------------------------------------------------------
134 	//	private member
135 	//-------------------------------------------------------------------------------------------------------------
136 
137 	private:
138 
139 		/*Attention
140 
141 			Don't initialize these static member in these header!
142 			a) Double dfined symbols will be detected ...
143 			b) and unresolved externals exist at linking time.
144 			Do it in your source only.
145 		 */
146 
147     	static SvtWorkingSetOptions_Impl*	m_pDataContainer	;	/// impl. data container as dynamic pointer for smaller memory requirements!
148 		static sal_Int32					m_nRefCount			;	/// internal ref count mechanism
149 
150 };		// class SvtWorkingSetOptions
151 
152 #endif  // #ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
153