kodi
GameWindowFullScreenText.h
1 /*
2  * Copyright (C) 2017-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 <string>
12 #include <vector>
13 
14 class CGUIDialog;
15 class CGUIMessage;
16 class CGUIWindow;
17 
18 namespace KODI
19 {
20 namespace RETRO
21 {
23 {
24 public:
25  CGameWindowFullScreenText(CGUIWindow& fullscreenWindow);
26  ~CGameWindowFullScreenText() = default;
27 
28  // Window functions
29  void OnWindowLoaded();
30  void FrameMove();
31 
35  const std::string& GetText(unsigned int lineIndex) const;
36 
40  void SetText(unsigned int lineIndex, std::string line);
41 
45  const std::vector<std::string>& GetText() const;
46 
50  void SetText(std::vector<std::string> text);
51 
52 private:
53  // Window functions
54  void UploadText();
55  void Show();
56  void Hide();
57 
65  static int GetControlID(unsigned int lineIndex);
66 
67  // Window functions required by GUIMessage macros
69  int GetID() const;
70  bool OnMessage(CGUIMessage& message);
71 
72  // Construction parameters
73  CGUIWindow& m_fullscreenWindow;
74 
75  // Window state
76  bool m_bShowText = false;
77  bool m_bTextChanged = true;
78  bool m_bTextVisibilityChanged = true;
79 
80  // Text
81  std::vector<std::string> m_lines;
82 };
83 } // namespace RETRO
84 } // namespace KODI
void SetText(unsigned int lineIndex, std::string line)
Set a line of text.
Definition: GameWindowFullScreenText.cpp:59
Definition: GameWindowFullScreenText.h:22
const std::vector< std::string > & GetText() const
Get entire text.
Definition: GameWindowFullScreenText.cpp:67
Definition: GUIDialog.h:35
Definition: AudioDecoder.h:18
Definition: GUIMessage.h:365
Definition: GUIWindow.h:58