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