summaryrefslogtreecommitdiffstats
path: root/xbmc/input/IKeymapEnvironment.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/input/IKeymapEnvironment.h')
-rw-r--r--xbmc/input/IKeymapEnvironment.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/xbmc/input/IKeymapEnvironment.h b/xbmc/input/IKeymapEnvironment.h
new file mode 100644
index 0000000..8d327fd
--- /dev/null
+++ b/xbmc/input/IKeymapEnvironment.h
@@ -0,0 +1,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;
+};