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_SVTOOLS_MENUOPTIONS_HXX
20 #define INCLUDED_SVTOOLS_MENUOPTIONS_HXX
22 #include <svtools/svtdllapi.h>
23 #include <sal/types.h>
24 #include <tools/gen.hxx>
25 #include <tools/link.hxx>
26 #include <osl/mutex.hxx>
27 #include <unotools/options.hxx>
29 /*-************************************************************************************************************
30 @short forward declaration to our private date container implementation
31 @descr We use these class as internal member to support small memory requirements.
32 You can create the container if it is necessary. The class which use these mechanism
33 is faster and smaller then a complete implementation!
34 *//*-*************************************************************************************************************/
36 class SvtMenuOptions_Impl
;
38 /*-************************************************************************************************************
39 @short collect information about menu features
40 @devstatus ready to use
41 *//*-*************************************************************************************************************/
43 class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions
: public utl::detail::Options
47 /*-****************************************************************************************************
48 @short standard constructor and destructor
49 @descr This will initialize an instance with default values.
50 We implement these class with a refcount mechanism! Every instance of this class increase it
51 at create and decrease it at delete time - but all instances use the same data container!
52 He is implemented as a static member ...
54 @seealso member m_nRefCount
55 @seealso member m_pDataContainer
56 *//*-*****************************************************************************************************/
59 virtual ~SvtMenuOptions();
61 void AddListenerLink( const Link
<>& rLink
);
62 void RemoveListenerLink( const Link
<>& rLink
);
64 /*-****************************************************************************************************
65 @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..."
66 @descr These options describe internal states to enable/disable features of installed office.
68 IsEntryHidingEnabled()
69 SetEntryHidingState() => Activate this field for viewing all deactivated menu entries.
70 Menu commands that are normally not necessary are hidden by default.
73 IsFollowMouseEnabled()
74 SetFollowMouseState() => Automatic selection while moving the mouse on a menu.
77 @seealso configuration package "org.openoffice.Office.Common/View/Menu"
78 *//*-*****************************************************************************************************/
80 bool IsEntryHidingEnabled() const;
81 TriState
GetMenuIconsState() const;
82 void SetMenuIconsState(TriState eState
);
86 /*-****************************************************************************************************
87 @short return a reference to a static mutex
88 @descr These class is partially threadsafe (for de-/initialization only).
89 All access methods are'nt safe!
90 We create a static mutex only for one ime and use at different times.
91 @return A reference to a static mutex member.
92 *//*-*****************************************************************************************************/
94 SVT_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
100 Don't initialize these static members in these headers!
101 a) Double defined symbols will be detected ...
102 b) and unresolved externals exist at linking time.
103 Do it in your source only.
106 static SvtMenuOptions_Impl
* m_pDataContainer
;
107 static sal_Int32 m_nRefCount
;
109 }; // class SvtMenuOptions
111 #endif // #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */