Debian Codegraph @

xbmc/input/keymaps/interfaces/IKeymapEnvironment.h

raw
1 /*
2 * Copyright (C) 2017-2024 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9 #pragma once
10
11 namespace KODI
12 {
13 namespace KEYMAP
14 {
15 /*!
16 * \ingroup keymap
17 *
18 * \brief Customizes the environment in which keymapping is performed
19 *
20 * By overriding GetWindowID() and GetFallthrough(), an agent can customize
21 * the behavior of the keymap by forcing a window and preventing the use of
22 * a fallback window, respectively.
23 *
24 * An agent can also inform the keymap that it isn't accepting input currently,
25 * allowing the input to fall through to the next input handler.
26 */
27 class IKeymapEnvironment
28 {
29 public:
30 virtual ~IKeymapEnvironment() = default;
31
32 /*!
33 * \brief Get the window ID for which actions should be translated
34 *
35 * \return The window ID
36 */
37 virtual int GetWindowID() const = 0;
38
39 /*!
40 * \brief Set the window ID
41 *
42 * \param The window ID, used for translating actions
43 */
44 virtual void SetWindowID(int windowId) = 0;
45
46 /*!
47 * \brief Get the fallthrough window to when a key definition is missing
48 *
49 * \param windowId The window ID
50 *
51 * \return The window ID, or -1 for no fallthrough
52 */
53 virtual int GetFallthrough(int windowId) const = 0;
54
55 /*!
56 * \brief Specify if the global keymap should be used when the window and
57 * fallback window are undefined
58 */
59 virtual bool UseGlobalFallthrough() const = 0;
60
61 /*!
62 * \brief Specify if the agent should monitor for easter egg presses
63 */
64 virtual bool UseEasterEgg() const = 0;
65 };
66 } // namespace KEYMAP
67 } // namespace KODI