xbmc
KeyboardLayout.h
1 /*
2  * Copyright (C) 2005-2018 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 "InputCodingTable.h"
12 
13 #include <map>
14 #include <string>
15 #include <vector>
16 
17 namespace tinyxml2
18 {
19 class XMLElement;
20 }
21 
23 {
24 public:
25  CKeyboardLayout() = default;
26  virtual ~CKeyboardLayout();
27  IInputCodingTablePtr GetCodingTable() { return m_codingtable; }
28 
29  bool Load(const tinyxml2::XMLElement* element);
30 
31  std::string GetIdentifier() const;
32  std::string GetName() const;
33  const std::string& GetLanguage() const { return m_language; }
34  const std::string& GetLayout() const { return m_layout; }
35 
36  enum ModifierKey
37  {
38  ModifierKeyNone = 0x00,
39  ModifierKeyShift = 0x01,
40  ModifierKeySymbol = 0x02
41  };
42 
43  std::string GetCharAt(unsigned int row, unsigned int column, unsigned int modifiers = 0) const;
44 
45 private:
46  static std::vector<std::string> BreakCharacters(const std::string& chars);
47 
48  typedef std::vector<std::vector<std::string>> KeyboardRows;
49  typedef std::map<unsigned int, KeyboardRows> Keyboards;
50 
51  std::string m_language;
52  std::string m_layout;
53  Keyboards m_keyboards;
54  IInputCodingTablePtr m_codingtable;
55 };
Definition: SkinTimerManager.h:18
Definition: KeyboardLayout.h:22