vcl: 'horizontically'
[LibreOffice.git] / include / vcl / commandinfoprovider.hxx
blob016e53f79b3de8b21dd4b94ba70967873d49a504
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_VCL_COMMANDINFOPROVIDER_HXX
20 #define INCLUDED_VCL_COMMANDINFOPROVIDER_HXX
22 #include <vcl/dllapi.h>
23 #include <vcl/image.hxx>
24 #include <vcl/keycod.hxx>
26 namespace com::sun::star::frame { class XFrame; }
27 namespace com::sun::star::beans { struct PropertyValue; }
29 namespace vcl::CommandInfoProvider {
31 /** Return a label for the given command.
32 @param rsCommandName
33 The command name is expected to start with .uno:
34 @param rsModuleName
35 The current application module.
36 @return
37 The command properties.
39 VCL_DLLPUBLIC css::uno::Sequence<css::beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName);
41 /** Return a label for the given command.
42 @param rProperties
43 The properties from GetCommandProperties.
44 @return
45 The command label.
47 VCL_DLLPUBLIC OUString GetLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties);
49 VCL_DLLPUBLIC OUString GetMenuLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties);
51 VCL_DLLPUBLIC OUString GetPopupLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties);
53 VCL_DLLPUBLIC OUString GetTooltipLabelForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties);
55 /** Return a tooltip for the given command. Falls back to label if command has no tooltip.
56 @param rsCommandName
57 The command name is expected to start with .uno:
58 @param rProperties
59 The properties from GetCommandProperties.
60 @param rxFrame
61 The frame is used to identify the module and document.
62 @return
63 The returned label contains the keyboard accelerator, if
64 one is defined and bIncludeShortcut is true.
66 VCL_DLLPUBLIC OUString GetTooltipForCommand (
67 const OUString& rsCommandName,
68 const css::uno::Sequence<css::beans::PropertyValue>& rProperties,
69 const css::uno::Reference<css::frame::XFrame>& rxFrame);
71 /** Returns the shortcut for a command in human-readable form */
72 VCL_DLLPUBLIC OUString GetCommandShortcut (const OUString& rCommandName,
73 const css::uno::Reference<css::frame::XFrame>& rxFrame);
75 VCL_DLLPUBLIC KeyCode GetCommandKeyCodeShortcut (const OUString& rCommandName,
76 const css::uno::Reference<css::frame::XFrame>& rxFrame);
78 VCL_DLLPUBLIC OUString GetRealCommandForCommand(const css::uno::Sequence<css::beans::PropertyValue>& rProperties);
80 VCL_DLLPUBLIC css::uno::Reference<css::graphic::XGraphic> GetXGraphicForCommand(
81 const OUString& rsCommandName,
82 const css::uno::Reference<css::frame::XFrame>& rxFrame,
83 vcl::ImageType eImageType = vcl::ImageType::Small);
85 VCL_DLLPUBLIC Image GetImageForCommand(
86 const OUString& rsCommandName,
87 const css::uno::Reference<css::frame::XFrame>& rxFrame,
88 vcl::ImageType eImageType = vcl::ImageType::Small);
90 VCL_DLLPUBLIC sal_Int32 GetPropertiesForCommand(
91 const OUString& rsCommandName,
92 const OUString& rsModuleName);
94 VCL_DLLPUBLIC bool IsRotated(const OUString& rsCommandName, const OUString& rsModuleName);
95 VCL_DLLPUBLIC bool IsMirrored(const OUString& rsCommandName, const OUString& rsModuleName);
97 /** Returns whether the command is experimental. */
98 VCL_DLLPUBLIC bool IsExperimental(
99 const OUString& rsCommandName,
100 const OUString& rModuleName);
102 VCL_DLLPUBLIC OUString GetModuleIdentifier(const css::uno::Reference<css::frame::XFrame>& rxFrame);
105 #endif // INCLUDED_VCL_COMMANDINFOPROVIDER_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */