sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / viewoptions.hxx
blob4b381938796e02ecd40e1b1ff91050b0c5e5f112
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: viewoptions.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_VIEWOPTIONS_HXX
31 #define INCLUDED_SVTOOLS_VIEWOPTIONS_HXX
33 //_________________________________________________________________________________________________________________
34 // includes
35 //_________________________________________________________________________________________________________________
37 #ifndef INCLUDED_SVLDLLAPI_H
39 #endif
41 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
42 #include <com/sun/star/uno/Sequence.hxx>
43 #endif
45 #ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
46 #include <com/sun/star/beans/NamedValue.hpp>
47 #endif
49 #ifndef _UTL_CONFIGMGR_HXX_
50 #include <unotools/configmgr.hxx>
51 #endif
53 #ifndef _UTL_CONFIGITEM_HXX_
54 #include <unotools/configitem.hxx>
55 #endif
57 #ifndef _SAL_TYPES_H_
58 #include <sal/types.h>
59 #endif
61 #ifndef _OSL_MUTEX_HXX_
62 #include <osl/mutex.hxx>
63 #endif
65 #ifndef _RTL_USTRING_HXX_
66 #include <rtl/ustring.hxx>
67 #endif
69 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
70 #include <bf_svtools/options.hxx>
71 #endif
73 namespace binfilter
76 //_________________________________________________________________________________________________________________
77 // forward declarations
78 //_________________________________________________________________________________________________________________
80 class SvtViewOptionsBase_Impl;
82 //_________________________________________________________________________________________________________________
83 // declarations
84 //_________________________________________________________________________________________________________________
86 /*-************************************************************************************************************//**
87 @descr Use these enum values to specify right list in configuration in which your view data are saved.
88 *//*-*************************************************************************************************************/
90 enum EViewType
92 E_DIALOG = 0,
93 E_TABDIALOG = 1,
94 E_TABPAGE = 2,
95 E_WINDOW = 3
98 /*-************************************************************************************************************//**
99 @short collect informations about view features
100 @descr We support different basetypes of views like dialogs, tab-dialogs, tab-pages and normal windows.
101 You must specify your basetype by using right enum value and must give us a valid name for your
102 subkey in registry! We support some fix features for some bastypes and user data as string for all!
103 see also configuration package "org.openoffice.Office.Views/..." for further informations.
105 template of configuration:
106 DialogType
107 /WindowState [string]
108 /UserData [set of any scalar types]
109 TabDialogType
110 /WindowState [string]
111 /UserData [set of any scalar types]
112 /PageID [int]
113 TabPageType
114 /WindowState [string]
115 /UserData [set of any scalar types]
116 WindowType
117 /WindowState [string]
118 /UserData [set of any scalar types]
119 /Visible [boolean]
121 structure of configuration:
123 org.openoffice.Office.Views [package]
124 /Dialogs [set]
125 /Dialog_FileOpen [DialogType]
126 /Dialog_ImportGraphics [DialogType]
128 /Dialog_<YourName> [DialogType]
130 /TabDialogs [set]
131 /TabDialog_001 [TabDialogType]
132 /TabDialog_Blubber [TabDialogType]
134 /TabDialog_<YourName> [TabDialogType]
136 /TabPages [set]
137 /TabPage_XXX [TabPageType]
138 /TabPage_Date [TabPageType]
140 /TabPage_<YourName> [TabPageType]
142 /Windows [set]
143 /Window_User [WindowType]
144 /Window_Options [WindowType]
146 /Window_<YourName> [WindowType]
148 @implements -
149 @base -
151 @devstatus ready to use
152 *//*-*************************************************************************************************************/
154 class SvtViewOptions: public Options
157 #ifdef TF_OLDVIEW
158 public:
159 void GetPosition ( sal_Int32& nX ,
160 sal_Int32& nY ) const;
161 void SetPosition ( sal_Int32 nX ,
162 sal_Int32 nY );
163 void GetSize ( sal_Int32& nWidth ,
164 sal_Int32& nHeight ) const;
165 void SetSize ( sal_Int32 nWidth ,
166 sal_Int32 nHeight );
167 ::rtl::OUString GetUserData ( ) const;
168 void SetUserData ( const ::rtl::OUString& sData );
169 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SeperateUserData( const ::rtl::OUString& sData ,
170 sal_Unicode cSeperator=';' );
171 static ::rtl::OUString GenerateUserData( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqData ,
172 sal_Unicode cSeperator=';' );
173 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > GetAnyData ( ) const;
174 void SetAnyData ( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lData );
175 #endif
178 //-------------------------------------------------------------------------------------------------------------
179 // public methods
180 //-------------------------------------------------------------------------------------------------------------
182 public:
184 //---------------------------------------------------------------------------------------------------------
185 // constructor / destructor
186 //---------------------------------------------------------------------------------------------------------
188 /*-****************************************************************************************************//**
189 @short standard constructor and destructor
190 @descr This will de-/initialize an instance with default values.
191 You must give us the basic type of your view and a name which specify right entry
192 in dynamical configuration list. If entry not exist, we create a new one!
194 @seealso enum EViewType
196 @param "eType" specify type of your view and is used to use right data container!
197 @param "sViewName" specify the name of your view and is the key name in data list too.
198 @return -
200 @onerror An assertion is thrown in debug version. Otherwise we do nothing!
201 *//*-*****************************************************************************************************/
203 SvtViewOptions( EViewType eType ,
204 const ::rtl::OUString& sViewName );
205 virtual ~SvtViewOptions();
207 //-------------------------------------------------------------------------------------------------------------
208 // private methods
209 //-------------------------------------------------------------------------------------------------------------
211 private:
213 /*-****************************************************************************************************//**
214 @short return a reference to a static mutex
215 @descr These class is threadsafe.
216 We create a static mutex only for one time and use it to protect our refcount and container
217 member!
219 @seealso -
221 @param -
222 @return A reference to a static mutex member.
224 @onerror -
225 *//*-*****************************************************************************************************/
227 static ::osl::Mutex& GetOwnStaticMutex();
229 //-------------------------------------------------------------------------------------------------------------
230 // private member
231 //-------------------------------------------------------------------------------------------------------------
233 private:
235 /// specify which list of views in configuration is used! This can't be a static value!!!
236 /// ... because we need this value to work with right static data container.
237 EViewType m_eViewType ;
238 ::rtl::OUString m_sViewName ;
240 /// - impl. data container as dynamic pointer for smaller memory requirements!
241 /// - internal ref count mechanism
243 /*Attention
245 Don't initialize these static member in these header!
246 a) Double defined symbols will be detected ...
247 b) and unresolved externals exist at linking time.
248 Do it in your source only.
251 static SvtViewOptionsBase_Impl* m_pDataContainer_Dialogs ; /// hold data for all dialogs
252 static sal_Int32 m_nRefCount_Dialogs ;
253 static SvtViewOptionsBase_Impl* m_pDataContainer_TabDialogs ; /// hold data for all tab-dialogs
254 static sal_Int32 m_nRefCount_TabDialogs ;
255 static SvtViewOptionsBase_Impl* m_pDataContainer_TabPages ; /// hold data for all tab-pages
256 static sal_Int32 m_nRefCount_TabPages ;
257 static SvtViewOptionsBase_Impl* m_pDataContainer_Windows ; /// hold data for all windows
258 static sal_Int32 m_nRefCount_Windows ;
260 }; // class SvtViewOptions
264 #endif // #ifndef INCLUDED_SVTOOLS_VIEWOPTIONS_HXX