summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h168
1 files changed, 0 insertions, 168 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h
deleted file mode 100644
index b4e8ae0..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/TextBox.h
+++ /dev/null
@@ -1,168 +0,0 @@
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 "../../AddonBase.h"
12#include "../Window.h"
13
14namespace kodi
15{
16namespace gui
17{
18namespace controls
19{
20
21//============================================================================
22///
23/// \defgroup cpp_kodi_gui_controls_CTextBox Control Text Box
24/// \ingroup cpp_kodi_gui
25/// @brief \cpp_class{ kodi::gui::controls::CTextBox }
26/// **Used to show a multi-page piece of text**
27///
28/// The text box control can be used to display descriptions, help texts or
29/// other larger texts. It corresponds to the representation which is also to
30/// be seen on the CDialogTextViewer.
31///
32/// It has the header \ref TextBox.h "#include <kodi/gui/controls/TextBox.h>"
33/// be included to enjoy it.
34///
35/// Here you find the needed skin part for a \ref Text_Box "textbox control".
36///
37/// @note The call of the control is only possible from the corresponding
38/// window as its class and identification number is required.
39///
40class ATTRIBUTE_HIDDEN CTextBox : public CAddonGUIControlBase
41{
42public:
43 //==========================================================================
44 ///
45 /// \ingroup cpp_kodi_gui_controls_CTextBox
46 /// @brief Construct a new control
47 ///
48 /// @param[in] window related window control class
49 /// @param[in] controlId Used skin xml control id
50 ///
51 CTextBox(CWindow* window, int controlId) : CAddonGUIControlBase(window)
52 {
53 m_controlHandle = m_interface->kodi_gui->window->get_control_text_box(
54 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
55 if (!m_controlHandle)
56 kodi::Log(ADDON_LOG_FATAL,
57 "kodi::gui::controls::CTextBox can't create control class from Kodi !!!");
58 }
59 //--------------------------------------------------------------------------
60
61 //==========================================================================
62 ///
63 /// \ingroup cpp_kodi_gui_controls_CTextBox
64 /// @brief Destructor
65 ///
66 ~CTextBox() override = default;
67 //--------------------------------------------------------------------------
68
69 //==========================================================================
70 ///
71 /// \ingroup cpp_kodi_gui_controls_CTextBox
72 /// @brief Set the control on window to visible
73 ///
74 /// @param[in] visible If true visible, otherwise hidden
75 ///
76 void SetVisible(bool visible)
77 {
78 m_interface->kodi_gui->control_text_box->set_visible(m_interface->kodiBase, m_controlHandle,
79 visible);
80 }
81 //--------------------------------------------------------------------------
82
83 //==========================================================================
84 ///
85 /// \ingroup cpp_kodi_gui_controls_CTextBox
86 /// @brief To reset box an remove all the text
87 ///
88 void Reset() { m_interface->kodi_gui->control_text_box->reset(m_controlHandle, m_controlHandle); }
89 //--------------------------------------------------------------------------
90
91 //==========================================================================
92 ///
93 /// \ingroup cpp_kodi_gui_controls_CTextBox
94 /// @brief To set the text on box
95 ///
96 /// @param[in] text Text to show
97 ///
98 void SetText(const std::string& text)
99 {
100 m_interface->kodi_gui->control_text_box->set_text(m_interface->kodiBase, m_controlHandle,
101 text.c_str());
102 }
103 //--------------------------------------------------------------------------
104
105 //==========================================================================
106 ///
107 /// \ingroup cpp_kodi_gui_controls_CTextBox
108 /// @brief Get the used text from control
109 ///
110 /// @return Text shown
111 ///
112 std::string GetText() const
113 {
114 std::string text;
115 char* ret =
116 m_interface->kodi_gui->control_text_box->get_text(m_interface->kodiBase, m_controlHandle);
117 if (ret != nullptr)
118 {
119 if (std::strlen(ret))
120 text = ret;
121 m_interface->free_string(m_interface->kodiBase, ret);
122 }
123 return text;
124 }
125 //--------------------------------------------------------------------------
126
127 //==========================================================================
128 ///
129 /// \ingroup cpp_kodi_gui_controls_CTextBox
130 /// @brief To scroll text on other position
131 ///
132 /// @param[in] position The line position to scroll to
133 ///
134 void Scroll(unsigned int position)
135 {
136 m_interface->kodi_gui->control_text_box->scroll(m_interface->kodiBase, m_controlHandle,
137 position);
138 }
139 //--------------------------------------------------------------------------
140
141 //==========================================================================
142 ///
143 /// \ingroup cpp_kodi_gui_controls_CTextBox
144 /// @brief To set automatic scrolling of textbox
145 ///
146 /// Specifies the timing and conditions of any autoscrolling this textbox
147 /// should have. Times are in milliseconds. The content is delayed for the
148 /// given delay, then scrolls at a rate of one line per time interval until
149 /// the end. If the repeat tag is present, it then delays for the repeat
150 /// time, fades out over 1 second, and repeats. It does not wrap or reset
151 /// to the top at the end of the scroll.
152 ///
153 /// @param[in] delay Content delay
154 /// @param[in] time One line per time interval
155 /// @param[in] repeat Delays with given time, fades out over 1
156 /// second, and repeats
157 ///
158 void SetAutoScrolling(int delay, int time, int repeat)
159 {
160 m_interface->kodi_gui->control_text_box->set_auto_scrolling(
161 m_interface->kodiBase, m_controlHandle, delay, time, repeat);
162 }
163 //--------------------------------------------------------------------------
164};
165
166} /* namespace controls */
167} /* namespace gui */
168} /* namespace kodi */