kodi
IKeymap.h
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 #include "input/keymaps/KeymapTypes.h"
12 
13 #include <string>
14 
15 namespace KODI
16 {
17 namespace KEYMAP
18 {
19 class IKeymapEnvironment;
20 
28 class IKeymap
29 {
30 public:
31  virtual ~IKeymap() = default;
32 
38  virtual std::string ControllerID() const = 0;
39 
43  virtual const IKeymapEnvironment* Environment() const = 0;
44 
52  virtual const KeymapActionGroup& GetActions(const std::string& keyName) const = 0;
53 };
54 
61 {
62 public:
63  virtual ~IWindowKeymap() = default;
64 
70  virtual std::string ControllerID() const = 0;
71 
79  virtual void MapAction(int windowId, const std::string& keyName, KeymapAction action) = 0;
80 
89  virtual const KeymapActionGroup& GetActions(int windowId, const std::string& keyName) const = 0;
90 };
91 } // namespace KEYMAP
92 } // namespace KODI
Interface for mapping buttons to Kodi actions for specific windows.
Definition: IKeymap.h:60
virtual const KeymapActionGroup & GetActions(const std::string &keyName) const =0
Get the actions for a given key name.
Action entry in joystick.xml.
Definition: KeymapTypes.h:23
Customizes the environment in which keymapping is performed.
Definition: IKeymapEnvironment.h:27
Container that sorts action entries by their holdtime.
Definition: KeymapTypes.h:38
Definition: AudioDecoder.h:18
virtual const IKeymapEnvironment * Environment() const =0
Access properties of the keymapping environment.
virtual std::string ControllerID() const =0
The controller ID.
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:28