1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_UNOTOOLS_DYNAMICMENUOPTIONS_HXX
20 #define INCLUDED_UNOTOOLS_DYNAMICMENUOPTIONS_HXX
22 #include <unotools/unotoolsdllapi.h>
23 #include <sal/types.h>
24 #include <osl/mutex.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <unotools/options.hxx>
29 /*-************************************************************************************************************//**
30 @descr The method GetList() returns a list of property values.
31 Use follow defines to separate values by names.
32 *//*-*************************************************************************************************************/
33 #define DYNAMICMENU_PROPERTYNAME_URL OUString("URL")
34 #define DYNAMICMENU_PROPERTYNAME_TITLE OUString("Title")
35 #define DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER OUString("ImageIdentifier")
36 #define DYNAMICMENU_PROPERTYNAME_TARGETNAME OUString("TargetName")
38 /*-************************************************************************************************************//**
39 @descr You can use these enum values to specify right menu if you call our interface methods.
40 *//*-*************************************************************************************************************/
48 /*-************************************************************************************************************//**
49 @short forward declaration to our private date container implementation
50 @descr We use these class as internal member to support small memory requirements.
51 You can create the container if it is neccessary. The class which use these mechanism
52 is faster and smaller then a complete implementation!
53 *//*-*************************************************************************************************************/
55 class SvtDynamicMenuOptions_Impl
;
57 /*-************************************************************************************************************//**
58 @short collect information about dynamic menus
59 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
64 @devstatus ready to use
65 *//*-*************************************************************************************************************/
67 class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtDynamicMenuOptions
: public utl::detail::Options
70 /*-****************************************************************************************************//**
71 @short standard constructor and destructor
72 @descr This will initialize an instance with default values.
73 We implement these class with a refcount mechanism! Every instance of this class increase it
74 at create and decrease it at delete time - but all instances use the same data container!
75 He is implemented as a static member ...
77 @seealso member m_nRefCount
78 @seealso member m_pDataContainer
84 *//*-*****************************************************************************************************/
86 SvtDynamicMenuOptions();
87 virtual ~SvtDynamicMenuOptions();
89 /*-****************************************************************************************************//**
90 @short return complete specified list
91 @descr Call it to get all entries of an dynamic menu.
92 We return a list of all nodes with his names and properties.
96 @param "eMenu" select right menu.
97 @return A list of menu items is returned.
99 @onerror We return an empty list.
100 *//*-*****************************************************************************************************/
102 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> > GetMenu( EDynamicMenuType eMenu
) const;
105 /*-****************************************************************************************************//**
106 @short return a reference to a static mutex
107 @descr These class is partially threadsafe (for de-/initialization only).
108 All access methods are'nt safe!
109 We create a static mutex only for one ime and use at different times.
114 @return A reference to a static mutex member.
117 *//*-*****************************************************************************************************/
119 UNOTOOLS_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
125 Don't initialize these static member in these header!
126 a) Double dfined symbols will be detected ...
127 b) and unresolved externals exist at linking time.
128 Do it in your source only.
131 static SvtDynamicMenuOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
132 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
134 }; // class SvtDynamicMenuOptions
136 #endif // INCLUDED_UNOTOOLS_DYNAMICMENUOPTIONS_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */