Debian Codegraph @

xbmc/input/keyboard/generic/DefaultKeyboardHandling.h

raw
1 /*
2 * Copyright (C) 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/keyboard/interfaces/IKeyboardDriverHandler.h"
12
13 #include <memory>
14
15 namespace PERIPHERALS
16 {
17 class CPeripheral;
18 } // namespace PERIPHERALS
19
20 namespace KODI
21 {
22 namespace JOYSTICK
23 {
24 class IButtonMap;
25 } // namespace JOYSTICK
26
27 namespace KEYBOARD
28 {
29 class IKeyboardInputHandler;
30
31 class CDefaultKeyboardHandling : public IKeyboardDriverHandler
32 {
33 public:
34 CDefaultKeyboardHandling(PERIPHERALS::CPeripheral* peripheral, IKeyboardInputHandler* handler);
35
36 ~CDefaultKeyboardHandling() override;
37
38 bool Load();
39
40 // Implementation of IKeyboardDriverHandler
41 bool OnKeyPress(const CKey& key) override;
42 void OnKeyRelease(const CKey& key) override;
43
44 private:
45 // Construction parameters
46 PERIPHERALS::CPeripheral* const m_peripheral;
47 IKeyboardInputHandler* const m_inputHandler;
48
49 // Input parameters
50 std::unique_ptr<IKeyboardDriverHandler> m_driverHandler;
51 std::unique_ptr<JOYSTICK::IButtonMap> m_buttonMap;
52 };
53 } // namespace KEYBOARD
54 } // namespace KODI