1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dynamicmenuoptions.hxx,v $
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_DYNAMICMENUOPTIONS_HXX
31 #define INCLUDED_SVTOOLS_DYNAMICMENUOPTIONS_HXX
34 #include <sal/types.h>
37 #ifndef _OSL_MUTEX_HXX_
38 #include <osl/mutex.hxx>
41 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
42 #include <com/sun/star/uno/Sequence.h>
45 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
46 #include <com/sun/star/beans/PropertyValue.hpp>
49 #ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
50 #include <bf_svtools/options.hxx>
55 //_________________________________________________________________________________________________________________
57 //_________________________________________________________________________________________________________________
59 /*-************************************************************************************************************//**
60 @descr The method GetList() returns a list of property values.
61 Use follow defines to seperate values by names.
62 *//*-*************************************************************************************************************/
63 #define DYNAMICMENU_PROPERTYNAME_URL ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL" ))
64 #define DYNAMICMENU_PROPERTYNAME_TITLE ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" ))
65 #define DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageIdentifier" ))
66 #define DYNAMICMENU_PROPERTYNAME_TARGETNAME ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TargetName" ))
68 /*-************************************************************************************************************//**
69 @descr You can use these enum values to specify right menu if you call our interface methods.
70 *//*-*************************************************************************************************************/
77 //_________________________________________________________________________________________________________________
78 // forward declarations
79 //_________________________________________________________________________________________________________________
81 /*-************************************************************************************************************//**
82 @short forward declaration to our private date container implementation
83 @descr We use these class as internal member to support small memory requirements.
84 You can create the container if it is neccessary. The class which use these mechanism
85 is faster and smaller then a complete implementation!
86 *//*-*************************************************************************************************************/
88 class SvtDynamicMenuOptions_Impl
;
90 //_________________________________________________________________________________________________________________
92 //_________________________________________________________________________________________________________________
94 /*-************************************************************************************************************//**
95 @short collect informations about dynamic menus
96 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
101 @devstatus ready to use
102 *//*-*************************************************************************************************************/
104 class SvtDynamicMenuOptions
: public Options
106 //-------------------------------------------------------------------------------------------------------------
108 //-------------------------------------------------------------------------------------------------------------
112 //---------------------------------------------------------------------------------------------------------
113 // constructor / destructor
114 //---------------------------------------------------------------------------------------------------------
116 /*-****************************************************************************************************//**
117 @short standard constructor and destructor
118 @descr This will initialize an instance with default values.
119 We implement these class with a refcount mechanism! Every instance of this class increase it
120 at create and decrease it at delete time - but all instances use the same data container!
121 He is implemented as a static member ...
123 @seealso member m_nRefCount
124 @seealso member m_pDataContainer
130 *//*-*****************************************************************************************************/
132 SvtDynamicMenuOptions();
133 virtual ~SvtDynamicMenuOptions();
135 //---------------------------------------------------------------------------------------------------------
137 //---------------------------------------------------------------------------------------------------------
139 //-------------------------------------------------------------------------------------------------------------
141 //-------------------------------------------------------------------------------------------------------------
145 /*-****************************************************************************************************//**
146 @short return a reference to a static mutex
147 @descr These class is partially threadsafe (for de-/initialization only).
148 All access methods are'nt safe!
149 We create a static mutex only for one ime and use at different times.
154 @return A reference to a static mutex member.
157 *//*-*****************************************************************************************************/
159 static ::osl::Mutex
& GetOwnStaticMutex();
161 //-------------------------------------------------------------------------------------------------------------
163 //-------------------------------------------------------------------------------------------------------------
169 Don't initialize these static member in these header!
170 a) Double dfined symbols will be detected ...
171 b) and unresolved externals exist at linking time.
172 Do it in your source only.
175 static SvtDynamicMenuOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
176 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
178 }; // class SvtDynamicMenuOptions
182 #endif // #ifndef INCLUDED_SVTOOLS_DYNAMICMENUOPTIONS_HXX