diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-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/SettingsSlider.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h | 326 |
1 files changed, 0 insertions, 326 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h deleted file mode 100644 index 76a02aa..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/SettingsSlider.h +++ /dev/null | |||
| @@ -1,326 +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 | |||
| 14 | namespace kodi | ||
| 15 | { | ||
| 16 | namespace gui | ||
| 17 | { | ||
| 18 | namespace controls | ||
| 19 | { | ||
| 20 | |||
| 21 | //============================================================================ | ||
| 22 | /// | ||
| 23 | /// \defgroup cpp_kodi_gui_controls_CSettingsSlider Control Settings Slider | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CSettingsSlider } | ||
| 26 | /// **Window control for moveable slider with text name** | ||
| 27 | /// | ||
| 28 | /// The settings slider control is used in the settings screens for when an | ||
| 29 | /// option is best specified on a sliding scale. You can choose the position, | ||
| 30 | /// size, and look of the slider control. It is basically a cross between the | ||
| 31 | /// button control and a slider control. It has a label and focus and non | ||
| 32 | /// focus textures, as well as a slider control on the right. | ||
| 33 | /// | ||
| 34 | /// It has the header \ref SettingsSlider.h "#include <kodi/gui/controls/SettingsSlider.h>" | ||
| 35 | /// be included to enjoy it. | ||
| 36 | /// | ||
| 37 | /// Here you find the needed skin part for a \ref Settings_Slider_Control "settings slider 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 | /// | ||
| 42 | class ATTRIBUTE_HIDDEN CSettingsSlider : public CAddonGUIControlBase | ||
| 43 | { | ||
| 44 | public: | ||
| 45 | //========================================================================== | ||
| 46 | /// | ||
| 47 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 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 | CSettingsSlider(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 54 | { | ||
| 55 | m_controlHandle = m_interface->kodi_gui->window->get_control_settings_slider( | ||
| 56 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 57 | if (!m_controlHandle) | ||
| 58 | kodi::Log(ADDON_LOG_FATAL, | ||
| 59 | "kodi::gui::controls::CSettingsSlider can't create control class from Kodi !!!"); | ||
| 60 | } | ||
| 61 | //-------------------------------------------------------------------------- | ||
| 62 | |||
| 63 | //========================================================================== | ||
| 64 | /// | ||
| 65 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 66 | /// @brief Destructor | ||
| 67 | /// | ||
| 68 | ~CSettingsSlider() override = default; | ||
| 69 | //-------------------------------------------------------------------------- | ||
| 70 | |||
| 71 | //========================================================================== | ||
| 72 | /// | ||
| 73 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 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_settings_slider->set_visible(m_interface->kodiBase, | ||
| 81 | m_controlHandle, visible); | ||
| 82 | } | ||
| 83 | //-------------------------------------------------------------------------- | ||
| 84 | |||
| 85 | //========================================================================== | ||
| 86 | /// | ||
| 87 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 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_settings_slider->set_enabled(m_interface->kodiBase, | ||
| 95 | m_controlHandle, enabled); | ||
| 96 | } | ||
| 97 | //-------------------------------------------------------------------------- | ||
| 98 | |||
| 99 | //========================================================================== | ||
| 100 | /// | ||
| 101 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 102 | /// @brief To set the text string on settings slider | ||
| 103 | /// | ||
| 104 | /// @param[in] text Text to show | ||
| 105 | /// | ||
| 106 | void SetText(const std::string& text) | ||
| 107 | { | ||
| 108 | m_interface->kodi_gui->control_settings_slider->set_text(m_interface->kodiBase, m_controlHandle, | ||
| 109 | text.c_str()); | ||
| 110 | } | ||
| 111 | //-------------------------------------------------------------------------- | ||
| 112 | |||
| 113 | //========================================================================== | ||
| 114 | /// | ||
| 115 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 116 | /// @brief To reset slider on defaults | ||
| 117 | /// | ||
| 118 | void Reset() | ||
| 119 | { | ||
| 120 | m_interface->kodi_gui->control_settings_slider->reset(m_interface->kodiBase, m_controlHandle); | ||
| 121 | } | ||
| 122 | //-------------------------------------------------------------------------- | ||
| 123 | |||
| 124 | //========================================================================== | ||
| 125 | /// | ||
| 126 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 127 | /// @brief To set the the range as integer of slider, e.g. -10 is the slider | ||
| 128 | /// start and e.g. +10 is the from here defined position where it reach the | ||
| 129 | /// end. | ||
| 130 | /// | ||
| 131 | /// Ad default is the range from 0 to 100. | ||
| 132 | /// | ||
| 133 | /// The integer interval is as default 1 and can be changed with | ||
| 134 | /// @ref SetIntInterval. | ||
| 135 | /// | ||
| 136 | /// @param[in] start Integer start value | ||
| 137 | /// @param[in] end Integer end value | ||
| 138 | /// | ||
| 139 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 140 | /// these different values can be not together and can, therefore, only | ||
| 141 | /// one each can be used. | ||
| 142 | /// | ||
| 143 | void SetIntRange(int start, int end) | ||
| 144 | { | ||
| 145 | m_interface->kodi_gui->control_settings_slider->set_int_range(m_interface->kodiBase, | ||
| 146 | m_controlHandle, start, end); | ||
| 147 | } | ||
| 148 | //-------------------------------------------------------------------------- | ||
| 149 | |||
| 150 | //========================================================================== | ||
| 151 | /// | ||
| 152 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 153 | /// @brief Set the slider position with the given integer value. The Range | ||
| 154 | /// must be defined with a call from \ref SetIntRange before. | ||
| 155 | /// | ||
| 156 | /// @param[in] value Position in range to set with integer | ||
| 157 | /// | ||
| 158 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 159 | /// these different values can be not together and can, therefore, only | ||
| 160 | /// one each can be used. | ||
| 161 | /// | ||
| 162 | void SetIntValue(int value) | ||
| 163 | { | ||
| 164 | m_interface->kodi_gui->control_settings_slider->set_int_value(m_interface->kodiBase, | ||
| 165 | m_controlHandle, value); | ||
| 166 | } | ||
| 167 | //-------------------------------------------------------------------------- | ||
| 168 | |||
| 169 | //========================================================================== | ||
| 170 | /// | ||
| 171 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 172 | /// @brief To get the current position as integer value. | ||
| 173 | /// | ||
| 174 | /// @return The position as integer | ||
| 175 | /// | ||
| 176 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 177 | /// these different values can be not together and can, therefore, only | ||
| 178 | /// one each can be used. | ||
| 179 | /// | ||
| 180 | int GetIntValue() const | ||
| 181 | { | ||
| 182 | return m_interface->kodi_gui->control_settings_slider->get_int_value(m_interface->kodiBase, | ||
| 183 | m_controlHandle); | ||
| 184 | } | ||
| 185 | //-------------------------------------------------------------------------- | ||
| 186 | |||
| 187 | //========================================================================== | ||
| 188 | /// | ||
| 189 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 190 | /// @brief To set the interval steps of slider, as default is it 1. If it | ||
| 191 | /// becomes changed with this function will a step of the user with the | ||
| 192 | /// value fixed here be executed. | ||
| 193 | /// | ||
| 194 | /// @param[in] interval Intervall step to set. | ||
| 195 | /// | ||
| 196 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 197 | /// these different values can be not together and can, therefore, only | ||
| 198 | /// one each can be used. | ||
| 199 | /// | ||
| 200 | void SetIntInterval(int interval) | ||
| 201 | { | ||
| 202 | m_interface->kodi_gui->control_settings_slider->set_int_interval(m_interface->kodiBase, | ||
| 203 | m_controlHandle, interval); | ||
| 204 | } | ||
| 205 | //-------------------------------------------------------------------------- | ||
| 206 | |||
| 207 | //========================================================================== | ||
| 208 | /// | ||
| 209 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 210 | /// @brief Sets the percent of the slider. | ||
| 211 | /// | ||
| 212 | /// @param[in] percent float - Percent value of slide | ||
| 213 | /// | ||
| 214 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 215 | /// these different values can be not together and can, therefore, only | ||
| 216 | /// one each can be used. | ||
| 217 | /// | ||
| 218 | void SetPercentage(float percent) | ||
| 219 | { | ||
| 220 | m_interface->kodi_gui->control_settings_slider->set_percentage(m_interface->kodiBase, | ||
| 221 | m_controlHandle, percent); | ||
| 222 | } | ||
| 223 | //-------------------------------------------------------------------------- | ||
| 224 | |||
| 225 | //========================================================================== | ||
| 226 | /// | ||
| 227 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 228 | /// @brief Returns a float of the percent of the slider. | ||
| 229 | /// | ||
| 230 | /// @return float - Percent of slider | ||
| 231 | /// | ||
| 232 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 233 | /// these different values can be not together and can, therefore, only | ||
| 234 | /// one each can be used. | ||
| 235 | /// | ||
| 236 | float GetPercentage() const | ||
| 237 | { | ||
| 238 | return m_interface->kodi_gui->control_settings_slider->get_percentage(m_interface->kodiBase, | ||
| 239 | m_controlHandle); | ||
| 240 | } | ||
| 241 | //-------------------------------------------------------------------------- | ||
| 242 | |||
| 243 | //========================================================================== | ||
| 244 | /// | ||
| 245 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 246 | /// @brief To set the the range as float of slider, e.g. -25.0 is the slider | ||
| 247 | /// start and e.g. +25.0 is the from here defined position where it reach | ||
| 248 | /// the end. | ||
| 249 | /// | ||
| 250 | /// As default is the range 0.0 to 1.0. | ||
| 251 | /// | ||
| 252 | /// The float interval is as default 0.1 and can be changed with | ||
| 253 | /// @ref SetFloatInterval. | ||
| 254 | /// | ||
| 255 | /// @param[in] start Integer start value | ||
| 256 | /// @param[in] end Integer end value | ||
| 257 | /// | ||
| 258 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 259 | /// these different values can be not together and can, therefore, only | ||
| 260 | /// one each can be used. | ||
| 261 | /// | ||
| 262 | void SetFloatRange(float start, float end) | ||
| 263 | { | ||
| 264 | m_interface->kodi_gui->control_settings_slider->set_float_range(m_interface->kodiBase, | ||
| 265 | m_controlHandle, start, end); | ||
| 266 | } | ||
| 267 | //-------------------------------------------------------------------------- | ||
| 268 | |||
| 269 | //========================================================================== | ||
| 270 | /// | ||
| 271 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 272 | /// @brief Set the slider position with the given float value. The Range | ||
| 273 | /// can be defined with a call from \ref SetIntRange before, as default it | ||
| 274 | /// is 0.0 to 1.0. | ||
| 275 | /// | ||
| 276 | /// @param[in] value Position in range to set with float | ||
| 277 | /// | ||
| 278 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 279 | /// these different values can be not together and can, therefore, only | ||
| 280 | /// one each can be used. | ||
| 281 | /// | ||
| 282 | void SetFloatValue(float value) | ||
| 283 | { | ||
| 284 | m_interface->kodi_gui->control_settings_slider->set_float_value(m_interface->kodiBase, | ||
| 285 | m_controlHandle, value); | ||
| 286 | } | ||
| 287 | //-------------------------------------------------------------------------- | ||
| 288 | |||
| 289 | //========================================================================== | ||
| 290 | /// | ||
| 291 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 292 | /// @brief To get the current position as float value. | ||
| 293 | /// | ||
| 294 | /// @return The position as float | ||
| 295 | /// | ||
| 296 | float GetFloatValue() const | ||
| 297 | { | ||
| 298 | return m_interface->kodi_gui->control_settings_slider->get_float_value(m_interface->kodiBase, | ||
| 299 | m_controlHandle); | ||
| 300 | } | ||
| 301 | //-------------------------------------------------------------------------- | ||
| 302 | |||
| 303 | //========================================================================== | ||
| 304 | /// | ||
| 305 | /// \ingroup cpp_kodi_gui_controls_CSettingsSlider | ||
| 306 | /// @brief To set the interval steps of slider, as default is it 0.1 If it | ||
| 307 | /// becomes changed with this function will a step of the user with the | ||
| 308 | /// value fixed here be executed. | ||
| 309 | /// | ||
| 310 | /// @param[in] interval Intervall step to set. | ||
| 311 | /// | ||
| 312 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 313 | /// these different values can be not together and can, therefore, only | ||
| 314 | /// one each can be used. | ||
| 315 | /// | ||
| 316 | void SetFloatInterval(float interval) | ||
| 317 | { | ||
| 318 | m_interface->kodi_gui->control_settings_slider->set_float_interval(m_interface->kodiBase, | ||
| 319 | m_controlHandle, interval); | ||
| 320 | } | ||
| 321 | //-------------------------------------------------------------------------- | ||
| 322 | }; | ||
| 323 | |||
| 324 | } /* namespace controls */ | ||
| 325 | } /* namespace gui */ | ||
| 326 | } /* namespace kodi */ | ||
