kodi
InputCodingTable.h
1 /*
2  * Copyright (C) 2005-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 <memory>
12 #include <string>
13 #include <vector>
14 
16 {
17 public:
18  enum
19  {
20  TYPE_WORD_LIST,
21  TYPE_CONVERT_STRING
22  };
23  virtual int GetType() { return TYPE_WORD_LIST; }
24 
25  virtual ~IInputCodingTable() = default;
31  virtual void Initialize() {}
32 
38  virtual void Deinitialize() {}
39 
45  virtual bool IsInitialized() const { return true; }
46  virtual bool GetWordListPage(const std::string& strCode, bool isFirstPage) = 0;
47  virtual std::vector<std::wstring> GetResponse(int response) = 0;
48  const std::string& GetCodeChars() const { return m_codechars; }
49 
50  virtual void SetTextPrev(const std::string& strTextPrev) {}
51  virtual std::string ConvertString(const std::string& strCode) { return std::string(""); }
52 
53 protected:
54  std::string m_codechars;
55 };
56 
57 typedef std::shared_ptr<IInputCodingTable> IInputCodingTablePtr;
virtual void Deinitialize()
Called for the active keyboard layout when it&#39;s unloaded, stick any cleanup here. ...
Definition: InputCodingTable.h:38
virtual void Initialize()
Called for the active keyboard layout when it&#39;s loaded, stick any initialization here.
Definition: InputCodingTable.h:31
virtual bool IsInitialized() const
Can be overridden if initialization is expensive to avoid calling initialize more than needed...
Definition: InputCodingTable.h:45
Definition: InputCodingTable.h:15