sc: filter: rtf: add method "AddFont"
[LibreOffice.git] / include / unotools / cmdoptions.hxx
blobd0e6792ba8b9f001b880b9a4ca4725dc906a8926
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
26 #include <memory>
28 namespace com::sun::star::uno
30 template <typename> class Reference;
33 namespace com::sun::star::frame
35 class XFrame;
37 namespace osl
39 class Mutex;
42 /*-************************************************************************************************************
43 @descr The method GetList() returns a list of property values.
44 Use follow defines to separate values by names.
45 **-***********************************************************************************************************/
47 /*-************************************************************************************************************
48 @short forward declaration to our private date container implementation
49 @descr We use these class as internal member to support small memory requirements.
50 You can create the container if it is necessary. The class which use these mechanism
51 is faster and smaller then a complete implementation!
52 **-***********************************************************************************************************/
54 class SvtCommandOptions_Impl;
56 /*-************************************************************************************************************
57 @short collect information about dynamic menus
58 @descr Make it possible to configure dynamic menu structures of menus like "new" or "wizard".
59 @devstatus ready to use
60 **-***********************************************************************************************************/
62 class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtCommandOptions final : public utl::detail::Options
64 friend class SvtCommandOptions_Impl;
66 public:
67 enum CmdOption
69 CMDOPTION_DISABLED,
70 CMDOPTION_NONE
73 SvtCommandOptions();
74 virtual ~SvtCommandOptions() override;
76 /*-****************************************************************************************************
77 @short return complete specified list
78 @descr Call it to get all entries of an dynamic menu.
79 We return a list of all nodes with its names and properties.
80 @param "eOption" select the list to retrieve.
81 @return A list of command strings is returned.
83 @onerror We return an empty list.
84 **-***************************************************************************************************/
86 bool HasEntries(CmdOption eOption) const;
88 /*-****************************************************************************************************
89 @short Lookup if a command URL is inside a given list
90 @descr Lookup if a command URL is inside a given lst
91 @param "eOption" select right command list
92 @param "aCommandURL" a command URL that is used for the look up
93 @return "sal_True" if the command is inside the list otherwise "sal_False"
94 **-***************************************************************************************************/
96 bool Lookup(CmdOption eOption, const OUString& aCommandURL) const;
98 /*-****************************************************************************************************
99 @short register an office frame, which must update its dispatches if
100 the underlying configuration was changed.
102 @descr To avoid using of "dead" frame objects or implementing
103 deregistration mechanism too, we use weak references to
104 the given frames.
106 @param "xFrame" points to the frame, which wishes to be
107 notified, if configuration was changed.
108 **-***************************************************************************************************/
110 void EstablishFrameCallback(const css::uno::Reference<css::frame::XFrame>& xFrame);
112 private:
113 /*-****************************************************************************************************
114 @short return a reference to a static mutex
115 @descr These class is partially threadsafe (for de-/initialization only).
116 All access methods aren't safe!
117 We create a static mutex only for one ime and use at different times.
118 @return A reference to a static mutex member.
119 **-***************************************************************************************************/
121 UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
123 private:
124 std::shared_ptr<SvtCommandOptions_Impl> m_pImpl;
126 }; // class SvtCmdOptions
128 #endif // INCLUDED_UNOTOOLS_CMDOPTIONS_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */