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 <osl/mutex.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/frame/XFrame.hpp>
27 #include <rtl/ustring.hxx>
28 #include <unotools/options.hxx>
30 /*-************************************************************************************************************//**
31 @descr The method GetList() returns a list of property values.
32 Use follow defines to separate values by names.
33 *//*-*************************************************************************************************************/
35 /*-************************************************************************************************************//**
36 @short forward declaration to our private date container implementation
37 @descr We use these class as internal member to support small memory requirements.
38 You can create the container if it is neccessary. The class which use these mechanism
39 is faster and smaller then a complete implementation!
40 *//*-*************************************************************************************************************/
42 class SvtCommandOptions_Impl
;
44 /*-************************************************************************************************************//**
45 @short collect information about dynamic menus
46 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
51 @devstatus ready to use
52 *//*-*************************************************************************************************************/
54 class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtCommandOptions
: public utl::detail::Options
56 friend class SvtCommandOptions_Impl
;
66 /*-****************************************************************************************************//**
67 @short standard constructor and destructor
68 @descr This will initialize an instance with default values.
69 We implement these class with a refcount mechanism! Every instance of this class increase it
70 at create and decrease it at delete time - but all instances use the same data container!
71 He is implemented as a static member ...
73 @seealso member m_nRefCount
74 @seealso member m_pDataContainer
80 *//*-*****************************************************************************************************/
83 virtual ~SvtCommandOptions();
85 /*-****************************************************************************************************//**
86 @short return complete specified list
87 @descr Call it to get all entries of an dynamic menu.
88 We return a list of all nodes with his names and properties.
92 @param "eOption" select the list to retrieve.
93 @return A list of command strings is returned.
95 @onerror We return an empty list.
96 *//*-*****************************************************************************************************/
98 sal_Bool
HasEntries( CmdOption eOption
) const;
100 /*-****************************************************************************************************//**
101 @short Lookup if a command URL is inside a given list
102 @descr Lookup if a command URL is inside a given lst
106 @param "eOption" select right command list
107 @param "aCommandURL" a command URL that is used for the look up
108 @return "sal_True" if the command is inside the list otherwise "sal_False"
111 *//*-*****************************************************************************************************/
113 sal_Bool
Lookup( CmdOption eOption
, const OUString
& aCommandURL
) const;
115 /*-****************************************************************************************************//**
116 @short register an office frame, which must update its dispatches if
117 the underlying configuration was changed.
119 @descr To avoid using of "dead" frame objects or implementing
120 deregistration mechanism too, we use weak references to
123 @param "xFrame" points to the frame, which wish to be
124 notified, if configuration was changed.
128 *//*-*****************************************************************************************************/
130 void EstablisFrameCallback(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
);
134 /*-****************************************************************************************************//**
135 @short return a reference to a static mutex
136 @descr These class is partially threadsafe (for de-/initialization only).
137 All access methods are'nt safe!
138 We create a static mutex only for one ime and use at different times.
143 @return A reference to a static mutex member.
146 *//*-*****************************************************************************************************/
148 UNOTOOLS_DLLPRIVATE
static ::osl::Mutex
& GetOwnStaticMutex();
154 Don't initialize these static member in these header!
155 a) Double dfined symbols will be detected ...
156 b) and unresolved externals exist at linking time.
157 Do it in your source only.
160 static SvtCommandOptions_Impl
* m_pDataContainer
; /// impl. data container as dynamic pointer for smaller memory requirements!
161 static sal_Int32 m_nRefCount
; /// internal ref count mechanism
163 }; // class SvtCmdOptions
165 #endif // #ifndef INCLUDED_unotools_CMDOPTIONS_HXX
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */