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 <osl/mutex.hxx>
25 #include <unotools/options.hxx>
27 /*-************************************************************************************************************//**
28 @short forward declaration to our private date container implementation
29 @descr We use these class as internal member to support small memory requirements.
30 You can create the container if it is neccessary. The class which use these mechanism
31 is faster and smaller then a complete implementation!
32 *//*-*************************************************************************************************************/
35 class SvtMenuOptions_Impl
;
37 /*-************************************************************************************************************//**
38 @short collect information about menu features
44 @devstatus ready to use
45 *//*-*************************************************************************************************************/
47 class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions
: public utl::detail::Options
51 /*-****************************************************************************************************//**
52 @short standard constructor and destructor
53 @descr This will initialize an instance with default values.
54 We implement these class with a refcount mechanism! Every instance of this class increase it
55 at create and decrease it at delete time - but all instances use the same data container!
56 He is implemented as a static member ...
58 @seealso member m_nRefCount
59 @seealso member m_pDataContainer
65 *//*-*****************************************************************************************************/
68 virtual ~SvtMenuOptions();
70 void AddListenerLink( const Link
& rLink
);
71 void RemoveListenerLink( const Link
& rLink
);
73 /*-****************************************************************************************************//**
74 @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..."
75 @descr These options describe internal states to enable/disable features of installed office.
77 IsEntryHidingEnabled()
78 SetEntryHidingState() => Activate this field for viewing all deactivated menu entries.
79 Menu commands that are normally not necessary are hidden by default.
82 IsFollowMouseEnabled()
83 SetFollowMouseState() => Automatic selection while moving the mouse on a menu.
86 @seealso configuration package "org.openoffice.Office.Common/View/Menu"
87 *//*-*****************************************************************************************************/
89 sal_Bool
IsEntryHidingEnabled() const;
90 sal_Int16
GetMenuIconsState() const;
91 void SetMenuIconsState( sal_Int16 bState
);
95 /*-****************************************************************************************************//**
96 @short return a reference to a static mutex
97 @descr These class is partially threadsafe (for de-/initialization only).
98 All access methods are'nt safe!
99 We create a static mutex only for one ime and use at different times.
104 @return A reference to a static mutex member.
107 *//*-*****************************************************************************************************/
109 SVT_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
115 Don't initialize these static member in these header!
116 a) Double dfined symbols will be detected ...
117 b) and unresolved externals exist at linking time.
118 Do it in your source only.
121 static SvtMenuOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
122 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
124 }; // class SvtMenuOptions
126 #endif // #ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */