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_CMDOPTIONS_HXX
20 #define INCLUDED_UNOTOOLS_CMDOPTIONS_HXX
22 #include <unotools/unotoolsdllapi.h>
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
25 #include <unotools/options.hxx>
28 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ template <typename
> class Reference
; } } } }
30 namespace com
{ namespace sun
{ namespace star
{ namespace frame
{ class XFrame
; } } } }
31 namespace osl
{ class Mutex
; }
33 /*-************************************************************************************************************
34 @descr The method GetList() returns a list of property values.
35 Use follow defines to separate values by names.
36 *//*-*************************************************************************************************************/
38 /*-************************************************************************************************************
39 @short forward declaration to our private date container implementation
40 @descr We use these class as internal member to support small memory requirements.
41 You can create the container if it is necessary. The class which use these mechanism
42 is faster and smaller then a complete implementation!
43 *//*-*************************************************************************************************************/
45 class SvtCommandOptions_Impl
;
47 /*-************************************************************************************************************
48 @short collect information about dynamic menus
49 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
50 @devstatus ready to use
51 *//*-*************************************************************************************************************/
53 class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtCommandOptions final
: public utl::detail::Options
55 friend class SvtCommandOptions_Impl
;
66 virtual ~SvtCommandOptions() override
;
68 /*-****************************************************************************************************
69 @short return complete specified list
70 @descr Call it to get all entries of an dynamic menu.
71 We return a list of all nodes with its names and properties.
72 @param "eOption" select the list to retrieve.
73 @return A list of command strings is returned.
75 @onerror We return an empty list.
76 *//*-*****************************************************************************************************/
78 bool HasEntries( CmdOption eOption
) const;
80 /*-****************************************************************************************************
81 @short Lookup if a command URL is inside a given list
82 @descr Lookup if a command URL is inside a given lst
83 @param "eOption" select right command list
84 @param "aCommandURL" a command URL that is used for the look up
85 @return "sal_True" if the command is inside the list otherwise "sal_False"
86 *//*-*****************************************************************************************************/
88 bool Lookup( CmdOption eOption
, const OUString
& aCommandURL
) const;
90 /*-****************************************************************************************************
91 @short register an office frame, which must update its dispatches if
92 the underlying configuration was changed.
94 @descr To avoid using of "dead" frame objects or implementing
95 deregistration mechanism too, we use weak references to
98 @param "xFrame" points to the frame, which wishes to be
99 notified, if configuration was changed.
100 *//*-*****************************************************************************************************/
102 void EstablishFrameCallback(const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
106 /*-****************************************************************************************************
107 @short return a reference to a static mutex
108 @descr These class is partially threadsafe (for de-/initialization only).
109 All access methods aren't safe!
110 We create a static mutex only for one ime and use at different times.
111 @return A reference to a static mutex member.
112 *//*-*****************************************************************************************************/
114 UNOTOOLS_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
117 std::shared_ptr
<SvtCommandOptions_Impl
> m_pImpl
;
119 }; // class SvtCmdOptions
121 #endif // INCLUDED_UNOTOOLS_CMDOPTIONS_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */