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 <com/sun/star/uno/Sequence.h>
25 #include <unotools/options.hxx>
28 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ struct PropertyValue
; } } } }
29 namespace osl
{ class Mutex
; }
31 /*-************************************************************************************************************
32 @descr The method GetList() returns a list of property values.
33 Use follow defines to separate values by names.
34 *//*-*************************************************************************************************************/
35 #define DYNAMICMENU_PROPERTYNAME_URL "URL"
36 #define DYNAMICMENU_PROPERTYNAME_TITLE "Title"
37 #define DYNAMICMENU_PROPERTYNAME_IMAGEIDENTIFIER "ImageIdentifier"
38 #define DYNAMICMENU_PROPERTYNAME_TARGETNAME "TargetName"
40 /*-************************************************************************************************************
41 @descr You can use these enum values to specify right menu if you call our interface methods.
42 *//*-*************************************************************************************************************/
43 enum class EDynamicMenuType
49 /*-************************************************************************************************************
50 @short forward declaration to our private date container implementation
51 @descr We use these class as internal member to support small memory requirements.
52 You can create the container if it is necessary. The class which use these mechanism
53 is faster and smaller then a complete implementation!
54 *//*-*************************************************************************************************************/
56 class SvtDynamicMenuOptions_Impl
;
58 /*-************************************************************************************************************
59 @short collect information about dynamic menus
60 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
61 @devstatus ready to use
62 *//*-*************************************************************************************************************/
64 class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions
: public utl::detail::Options
67 SvtDynamicMenuOptions();
68 virtual ~SvtDynamicMenuOptions() override
;
70 /*-****************************************************************************************************
71 @short return complete specified list
72 @descr Call it to get all entries of an dynamic menu.
73 We return a list of all nodes with its names and properties.
74 @param "eMenu" select right menu.
75 @return A list of menu items is returned.
77 @onerror We return an empty list.
78 *//*-*****************************************************************************************************/
80 css::uno::Sequence
< css::uno::Sequence
< css::beans::PropertyValue
> > GetMenu( EDynamicMenuType eMenu
) const;
83 /*-****************************************************************************************************
84 @short return a reference to a static mutex
85 @descr These class is partially threadsafe (for de-/initialization only).
86 All access methods aren't safe!
87 We create a static mutex only for one ime and use at different times.
88 @return A reference to a static mutex member.
89 *//*-*****************************************************************************************************/
91 UNOTOOLS_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
94 std::shared_ptr
<SvtDynamicMenuOptions_Impl
> m_pImpl
;
96 }; // class SvtDynamicMenuOptions
98 #endif // INCLUDED_UNOTOOLS_DYNAMICMENUOPTIONS_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */