Debian Codegraph @

xbmc/input/keyboard/KeyboardLayoutManager.h

raw
1 /*
2 * Copyright (C) 2015-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 "KeyboardLayout.h"
12
13 #include <map>
14 #include <string>
15 #include <utility>
16 #include <vector>
17
18 class CSetting;
19 struct StringSettingOption;
20
21 namespace KODI
22 {
23 namespace KEYBOARD
24 {
25 /*!
26 * \ingroup keyboard
27 */
28 using KeyboardLayouts = std::map<std::string, CKeyboardLayout>;
29
30 /*!
31 * \ingroup keyboard
32 */
33 class CKeyboardLayoutManager
34 {
35 public:
36 CKeyboardLayoutManager() = default;
37 virtual ~CKeyboardLayoutManager();
38
39 bool Load(const std::string& path = "");
40 void Unload();
41
42 const KeyboardLayouts& GetLayouts() const { return m_layouts; }
43 bool GetLayout(const std::string& name, CKeyboardLayout& layout) const;
44
45 static void SettingOptionsKeyboardLayoutsFiller(const std::shared_ptr<const CSetting>& setting,
46 std::vector<StringSettingOption>& list,
47 std::string& current,
48 void* data);
49
50 private:
51 CKeyboardLayoutManager(const CKeyboardLayoutManager&) = delete;
52 CKeyboardLayoutManager const& operator=(CKeyboardLayoutManager const&) = delete;
53
54 KeyboardLayouts m_layouts;
55 };
56 } // namespace KEYBOARD
57 } // namespace KODI