summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h121
1 files changed, 0 insertions, 121 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
deleted file mode 100644
index 82604bd..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Label.h
+++ /dev/null
@@ -1,121 +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_CLabel Control Label
24/// \ingroup cpp_kodi_gui
25/// @brief \cpp_class{ kodi::gui::controls::CLabel }
26/// **Window control used to show some lines of text.**
27///
28/// The label control is used for displaying text in Kodi. You can choose
29/// the font, size, colour, location and contents of the text to be displayed.
30///
31/// It has the header \ref Label.h "#include <kodi/gui/controls/Label.h>"
32/// be included to enjoy it.
33///
34/// Here you find the needed skin part for a \ref Label_Control "label control"
35///
36/// @note The call of the control is only possible from the corresponding
37/// window as its class and identification number is required.
38///
39class ATTRIBUTE_HIDDEN CLabel : public CAddonGUIControlBase
40{
41public:
42 //==========================================================================
43 ///
44 /// \ingroup cpp_kodi_gui_controls_CLabel
45 /// @brief Construct a new control
46 ///
47 /// @param[in] window related window control class
48 /// @param[in] controlId Used skin xml control id
49 ///
50 CLabel(CWindow* window, int controlId) : CAddonGUIControlBase(window)
51 {
52 m_controlHandle = m_interface->kodi_gui->window->get_control_label(
53 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
54 if (!m_controlHandle)
55 kodi::Log(ADDON_LOG_FATAL,
56 "kodi::gui::controls::CLabel can't create control class from Kodi !!!");
57 }
58 //--------------------------------------------------------------------------
59
60 //==========================================================================
61 ///
62 /// \ingroup cpp_kodi_gui_controls_CLabel
63 /// @brief Destructor
64 ///
65 ~CLabel() override = default;
66 //--------------------------------------------------------------------------
67
68 //==========================================================================
69 ///
70 /// \ingroup cpp_kodi_gui_controls_CLabel
71 /// @brief Set the control on window to visible
72 ///
73 /// @param[in] visible If true visible, otherwise hidden
74 ///
75 void SetVisible(bool visible)
76 {
77 m_interface->kodi_gui->control_label->set_visible(m_interface->kodiBase, m_controlHandle,
78 visible);
79 }
80 //--------------------------------------------------------------------------
81
82 //==========================================================================
83 ///
84 /// \ingroup cpp_kodi_gui_controls_CLabel
85 /// @brief To set the text string on label
86 ///
87 /// @param[in] text Text to show
88 ///
89 void SetLabel(const std::string& text)
90 {
91 m_interface->kodi_gui->control_label->set_label(m_interface->kodiBase, m_controlHandle,
92 text.c_str());
93 }
94 //--------------------------------------------------------------------------
95
96 //==========================================================================
97 ///
98 /// \ingroup cpp_kodi_gui_controls_CLabel
99 /// @brief Get the used text from control
100 ///
101 /// @return Used text on label control
102 ///
103 std::string GetLabel() const
104 {
105 std::string label;
106 char* ret =
107 m_interface->kodi_gui->control_label->get_label(m_interface->kodiBase, m_controlHandle);
108 if (ret != nullptr)
109 {
110 if (std::strlen(ret))
111 label = ret;
112 m_interface->free_string(m_interface->kodiBase, ret);
113 }
114 return label;
115 }
116 //--------------------------------------------------------------------------
117};
118
119} /* namespace controls */
120} /* namespace gui */
121} /* namespace kodi */