summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.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/RadioButton.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/RadioButton.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h167
1 files changed, 0 insertions, 167 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h
deleted file mode 100644
index 305195d..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/RadioButton.h
+++ /dev/null
@@ -1,167 +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_CRadioButton Control Radio Button
24/// \ingroup cpp_kodi_gui
25/// @brief \cpp_class{ kodi::gui::controls::CRadioButton }
26/// **Window control for a radio button (as used for on/off settings)**
27///
28/// The radio button control is used for creating push button on/off settings
29/// in Kodi. You can choose the position, size, and look of the button. When
30/// the user clicks on the radio button, the state will change, toggling the
31/// extra textures (textureradioon and textureradiooff). Used for settings
32/// controls.
33///
34/// It has the header \ref RadioButton.h "#include <kodi/gui/controls/RadioButton.h>"
35/// be included to enjoy it.
36///
37/// Here you find the needed skin part for a \ref Radio_button_control "radio button control"
38///
39/// @note The call of the control is only possible from the corresponding
40/// window as its class and identification number is required.
41///
42class ATTRIBUTE_HIDDEN CRadioButton : public CAddonGUIControlBase
43{
44public:
45 //==========================================================================
46 ///
47 /// \ingroup cpp_kodi_gui_controls_CRadioButton
48 /// @brief Construct a new control
49 ///
50 /// @param[in] window related window control class
51 /// @param[in] controlId Used skin xml control id
52 ///
53 CRadioButton(CWindow* window, int controlId) : CAddonGUIControlBase(window)
54 {
55 m_controlHandle = m_interface->kodi_gui->window->get_control_radio_button(
56 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
57 if (!m_controlHandle)
58 kodi::Log(ADDON_LOG_FATAL,
59 "kodi::gui::controls::CRadioButton can't create control class from Kodi !!!");
60 }
61 //--------------------------------------------------------------------------
62
63 //==========================================================================
64 ///
65 /// \ingroup cpp_kodi_gui_controls_CRadioButton
66 /// @brief Destructor
67 ///
68 ~CRadioButton() override = default;
69 //--------------------------------------------------------------------------
70
71 //==========================================================================
72 ///
73 /// \ingroup cpp_kodi_gui_controls_CRadioButton
74 /// @brief Set the control on window to visible
75 ///
76 /// @param[in] visible If true visible, otherwise hidden
77 ///
78 void SetVisible(bool visible)
79 {
80 m_interface->kodi_gui->control_radio_button->set_visible(m_interface->kodiBase, m_controlHandle,
81 visible);
82 }
83 //--------------------------------------------------------------------------
84
85 //==========================================================================
86 ///
87 /// \ingroup cpp_kodi_gui_controls_CRadioButton
88 /// @brief Set's the control's enabled/disabled state
89 ///
90 /// @param[in] enabled If true enabled, otherwise disabled
91 ///
92 void SetEnabled(bool enabled)
93 {
94 m_interface->kodi_gui->control_radio_button->set_enabled(m_interface->kodiBase, m_controlHandle,
95 enabled);
96 }
97 //--------------------------------------------------------------------------
98
99 //==========================================================================
100 ///
101 /// \ingroup cpp_kodi_gui_controls_CRadioButton
102 /// @brief To set the text string on radio button
103 ///
104 /// @param[in] label Text to show
105 ///
106 void SetLabel(const std::string& label)
107 {
108 m_interface->kodi_gui->control_radio_button->set_label(m_interface->kodiBase, m_controlHandle,
109 label.c_str());
110 }
111 //--------------------------------------------------------------------------
112
113 //==========================================================================
114 ///
115 /// \ingroup cpp_kodi_gui_controls_CRadioButton
116 /// @brief Get the used text from control
117 ///
118 /// @return Text shown
119 ///
120 std::string GetLabel() const
121 {
122 std::string label;
123 char* ret = m_interface->kodi_gui->control_radio_button->get_label(m_interface->kodiBase,
124 m_controlHandle);
125 if (ret != nullptr)
126 {
127 if (std::strlen(ret))
128 label = ret;
129 m_interface->free_string(m_interface->kodiBase, ret);
130 }
131 return label;
132 }
133 //--------------------------------------------------------------------------
134
135 //==========================================================================
136 ///
137 /// \ingroup cpp_kodi_gui_controls_CRadioButton
138 /// @brief To set radio button condition to on or off
139 ///
140 /// @param[in] selected true set radio button to selection on, otherwise
141 /// off
142 ///
143 void SetSelected(bool selected)
144 {
145 m_interface->kodi_gui->control_radio_button->set_selected(m_interface->kodiBase,
146 m_controlHandle, selected);
147 }
148 //--------------------------------------------------------------------------
149
150 //==========================================================================
151 ///
152 /// \ingroup cpp_kodi_gui_controls_CRadioButton
153 /// @brief Get the current selected condition of radio button
154 ///
155 /// @return Selected condition
156 ///
157 bool IsSelected() const
158 {
159 return m_interface->kodi_gui->control_radio_button->is_selected(m_interface->kodiBase,
160 m_controlHandle);
161 }
162 //--------------------------------------------------------------------------
163};
164
165} /* namespace controls */
166} /* namespace gui */
167} /* namespace kodi */