summaryrefslogtreecommitdiffstats
path: root/xbmc/input/IKeymapEnvironment.h
blob: 8d327fd09377542883d53db41a0ea75f366e4775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 *  Copyright (C) 2017-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

/*!
 * \brief Customizes the environment in which keymapping is performed
 *
 * By overriding GetWindowID() and GetFallthrough(), an agent can customize
 * the behavior of the keymap by forcing a window and preventing the use of
 * a fallback window, respectively.
 *
 * An agent can also inform the keymap that it isn't accepting input currently,
 * allowing the input to fall through to the next input handler.
 */
class IKeymapEnvironment
{
public:
  virtual ~IKeymapEnvironment() = default;

  /*!
   * \brief Get the window ID for which actions should be translated
   *
   * \return The window ID
   */
  virtual int GetWindowID() const = 0;

  /*!
   * \brief Set the window ID
   *
   * \param The window ID, used for translating actions
   */
  virtual void SetWindowID(int windowId) = 0;

  /*!
   * \brief Get the fallthrough window to when a key definition is missing
   *
   * \param windowId The window ID
   *
   * \return The window ID, or -1 for no fallthrough
   */
  virtual int GetFallthrough(int windowId) const = 0;

  /*!
   * \brief Specify if the global keymap should be used when the window and
   *        fallback window are undefined
   */
  virtual bool UseGlobalFallthrough() const = 0;

  /*!
   * \brief Specify if the agent should monitor for easter egg presses
   */
  virtual bool UseEasterEgg() const = 0;
};