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 | |
| 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')
13 files changed, 0 insertions, 2536 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h deleted file mode 100644 index 081ab06..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h +++ /dev/null | |||
| @@ -1,171 +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_CButton Control Button | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CButton } | ||
| 26 | /// **Standard push button control for window** | ||
| 27 | /// | ||
| 28 | /// The button control is used for creating push buttons in Kodi. You can | ||
| 29 | /// choose the position, size, and look of the button, as well as choosing | ||
| 30 | /// what action(s) should be performed when pushed. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Button.h "#include <kodi/gui/controls/Button.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref skin_Button_control "button 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 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CButton : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | //========================================================================== | ||
| 44 | /// | ||
| 45 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 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 | CButton(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 52 | { | ||
| 53 | m_controlHandle = m_interface->kodi_gui->window->get_control_button( | ||
| 54 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CButton can't create control class from Kodi !!!"); | ||
| 57 | } | ||
| 58 | //-------------------------------------------------------------------------- | ||
| 59 | |||
| 60 | //========================================================================== | ||
| 61 | /// | ||
| 62 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 63 | /// @brief Destructor | ||
| 64 | /// | ||
| 65 | ~CButton() override = default; | ||
| 66 | //-------------------------------------------------------------------------- | ||
| 67 | |||
| 68 | //========================================================================== | ||
| 69 | /// | ||
| 70 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 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_button->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 78 | visible); | ||
| 79 | } | ||
| 80 | //-------------------------------------------------------------------------- | ||
| 81 | |||
| 82 | //========================================================================== | ||
| 83 | /// | ||
| 84 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 85 | /// @brief Set's the control's enabled/disabled state | ||
| 86 | /// | ||
| 87 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 88 | /// | ||
| 89 | void SetEnabled(bool enabled) | ||
| 90 | { | ||
| 91 | m_interface->kodi_gui->control_button->set_enabled(m_interface->kodiBase, m_controlHandle, | ||
| 92 | enabled); | ||
| 93 | } | ||
| 94 | //-------------------------------------------------------------------------- | ||
| 95 | |||
| 96 | //========================================================================== | ||
| 97 | /// | ||
| 98 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 99 | /// @brief To set the text string on button | ||
| 100 | /// | ||
| 101 | /// @param[in] label Text to show | ||
| 102 | /// | ||
| 103 | void SetLabel(const std::string& label) | ||
| 104 | { | ||
| 105 | m_interface->kodi_gui->control_button->set_label(m_interface->kodiBase, m_controlHandle, | ||
| 106 | label.c_str()); | ||
| 107 | } | ||
| 108 | //-------------------------------------------------------------------------- | ||
| 109 | |||
| 110 | //========================================================================== | ||
| 111 | /// | ||
| 112 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 113 | /// @brief Get the used text from button | ||
| 114 | /// | ||
| 115 | /// @return Text shown | ||
| 116 | /// | ||
| 117 | std::string GetLabel() const | ||
| 118 | { | ||
| 119 | std::string label; | ||
| 120 | char* ret = | ||
| 121 | m_interface->kodi_gui->control_button->get_label(m_interface->kodiBase, m_controlHandle); | ||
| 122 | if (ret != nullptr) | ||
| 123 | { | ||
| 124 | if (std::strlen(ret)) | ||
| 125 | label = ret; | ||
| 126 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 127 | } | ||
| 128 | return label; | ||
| 129 | } | ||
| 130 | //-------------------------------------------------------------------------- | ||
| 131 | |||
| 132 | //========================================================================== | ||
| 133 | /// | ||
| 134 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 135 | /// @brief If two labels are used for button becomes it set with them | ||
| 136 | /// | ||
| 137 | /// @param[in] label Text for second label | ||
| 138 | /// | ||
| 139 | void SetLabel2(const std::string& label) | ||
| 140 | { | ||
| 141 | m_interface->kodi_gui->control_button->set_label2(m_interface->kodiBase, m_controlHandle, | ||
| 142 | label.c_str()); | ||
| 143 | } | ||
| 144 | //-------------------------------------------------------------------------- | ||
| 145 | |||
| 146 | //========================================================================== | ||
| 147 | /// | ||
| 148 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 149 | /// @brief Get the second label if present | ||
| 150 | /// | ||
| 151 | /// @return Second label | ||
| 152 | /// | ||
| 153 | std::string GetLabel2() const | ||
| 154 | { | ||
| 155 | std::string label; | ||
| 156 | char* ret = | ||
| 157 | m_interface->kodi_gui->control_button->get_label2(m_interface->kodiBase, m_controlHandle); | ||
| 158 | if (ret != nullptr) | ||
| 159 | { | ||
| 160 | if (std::strlen(ret)) | ||
| 161 | label = ret; | ||
| 162 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 163 | } | ||
| 164 | return label; | ||
| 165 | } | ||
| 166 | //-------------------------------------------------------------------------- | ||
| 167 | }; | ||
| 168 | |||
| 169 | } /* namespace controls */ | ||
| 170 | } /* namespace gui */ | ||
| 171 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt deleted file mode 100644 index c7cc1dd..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | set(HEADERS Button.h | ||
| 2 | Edit.h | ||
| 3 | FadeLabel.h | ||
| 4 | Image.h | ||
| 5 | Label.h | ||
| 6 | Progress.h | ||
| 7 | RadioButton.h | ||
| 8 | Rendering.h | ||
| 9 | SettingsSlider.h | ||
| 10 | Slider.h | ||
| 11 | Spin.h | ||
| 12 | TextBox.h) | ||
| 13 | |||
| 14 | if(NOT ENABLE_STATIC_LIBS) | ||
| 15 | core_add_library(addons_kodi-addon-dev-kit_include_kodi_gui_controls) | ||
| 16 | endif() | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h deleted file mode 100644 index 99c01de..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h +++ /dev/null | |||
| @@ -1,275 +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_CEdit Control Edit | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CEdit } | ||
| 26 | /// **Editable window text control used as an input control for the osd keyboard | ||
| 27 | /// and other input fields** | ||
| 28 | /// | ||
| 29 | /// The edit control allows a user to input text in Kodi. You can choose the | ||
| 30 | /// font, size, colour, location and header of the text to be displayed. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Edit.h "#include <kodi/gui/controls/Edit.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref skin_Edit_control | ||
| 36 | /// "edit control". | ||
| 37 | /// | ||
| 38 | /// @note The call of the control is only possible from the corresponding | ||
| 39 | /// window as its class and identification number is required. | ||
| 40 | /// | ||
| 41 | |||
| 42 | //============================================================================ | ||
| 43 | // see gui/definition.h for use of group "cpp_kodi_gui_controls_CEdit_Defs" | ||
| 44 | /// | ||
| 45 | /// \defgroup cpp_kodi_gui_controls_CEdit_Defs Definitions, structures and enumerators | ||
| 46 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 47 | /// @brief **Library definition values** | ||
| 48 | /// | ||
| 49 | |||
| 50 | } /* namespace controls */ | ||
| 51 | } /* namespace gui */ | ||
| 52 | } /* namespace kodi */ | ||
| 53 | |||
| 54 | //============================================================================ | ||
| 55 | /// | ||
| 56 | /// \ingroup cpp_kodi_gui_controls_CEdit_Defs | ||
| 57 | /// @{ | ||
| 58 | /// @anchor AddonGUIInputType | ||
| 59 | /// @brief Text input types used on kodi::gui::controls::CEdit | ||
| 60 | enum AddonGUIInputType | ||
| 61 | { | ||
| 62 | /// Text inside edit control only readable | ||
| 63 | ADDON_INPUT_TYPE_READONLY = -1, | ||
| 64 | /// Normal text entries | ||
| 65 | ADDON_INPUT_TYPE_TEXT = 0, | ||
| 66 | /// To use on edit control only numeric numbers | ||
| 67 | ADDON_INPUT_TYPE_NUMBER, | ||
| 68 | /// To insert seconds | ||
| 69 | ADDON_INPUT_TYPE_SECONDS, | ||
| 70 | /// To insert time | ||
| 71 | ADDON_INPUT_TYPE_TIME, | ||
| 72 | /// To insert a date | ||
| 73 | ADDON_INPUT_TYPE_DATE, | ||
| 74 | /// Used for write in IP addresses | ||
| 75 | ADDON_INPUT_TYPE_IPADDRESS, | ||
| 76 | /// Text field used as password entry field with not visible text | ||
| 77 | ADDON_INPUT_TYPE_PASSWORD, | ||
| 78 | /// Text field used as password entry field with not visible text but | ||
| 79 | /// returned as MD5 value | ||
| 80 | ADDON_INPUT_TYPE_PASSWORD_MD5, | ||
| 81 | /// Use text field for search purpose | ||
| 82 | ADDON_INPUT_TYPE_SEARCH, | ||
| 83 | /// Text field as filter | ||
| 84 | ADDON_INPUT_TYPE_FILTER, | ||
| 85 | /// | ||
| 86 | ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW | ||
| 87 | }; | ||
| 88 | /// @} | ||
| 89 | //---------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | namespace kodi | ||
| 92 | { | ||
| 93 | namespace gui | ||
| 94 | { | ||
| 95 | namespace controls | ||
| 96 | { | ||
| 97 | |||
| 98 | class ATTRIBUTE_HIDDEN CEdit : public CAddonGUIControlBase | ||
| 99 | { | ||
| 100 | public: | ||
| 101 | //========================================================================== | ||
| 102 | /// | ||
| 103 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 104 | /// @brief Construct a new control | ||
| 105 | /// | ||
| 106 | /// @param[in] window related window control class | ||
| 107 | /// @param[in] controlId Used skin xml control id | ||
| 108 | /// | ||
| 109 | CEdit(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 110 | { | ||
| 111 | m_controlHandle = m_interface->kodi_gui->window->get_control_edit( | ||
| 112 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 113 | if (!m_controlHandle) | ||
| 114 | kodi::Log(ADDON_LOG_FATAL, | ||
| 115 | "kodi::gui::control::CEdit can't create control class from Kodi !!!"); | ||
| 116 | } | ||
| 117 | //-------------------------------------------------------------------------- | ||
| 118 | |||
| 119 | //========================================================================== | ||
| 120 | /// | ||
| 121 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 122 | /// @brief Destructor | ||
| 123 | /// | ||
| 124 | ~CEdit() override = default; | ||
| 125 | //-------------------------------------------------------------------------- | ||
| 126 | |||
| 127 | //========================================================================== | ||
| 128 | /// | ||
| 129 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 130 | /// @brief Set the control on window to visible | ||
| 131 | /// | ||
| 132 | /// @param[in] visible If true visible, otherwise hidden | ||
| 133 | /// | ||
| 134 | void SetVisible(bool visible) | ||
| 135 | { | ||
| 136 | m_interface->kodi_gui->control_edit->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 137 | visible); | ||
| 138 | } | ||
| 139 | //-------------------------------------------------------------------------- | ||
| 140 | |||
| 141 | //========================================================================== | ||
| 142 | /// | ||
| 143 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 144 | /// @brief Set's the control's enabled/disabled state | ||
| 145 | /// | ||
| 146 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 147 | /// | ||
| 148 | void SetEnabled(bool enabled) | ||
| 149 | { | ||
| 150 | m_interface->kodi_gui->control_edit->set_enabled(m_interface->kodiBase, m_controlHandle, | ||
| 151 | enabled); | ||
| 152 | } | ||
| 153 | //-------------------------------------------------------------------------- | ||
| 154 | |||
| 155 | //========================================================================== | ||
| 156 | /// | ||
| 157 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 158 | /// @brief To set the text string on edit control | ||
| 159 | /// | ||
| 160 | /// @param[in] label Text to show | ||
| 161 | /// | ||
| 162 | void SetLabel(const std::string& label) | ||
| 163 | { | ||
| 164 | m_interface->kodi_gui->control_edit->set_label(m_interface->kodiBase, m_controlHandle, | ||
| 165 | label.c_str()); | ||
| 166 | } | ||
| 167 | //-------------------------------------------------------------------------- | ||
| 168 | |||
| 169 | //========================================================================== | ||
| 170 | /// | ||
| 171 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 172 | /// @brief Returns the text heading for this edit control. | ||
| 173 | /// | ||
| 174 | /// @return Heading text | ||
| 175 | /// | ||
| 176 | std::string GetLabel() const | ||
| 177 | { | ||
| 178 | std::string label; | ||
| 179 | char* ret = | ||
| 180 | m_interface->kodi_gui->control_edit->get_label(m_interface->kodiBase, m_controlHandle); | ||
| 181 | if (ret != nullptr) | ||
| 182 | { | ||
| 183 | if (std::strlen(ret)) | ||
| 184 | label = ret; | ||
| 185 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 186 | } | ||
| 187 | return label; | ||
| 188 | } | ||
| 189 | //-------------------------------------------------------------------------- | ||
| 190 | |||
| 191 | //========================================================================== | ||
| 192 | /// | ||
| 193 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 194 | /// @brief Set's text heading for this edit control. | ||
| 195 | /// | ||
| 196 | /// @param[in] text string or unicode - text string. | ||
| 197 | /// | ||
| 198 | void SetText(const std::string& text) | ||
| 199 | { | ||
| 200 | m_interface->kodi_gui->control_edit->set_text(m_interface->kodiBase, m_controlHandle, | ||
| 201 | text.c_str()); | ||
| 202 | } | ||
| 203 | //-------------------------------------------------------------------------- | ||
| 204 | |||
| 205 | //========================================================================== | ||
| 206 | /// | ||
| 207 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 208 | /// @brief Returns the text value for this edit control. | ||
| 209 | /// | ||
| 210 | /// @return Text value of control | ||
| 211 | /// | ||
| 212 | std::string GetText() const | ||
| 213 | { | ||
| 214 | std::string text; | ||
| 215 | char* ret = | ||
| 216 | m_interface->kodi_gui->control_edit->get_text(m_interface->kodiBase, m_controlHandle); | ||
| 217 | if (ret != nullptr) | ||
| 218 | { | ||
| 219 | if (std::strlen(ret)) | ||
| 220 | text = ret; | ||
| 221 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 222 | } | ||
| 223 | return text; | ||
| 224 | } | ||
| 225 | //-------------------------------------------------------------------------- | ||
| 226 | |||
| 227 | //========================================================================== | ||
| 228 | /// | ||
| 229 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 230 | /// @brief Set the cursor position on text. | ||
| 231 | /// | ||
| 232 | /// @param[in] iPosition The position to set | ||
| 233 | /// | ||
| 234 | void SetCursorPosition(unsigned int iPosition) | ||
| 235 | { | ||
| 236 | m_interface->kodi_gui->control_edit->set_cursor_position(m_interface->kodiBase, m_controlHandle, | ||
| 237 | iPosition); | ||
| 238 | } | ||
| 239 | //-------------------------------------------------------------------------- | ||
| 240 | |||
| 241 | //========================================================================== | ||
| 242 | /// | ||
| 243 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 244 | /// @brief To get current cursor position on text field | ||
| 245 | /// | ||
| 246 | /// @return The current cursor position | ||
| 247 | /// | ||
| 248 | unsigned int GetCursorPosition() | ||
| 249 | { | ||
| 250 | return m_interface->kodi_gui->control_edit->get_cursor_position(m_interface->kodiBase, | ||
| 251 | m_controlHandle); | ||
| 252 | } | ||
| 253 | //-------------------------------------------------------------------------- | ||
| 254 | |||
| 255 | //========================================================================== | ||
| 256 | /// | ||
| 257 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 258 | /// @brief To set field input type which are defined on \ref AddonGUIInputType | ||
| 259 | /// | ||
| 260 | /// @param[in] type The \ref AddonGUIInputType "Add-on input type" | ||
| 261 | /// to use | ||
| 262 | /// @param[in] heading The heading text for related keyboard | ||
| 263 | /// dialog | ||
| 264 | /// | ||
| 265 | void SetInputType(AddonGUIInputType type, const std::string& heading) | ||
| 266 | { | ||
| 267 | m_interface->kodi_gui->control_edit->set_input_type(m_interface->kodiBase, m_controlHandle, | ||
| 268 | static_cast<int>(type), heading.c_str()); | ||
| 269 | } | ||
| 270 | //-------------------------------------------------------------------------- | ||
| 271 | }; | ||
| 272 | |||
| 273 | } /* namespace controls */ | ||
| 274 | } /* namespace gui */ | ||
| 275 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h deleted file mode 100644 index 02c843f..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/FadeLabel.h +++ /dev/null | |||
| @@ -1,153 +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_CFadeLabel Control Fade Label | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CFadeLabel } | ||
| 26 | /// **Window control used to show multiple pieces of text in the same position, | ||
| 27 | /// by fading from one to the other** | ||
| 28 | /// | ||
| 29 | /// The fade label control is used for displaying multiple pieces of text in | ||
| 30 | /// the same space in Kodi. You can choose the font, size, colour, location | ||
| 31 | /// and contents of the text to be displayed. The first piece of information | ||
| 32 | /// to display fades in over 50 frames, then scrolls off to the left. Once it | ||
| 33 | /// is finished scrolling off screen, the second piece of information fades | ||
| 34 | /// in and the process repeats. A fade label control is not supported in a | ||
| 35 | /// list container. | ||
| 36 | /// | ||
| 37 | /// It has the header \ref FadeLabel.h "#include <kodi/gui/controls/FadeLabel.h>" | ||
| 38 | /// be included to enjoy it. | ||
| 39 | /// | ||
| 40 | /// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control" | ||
| 41 | /// | ||
| 42 | /// @note The call of the control is only possible from the corresponding | ||
| 43 | /// window as its class and identification number is required. | ||
| 44 | /// | ||
| 45 | class ATTRIBUTE_HIDDEN CFadeLabel : public CAddonGUIControlBase | ||
| 46 | { | ||
| 47 | public: | ||
| 48 | //========================================================================== | ||
| 49 | /// | ||
| 50 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 51 | /// @brief Construct a new control. | ||
| 52 | /// | ||
| 53 | /// @param[in] window related window control class | ||
| 54 | /// @param[in] controlId Used skin xml control id | ||
| 55 | /// | ||
| 56 | CFadeLabel(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 57 | { | ||
| 58 | m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label( | ||
| 59 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 60 | if (!m_controlHandle) | ||
| 61 | kodi::Log(ADDON_LOG_FATAL, | ||
| 62 | "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!"); | ||
| 63 | } | ||
| 64 | //-------------------------------------------------------------------------- | ||
| 65 | |||
| 66 | //========================================================================== | ||
| 67 | /// | ||
| 68 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 69 | /// @brief Destructor. | ||
| 70 | /// | ||
| 71 | ~CFadeLabel() override = default; | ||
| 72 | //-------------------------------------------------------------------------- | ||
| 73 | |||
| 74 | //========================================================================== | ||
| 75 | /// | ||
| 76 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 77 | /// @brief Set the control on window to visible. | ||
| 78 | /// | ||
| 79 | /// @param[in] visible If true visible, otherwise hidden | ||
| 80 | /// | ||
| 81 | void SetVisible(bool visible) | ||
| 82 | { | ||
| 83 | m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 84 | visible); | ||
| 85 | } | ||
| 86 | //-------------------------------------------------------------------------- | ||
| 87 | |||
| 88 | //========================================================================== | ||
| 89 | /// | ||
| 90 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 91 | /// @brief To add additional text string on fade label. | ||
| 92 | /// | ||
| 93 | /// @param[in] label Text to show | ||
| 94 | /// | ||
| 95 | void AddLabel(const std::string& label) | ||
| 96 | { | ||
| 97 | m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle, | ||
| 98 | label.c_str()); | ||
| 99 | } | ||
| 100 | //-------------------------------------------------------------------------- | ||
| 101 | |||
| 102 | //========================================================================== | ||
| 103 | /// | ||
| 104 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 105 | /// @brief Get the used text from button | ||
| 106 | /// | ||
| 107 | /// @return Text shown | ||
| 108 | /// | ||
| 109 | std::string GetLabel() const | ||
| 110 | { | ||
| 111 | std::string label; | ||
| 112 | char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase, | ||
| 113 | m_controlHandle); | ||
| 114 | if (ret != nullptr) | ||
| 115 | { | ||
| 116 | if (std::strlen(ret)) | ||
| 117 | label = ret; | ||
| 118 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 119 | } | ||
| 120 | return label; | ||
| 121 | } | ||
| 122 | //-------------------------------------------------------------------------- | ||
| 123 | |||
| 124 | //========================================================================== | ||
| 125 | /// | ||
| 126 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 127 | /// @brief To enable or disable scrolling on fade label | ||
| 128 | /// | ||
| 129 | /// @param[in] scroll To enable scrolling set to true, otherwise is | ||
| 130 | /// disabled | ||
| 131 | /// | ||
| 132 | void SetScrolling(bool scroll) | ||
| 133 | { | ||
| 134 | m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle, | ||
| 135 | scroll); | ||
| 136 | } | ||
| 137 | //-------------------------------------------------------------------------- | ||
| 138 | |||
| 139 | //========================================================================== | ||
| 140 | /// | ||
| 141 | /// \ingroup cpp_kodi_gui_controls_CFadeLabel | ||
| 142 | /// @brief To reset al inserted labels. | ||
| 143 | /// | ||
| 144 | void Reset() | ||
| 145 | { | ||
| 146 | m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle); | ||
| 147 | } | ||
| 148 | //-------------------------------------------------------------------------- | ||
| 149 | }; | ||
| 150 | |||
| 151 | } /* namespace controls */ | ||
| 152 | } /* namespace gui */ | ||
| 153 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h deleted file mode 100644 index b4d092f..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h +++ /dev/null | |||
| @@ -1,116 +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_CImage Control Image | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CImage } | ||
| 26 | /// **Window control used to show an image.** | ||
| 27 | /// | ||
| 28 | /// The image control is used for displaying images in Kodi. You can choose | ||
| 29 | /// the position, size, transparency and contents of the image to be displayed. | ||
| 30 | /// | ||
| 31 | /// It has the header \ref Image.h "#include <kodi/gui/controls/Image.h>" | ||
| 32 | /// be included to enjoy it. | ||
| 33 | /// | ||
| 34 | /// Here you find the needed skin part for a \ref Image_Control "image 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 | /// | ||
| 39 | class ATTRIBUTE_HIDDEN CImage : public CAddonGUIControlBase | ||
| 40 | { | ||
| 41 | public: | ||
| 42 | //========================================================================== | ||
| 43 | /// | ||
| 44 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 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 | CImage(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 51 | { | ||
| 52 | m_controlHandle = m_interface->kodi_gui->window->get_control_image( | ||
| 53 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 54 | if (!m_controlHandle) | ||
| 55 | kodi::Log(ADDON_LOG_FATAL, | ||
| 56 | "kodi::gui::controls::CImage can't create control class from Kodi !!!"); | ||
| 57 | } | ||
| 58 | //-------------------------------------------------------------------------- | ||
| 59 | |||
| 60 | //========================================================================== | ||
| 61 | /// | ||
| 62 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 63 | /// @brief Destructor | ||
| 64 | /// | ||
| 65 | ~CImage() override = default; | ||
| 66 | //-------------------------------------------------------------------------- | ||
| 67 | |||
| 68 | //========================================================================== | ||
| 69 | /// | ||
| 70 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 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_image->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 78 | visible); | ||
| 79 | } | ||
| 80 | //-------------------------------------------------------------------------- | ||
| 81 | |||
| 82 | //========================================================================== | ||
| 83 | /// | ||
| 84 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 85 | /// @brief To set the filename used on image control. | ||
| 86 | /// | ||
| 87 | /// @param[in] filename Image file to use | ||
| 88 | /// @param[in] useCache To define storage of image, default is | ||
| 89 | /// in cache, if false becomes it loaded | ||
| 90 | /// always on changes again | ||
| 91 | /// | ||
| 92 | void SetFileName(const std::string& filename, bool useCache = true) | ||
| 93 | { | ||
| 94 | m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, | ||
| 95 | filename.c_str(), useCache); | ||
| 96 | } | ||
| 97 | //-------------------------------------------------------------------------- | ||
| 98 | |||
| 99 | //========================================================================== | ||
| 100 | /// | ||
| 101 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 102 | /// @brief To set set the diffuse color on image. | ||
| 103 | /// | ||
| 104 | /// @param[in] colorDiffuse Color to use for diffuse | ||
| 105 | /// | ||
| 106 | void SetColorDiffuse(uint32_t colorDiffuse) | ||
| 107 | { | ||
| 108 | m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, | ||
| 109 | colorDiffuse); | ||
| 110 | } | ||
| 111 | //-------------------------------------------------------------------------- | ||
| 112 | }; | ||
| 113 | |||
| 114 | } /* namespace controls */ | ||
| 115 | } /* namespace gui */ | ||
| 116 | } /* namespace kodi */ | ||
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 | |||
| 14 | namespace kodi | ||
| 15 | { | ||
| 16 | namespace gui | ||
| 17 | { | ||
| 18 | namespace 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 | /// | ||
| 39 | class ATTRIBUTE_HIDDEN CLabel : public CAddonGUIControlBase | ||
| 40 | { | ||
| 41 | public: | ||
| 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 */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h deleted file mode 100644 index 8cb582b..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h +++ /dev/null | |||
| @@ -1,114 +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_CProgress Control Progress | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CProgress } | ||
| 26 | /// **Window control to show the progress of a particular operation** | ||
| 27 | /// | ||
| 28 | /// The progress control is used to show the progress of an item that may take | ||
| 29 | /// a long time, or to show how far through a movie you are. You can choose | ||
| 30 | /// the position, size, and look of the progress control. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Progress.h "#include <kodi/gui/controls/Progress.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref Progress_Control "progress 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 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CProgress : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | //========================================================================== | ||
| 44 | /// | ||
| 45 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 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 | CProgress(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 52 | { | ||
| 53 | m_controlHandle = m_interface->kodi_gui->window->get_control_progress( | ||
| 54 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, | ||
| 57 | "kodi::gui::controls::CProgress can't create control class from Kodi !!!"); | ||
| 58 | } | ||
| 59 | //-------------------------------------------------------------------------- | ||
| 60 | |||
| 61 | //========================================================================== | ||
| 62 | /// | ||
| 63 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 64 | /// @brief Destructor | ||
| 65 | /// | ||
| 66 | ~CProgress() override = default; | ||
| 67 | //-------------------------------------------------------------------------- | ||
| 68 | |||
| 69 | //========================================================================== | ||
| 70 | /// | ||
| 71 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 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_progress->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 79 | visible); | ||
| 80 | } | ||
| 81 | //-------------------------------------------------------------------------- | ||
| 82 | |||
| 83 | //========================================================================== | ||
| 84 | /// | ||
| 85 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 86 | /// @brief To set Percent position of control | ||
| 87 | /// | ||
| 88 | /// @param[in] percent The percent position to use | ||
| 89 | /// | ||
| 90 | void SetPercentage(float percent) | ||
| 91 | { | ||
| 92 | m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, | ||
| 93 | percent); | ||
| 94 | } | ||
| 95 | //-------------------------------------------------------------------------- | ||
| 96 | |||
| 97 | //========================================================================== | ||
| 98 | /// | ||
| 99 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 100 | /// @brief Get the active percent position of progress bar | ||
| 101 | /// | ||
| 102 | /// @return Progress position as percent | ||
| 103 | /// | ||
| 104 | float GetPercentage() const | ||
| 105 | { | ||
| 106 | return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, | ||
| 107 | m_controlHandle); | ||
| 108 | } | ||
| 109 | //-------------------------------------------------------------------------- | ||
| 110 | }; | ||
| 111 | |||
| 112 | } /* namespace controls */ | ||
| 113 | } /* namespace gui */ | ||
| 114 | } /* namespace kodi */ | ||
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 | |||
| 14 | namespace kodi | ||
| 15 | { | ||
| 16 | namespace gui | ||
| 17 | { | ||
| 18 | namespace 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 | /// | ||
| 42 | class ATTRIBUTE_HIDDEN CRadioButton : public CAddonGUIControlBase | ||
| 43 | { | ||
| 44 | public: | ||
| 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 */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h deleted file mode 100644 index 7cc9b24..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Rendering.h +++ /dev/null | |||
| @@ -1,205 +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 | #include "../renderHelper.h" | ||
| 14 | |||
| 15 | namespace kodi | ||
| 16 | { | ||
| 17 | namespace gui | ||
| 18 | { | ||
| 19 | namespace controls | ||
| 20 | { | ||
| 21 | |||
| 22 | //============================================================================ | ||
| 23 | /// | ||
| 24 | /// \defgroup cpp_kodi_gui_controls_CRendering Control Rendering | ||
| 25 | /// \ingroup cpp_kodi_gui | ||
| 26 | /// @brief \cpp_class{ kodi::gui::controls::CRendering } | ||
| 27 | /// **Window control for rendering own parts** | ||
| 28 | /// | ||
| 29 | /// This rendering control is used when own parts are needed. You have the | ||
| 30 | /// control over them to render direct OpenGL or DirectX content to the | ||
| 31 | /// screen set by the size of them. | ||
| 32 | /// | ||
| 33 | /// Alternative can be the virtual functions from t his been ignored if the | ||
| 34 | /// callbacks are defined by the \ref CRendering_SetIndependentCallbacks function and | ||
| 35 | /// class is used as single and not as a parent class. | ||
| 36 | /// | ||
| 37 | /// It has the header \ref Rendering.h "#include <kodi/gui/controls/Rendering.h>" | ||
| 38 | /// be included to enjoy it. | ||
| 39 | /// | ||
| 40 | /// Here you find the needed skin part for a \ref Addon_Rendering_control "rendering control" | ||
| 41 | /// | ||
| 42 | /// @note The call of the control is only possible from the corresponding | ||
| 43 | /// window as its class and identification number is required. | ||
| 44 | /// | ||
| 45 | |||
| 46 | //============================================================================ | ||
| 47 | /// | ||
| 48 | /// \defgroup cpp_kodi_gui_controls_CRendering_Defs Definitions, structures and enumerators | ||
| 49 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 50 | /// @brief **Library definition values** | ||
| 51 | /// | ||
| 52 | |||
| 53 | class ATTRIBUTE_HIDDEN CRendering : public CAddonGUIControlBase | ||
| 54 | { | ||
| 55 | public: | ||
| 56 | //========================================================================== | ||
| 57 | /// | ||
| 58 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 59 | /// @brief Construct a new control | ||
| 60 | /// | ||
| 61 | /// @param[in] window related window control class | ||
| 62 | /// @param[in] controlId Used skin xml control id | ||
| 63 | /// | ||
| 64 | CRendering(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 65 | { | ||
| 66 | m_controlHandle = m_interface->kodi_gui->window->get_control_render_addon( | ||
| 67 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 68 | if (m_controlHandle) | ||
| 69 | m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, | ||
| 70 | m_controlHandle, this, OnCreateCB, | ||
| 71 | OnRenderCB, OnStopCB, OnDirtyCB); | ||
| 72 | else | ||
| 73 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::%s can't create control class from Kodi !!!", | ||
| 74 | __FUNCTION__); | ||
| 75 | } | ||
| 76 | //-------------------------------------------------------------------------- | ||
| 77 | |||
| 78 | //========================================================================== | ||
| 79 | /// | ||
| 80 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 81 | /// @brief Destructor | ||
| 82 | /// | ||
| 83 | ~CRendering() override | ||
| 84 | { | ||
| 85 | m_interface->kodi_gui->control_rendering->destroy(m_interface->kodiBase, m_controlHandle); | ||
| 86 | } | ||
| 87 | //-------------------------------------------------------------------------- | ||
| 88 | |||
| 89 | //========================================================================== | ||
| 90 | /// | ||
| 91 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 92 | /// @brief To create rendering control on Add-on | ||
| 93 | /// | ||
| 94 | /// Function creates the needed rendering control for Kodi which becomes | ||
| 95 | /// handled and processed from Add-on | ||
| 96 | /// | ||
| 97 | /// @note This is callback function from Kodi to Add-on and not to use | ||
| 98 | /// for calls from add-on to this function. | ||
| 99 | /// | ||
| 100 | /// @param[in] x Horizontal position | ||
| 101 | /// @param[in] y Vertical position | ||
| 102 | /// @param[in] w Width of control | ||
| 103 | /// @param[in] h Height of control | ||
| 104 | /// @param[in] device The device to use. For OpenGL is empty | ||
| 105 | /// on Direct X is the needed device send. | ||
| 106 | /// @return Add-on needs to return true if successed, | ||
| 107 | /// otherwise false. | ||
| 108 | /// | ||
| 109 | virtual bool Create(int x, int y, int w, int h, void* device) { return false; } | ||
| 110 | //-------------------------------------------------------------------------- | ||
| 111 | |||
| 112 | //========================================================================== | ||
| 113 | /// | ||
| 114 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 115 | /// @brief Render process call from Kodi | ||
| 116 | /// | ||
| 117 | /// @note This is callback function from Kodi to Add-on and not to use | ||
| 118 | /// for calls from add-on to this function. | ||
| 119 | /// | ||
| 120 | virtual void Render() {} | ||
| 121 | //-------------------------------------------------------------------------- | ||
| 122 | |||
| 123 | //========================================================================== | ||
| 124 | /// | ||
| 125 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 126 | /// @brief Call from Kodi to stop rendering process | ||
| 127 | /// | ||
| 128 | /// @note This is callback function from Kodi to Add-on and not to use | ||
| 129 | /// for calls from add-on to this function. | ||
| 130 | /// | ||
| 131 | virtual void Stop() {} | ||
| 132 | //-------------------------------------------------------------------------- | ||
| 133 | |||
| 134 | //========================================================================== | ||
| 135 | /// | ||
| 136 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 137 | /// @brief Call from Kodi where add-on becomes asked about dirty rendering | ||
| 138 | /// region. | ||
| 139 | /// | ||
| 140 | /// @note This is callback function from Kodi to Add-on and not to use | ||
| 141 | /// for calls from add-on to this function. | ||
| 142 | /// | ||
| 143 | virtual bool Dirty() { return false; } | ||
| 144 | //-------------------------------------------------------------------------- | ||
| 145 | |||
| 146 | //========================================================================== | ||
| 147 | /// | ||
| 148 | /// \ingroup cpp_kodi_gui_controls_CRendering | ||
| 149 | /// \anchor CRendering_SetIndependentCallbacks | ||
| 150 | /// @brief If the class is used independent (with "new CRendering") | ||
| 151 | /// and not as parent (with "cCLASS_own : CRendering") from own must | ||
| 152 | /// be the callback from Kodi to add-on overdriven with own functions! | ||
| 153 | /// | ||
| 154 | void SetIndependentCallbacks( | ||
| 155 | GUIHANDLE cbhdl, | ||
| 156 | bool (*CBCreate)(GUIHANDLE cbhdl, int x, int y, int w, int h, void* device), | ||
| 157 | void (*CBRender)(GUIHANDLE cbhdl), | ||
| 158 | void (*CBStop)(GUIHANDLE cbhdl), | ||
| 159 | bool (*CBDirty)(GUIHANDLE cbhdl)) | ||
| 160 | { | ||
| 161 | if (!cbhdl || !CBCreate || !CBRender || !CBStop || !CBDirty) | ||
| 162 | { | ||
| 163 | kodi::Log(ADDON_LOG_ERROR, "kodi::gui::controls::%s called with nullptr !!!", __FUNCTION__); | ||
| 164 | return; | ||
| 165 | } | ||
| 166 | |||
| 167 | m_interface->kodi_gui->control_rendering->set_callbacks( | ||
| 168 | m_interface->kodiBase, m_controlHandle, cbhdl, CBCreate, CBRender, CBStop, CBDirty); | ||
| 169 | } | ||
| 170 | //-------------------------------------------------------------------------- | ||
| 171 | |||
| 172 | private: | ||
| 173 | /* | ||
| 174 | * Defined callback functions from Kodi to add-on, for use in parent / child system | ||
| 175 | * (is private)! | ||
| 176 | */ | ||
| 177 | static bool OnCreateCB(void* cbhdl, int x, int y, int w, int h, void* device) | ||
| 178 | { | ||
| 179 | static_cast<CRendering*>(cbhdl)->m_renderHelper = kodi::gui::GetRenderHelper(); | ||
| 180 | return static_cast<CRendering*>(cbhdl)->Create(x, y, w, h, device); | ||
| 181 | } | ||
| 182 | |||
| 183 | static void OnRenderCB(void* cbhdl) | ||
| 184 | { | ||
| 185 | if (!static_cast<CRendering*>(cbhdl)->m_renderHelper) | ||
| 186 | return; | ||
| 187 | static_cast<CRendering*>(cbhdl)->m_renderHelper->Begin(); | ||
| 188 | static_cast<CRendering*>(cbhdl)->Render(); | ||
| 189 | static_cast<CRendering*>(cbhdl)->m_renderHelper->End(); | ||
| 190 | } | ||
| 191 | |||
| 192 | static void OnStopCB(void* cbhdl) | ||
| 193 | { | ||
| 194 | static_cast<CRendering*>(cbhdl)->Stop(); | ||
| 195 | static_cast<CRendering*>(cbhdl)->m_renderHelper = nullptr; | ||
| 196 | } | ||
| 197 | |||
| 198 | static bool OnDirtyCB(void* cbhdl) { return static_cast<CRendering*>(cbhdl)->Dirty(); } | ||
| 199 | |||
| 200 | std::shared_ptr<kodi::gui::IRenderHelper> m_renderHelper; | ||
| 201 | }; | ||
| 202 | |||
| 203 | } /* namespace controls */ | ||
| 204 | } /* namespace gui */ | ||
| 205 | } /* namespace kodi */ | ||
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 */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h deleted file mode 100644 index 715cc7d..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Slider.h +++ /dev/null | |||
| @@ -1,339 +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_CSlider Control Slider | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CSlider } | ||
| 26 | /// **Window control for moveable slider** | ||
| 27 | /// | ||
| 28 | /// The slider control is used for things where a sliding bar best represents | ||
| 29 | /// the operation at hand (such as a volume control or seek control). You can | ||
| 30 | /// choose the position, size, and look of the slider control. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Slider.h "#include <kodi/gui/controls/Slider.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref Slider_Control "slider 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 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CSlider : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | //========================================================================== | ||
| 44 | /// | ||
| 45 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 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 | CSlider(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 52 | { | ||
| 53 | m_controlHandle = m_interface->kodi_gui->window->get_control_slider( | ||
| 54 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, | ||
| 57 | "kodi::gui::controls::CSlider can't create control class from Kodi !!!"); | ||
| 58 | } | ||
| 59 | //-------------------------------------------------------------------------- | ||
| 60 | |||
| 61 | //========================================================================== | ||
| 62 | /// | ||
| 63 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 64 | /// @brief Destructor | ||
| 65 | /// | ||
| 66 | ~CSlider() override = default; | ||
| 67 | //-------------------------------------------------------------------------- | ||
| 68 | |||
| 69 | //========================================================================== | ||
| 70 | /// | ||
| 71 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 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_slider->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 79 | visible); | ||
| 80 | } | ||
| 81 | //-------------------------------------------------------------------------- | ||
| 82 | |||
| 83 | //========================================================================== | ||
| 84 | /// | ||
| 85 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 86 | /// @brief Set's the control's enabled/disabled state | ||
| 87 | /// | ||
| 88 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 89 | /// | ||
| 90 | void SetEnabled(bool enabled) | ||
| 91 | { | ||
| 92 | m_interface->kodi_gui->control_slider->set_enabled(m_interface->kodiBase, m_controlHandle, | ||
| 93 | enabled); | ||
| 94 | } | ||
| 95 | //-------------------------------------------------------------------------- | ||
| 96 | |||
| 97 | //========================================================================== | ||
| 98 | /// | ||
| 99 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 100 | /// @brief To reset slider on defaults | ||
| 101 | /// | ||
| 102 | void Reset() | ||
| 103 | { | ||
| 104 | m_interface->kodi_gui->control_slider->reset(m_interface->kodiBase, m_controlHandle); | ||
| 105 | } | ||
| 106 | //-------------------------------------------------------------------------- | ||
| 107 | |||
| 108 | //========================================================================== | ||
| 109 | /// | ||
| 110 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 111 | /// @brief With GetDescription becomes a string value of position returned. | ||
| 112 | /// | ||
| 113 | /// @return Text string about current slider position | ||
| 114 | /// | ||
| 115 | /// The following are the text definition returned from this: | ||
| 116 | /// | Value | Without range selection | With range selection | | ||
| 117 | /// |:---------:|:------------------------|:-------------------------------| | ||
| 118 | /// | float | <c>%2.2f</c> | <c>[%2.2f, %2.2f]</c> | | ||
| 119 | /// | integer | <c>%i</c> | <c>[%i, %i]</c> | | ||
| 120 | /// | percent | <c>%i%%</c> | <c>[%i%%, %i%%]</c> | | ||
| 121 | /// | ||
| 122 | std::string GetDescription() const | ||
| 123 | { | ||
| 124 | std::string text; | ||
| 125 | char* ret = m_interface->kodi_gui->control_slider->get_description(m_interface->kodiBase, | ||
| 126 | m_controlHandle); | ||
| 127 | if (ret != nullptr) | ||
| 128 | { | ||
| 129 | if (std::strlen(ret)) | ||
| 130 | text = ret; | ||
| 131 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 132 | } | ||
| 133 | return text; | ||
| 134 | } | ||
| 135 | //-------------------------------------------------------------------------- | ||
| 136 | |||
| 137 | //========================================================================== | ||
| 138 | /// | ||
| 139 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 140 | /// @brief To set the the range as integer of slider, e.g. -10 is the slider | ||
| 141 | /// start and e.g. +10 is the from here defined position where it reach the | ||
| 142 | /// end. | ||
| 143 | /// | ||
| 144 | /// Ad default is the range from 0 to 100. | ||
| 145 | /// | ||
| 146 | /// The integer interval is as default 1 and can be changed with | ||
| 147 | /// @ref SetIntInterval. | ||
| 148 | /// | ||
| 149 | /// @param[in] start Integer start value | ||
| 150 | /// @param[in] end Integer end value | ||
| 151 | /// | ||
| 152 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 153 | /// these different values can be not together and can, therefore, only one | ||
| 154 | /// each can be used. | ||
| 155 | /// | ||
| 156 | void SetIntRange(int start, int end) | ||
| 157 | { | ||
| 158 | m_interface->kodi_gui->control_slider->set_int_range(m_interface->kodiBase, m_controlHandle, | ||
| 159 | start, end); | ||
| 160 | } | ||
| 161 | //-------------------------------------------------------------------------- | ||
| 162 | |||
| 163 | //========================================================================== | ||
| 164 | /// | ||
| 165 | /// \ingroup CSlider | ||
| 166 | /// @brief Set the slider position with the given integer value. The Range | ||
| 167 | /// must be defined with a call from \ref SetIntRange before. | ||
| 168 | /// | ||
| 169 | /// @param[in] value Position in range to set with integer | ||
| 170 | /// | ||
| 171 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 172 | /// these different values can be not together and can, therefore, only one | ||
| 173 | /// each can be used. | ||
| 174 | /// | ||
| 175 | void SetIntValue(int value) | ||
| 176 | { | ||
| 177 | m_interface->kodi_gui->control_slider->set_int_value(m_interface->kodiBase, m_controlHandle, | ||
| 178 | value); | ||
| 179 | } | ||
| 180 | //-------------------------------------------------------------------------- | ||
| 181 | |||
| 182 | //========================================================================== | ||
| 183 | /// | ||
| 184 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 185 | /// @brief To get the current position as integer value. | ||
| 186 | /// | ||
| 187 | /// @return The position as integer | ||
| 188 | /// | ||
| 189 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 190 | /// these different values can be not together and can, therefore, only | ||
| 191 | /// one each can be used. | ||
| 192 | /// | ||
| 193 | int GetIntValue() const | ||
| 194 | { | ||
| 195 | return m_interface->kodi_gui->control_slider->get_int_value(m_interface->kodiBase, | ||
| 196 | m_controlHandle); | ||
| 197 | } | ||
| 198 | //-------------------------------------------------------------------------- | ||
| 199 | |||
| 200 | //========================================================================== | ||
| 201 | /// | ||
| 202 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 203 | /// @brief To set the interval steps of slider, as default is it 1. If it | ||
| 204 | /// becomes changed with this function will a step of the user with the | ||
| 205 | /// value fixed here be executed. | ||
| 206 | /// | ||
| 207 | /// @param[in] interval Intervall step to set. | ||
| 208 | /// | ||
| 209 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 210 | /// these different values can be not together and can, therefore, only one | ||
| 211 | /// each can be used. | ||
| 212 | /// | ||
| 213 | void SetIntInterval(int interval) | ||
| 214 | { | ||
| 215 | m_interface->kodi_gui->control_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, | ||
| 216 | interval); | ||
| 217 | } | ||
| 218 | //-------------------------------------------------------------------------- | ||
| 219 | |||
| 220 | //========================================================================== | ||
| 221 | /// | ||
| 222 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 223 | /// @brief Sets the percent of the slider. | ||
| 224 | /// | ||
| 225 | /// @param[in] percent float - Percent value of slide | ||
| 226 | /// | ||
| 227 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 228 | /// these different values can be not together and can, therefore, only one | ||
| 229 | /// each can be used. | ||
| 230 | /// | ||
| 231 | void SetPercentage(float percent) | ||
| 232 | { | ||
| 233 | m_interface->kodi_gui->control_slider->set_percentage(m_interface->kodiBase, m_controlHandle, | ||
| 234 | percent); | ||
| 235 | } | ||
| 236 | //-------------------------------------------------------------------------- | ||
| 237 | |||
| 238 | //========================================================================== | ||
| 239 | /// | ||
| 240 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 241 | /// @brief Returns a float of the percent of the slider. | ||
| 242 | /// | ||
| 243 | /// @return float - Percent of slider | ||
| 244 | /// | ||
| 245 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 246 | /// these different values can be not together and can, therefore, only one | ||
| 247 | /// each can be used. | ||
| 248 | /// | ||
| 249 | float GetPercentage() const | ||
| 250 | { | ||
| 251 | return m_interface->kodi_gui->control_slider->get_percentage(m_interface->kodiBase, | ||
| 252 | m_controlHandle); | ||
| 253 | } | ||
| 254 | //-------------------------------------------------------------------------- | ||
| 255 | |||
| 256 | //========================================================================== | ||
| 257 | /// | ||
| 258 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 259 | /// @brief To set the the range as float of slider, e.g. -25.0 is the slider | ||
| 260 | /// start and e.g. +25.0 is the from here defined position where it reach | ||
| 261 | /// the end. | ||
| 262 | /// | ||
| 263 | /// As default is the range 0.0 to 1.0. | ||
| 264 | /// | ||
| 265 | /// The float interval is as default 0.1 and can be changed with | ||
| 266 | /// @ref SetFloatInterval. | ||
| 267 | /// | ||
| 268 | /// @param[in] start Integer start value | ||
| 269 | /// @param[in] end Integer end value | ||
| 270 | /// | ||
| 271 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 272 | /// these different values can be not together and can, therefore, only | ||
| 273 | /// one each can be used. | ||
| 274 | /// | ||
| 275 | void SetFloatRange(float start, float end) | ||
| 276 | { | ||
| 277 | m_interface->kodi_gui->control_slider->set_float_range(m_interface->kodiBase, m_controlHandle, | ||
| 278 | start, end); | ||
| 279 | } | ||
| 280 | //-------------------------------------------------------------------------- | ||
| 281 | |||
| 282 | //========================================================================== | ||
| 283 | /// | ||
| 284 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 285 | /// @brief Set the slider position with the given float value. The Range | ||
| 286 | /// can be defined with a call from \ref SetIntRange before, as default it | ||
| 287 | /// is 0.0 to 1.0. | ||
| 288 | /// | ||
| 289 | /// @param[in] value Position in range to set with float | ||
| 290 | /// | ||
| 291 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 292 | /// these different values can be not together and can, therefore, only one | ||
| 293 | /// each can be used. | ||
| 294 | /// | ||
| 295 | void SetFloatValue(float value) | ||
| 296 | { | ||
| 297 | m_interface->kodi_gui->control_slider->set_float_value(m_interface->kodiBase, m_controlHandle, | ||
| 298 | value); | ||
| 299 | } | ||
| 300 | //-------------------------------------------------------------------------- | ||
| 301 | |||
| 302 | //========================================================================== | ||
| 303 | /// | ||
| 304 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 305 | /// @brief To get the current position as float value. | ||
| 306 | /// | ||
| 307 | /// @return The position as float | ||
| 308 | /// | ||
| 309 | float GetFloatValue() const | ||
| 310 | { | ||
| 311 | return m_interface->kodi_gui->control_slider->get_float_value(m_interface->kodiBase, | ||
| 312 | m_controlHandle); | ||
| 313 | } | ||
| 314 | //-------------------------------------------------------------------------- | ||
| 315 | |||
| 316 | //========================================================================== | ||
| 317 | /// | ||
| 318 | /// \ingroup cpp_kodi_gui_controls_CSlider | ||
| 319 | /// @brief To set the interval steps of slider, as default is it 0.1 If it | ||
| 320 | /// becomes changed with this function will a step of the user with the | ||
| 321 | /// value fixed here be executed. | ||
| 322 | /// | ||
| 323 | /// @param[in] interval Intervall step to set. | ||
| 324 | /// | ||
| 325 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 326 | /// these different values can be not together and can, therefore, only | ||
| 327 | /// one each can be used. | ||
| 328 | /// | ||
| 329 | void SetFloatInterval(float interval) | ||
| 330 | { | ||
| 331 | m_interface->kodi_gui->control_slider->set_float_interval(m_interface->kodiBase, | ||
| 332 | m_controlHandle, interval); | ||
| 333 | } | ||
| 334 | //-------------------------------------------------------------------------- | ||
| 335 | }; | ||
| 336 | |||
| 337 | } /* namespace controls */ | ||
| 338 | } /* namespace gui */ | ||
| 339 | } /* namespace kodi */ | ||
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h deleted file mode 100644 index db8d491..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Spin.h +++ /dev/null | |||
| @@ -1,365 +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_CSpin Control Spin | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CSpin } | ||
| 26 | /// **Window control used for cycling up/down controls** | ||
| 27 | /// | ||
| 28 | /// The settings spin control is used in the settings screens for when a list | ||
| 29 | /// of options can be chosen from using up/down arrows. You can choose the | ||
| 30 | /// position, size, and look of the spin control. It is basically a cross | ||
| 31 | /// between the button control and a spin control. It has a label and focus | ||
| 32 | /// and non focus textures, as well as a spin control on the right. | ||
| 33 | /// | ||
| 34 | /// It has the header \ref Spin.h "#include <kodi/gui/controls/Spin.h>" | ||
| 35 | /// be included to enjoy it. | ||
| 36 | /// | ||
| 37 | /// Here you find the needed skin part for a \ref Spin_Control "spin 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 | |||
| 43 | |||
| 44 | //============================================================================ | ||
| 45 | /// | ||
| 46 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 47 | /// @anchor AddonGUISpinControlType | ||
| 48 | /// @brief The values here defines the used value format for steps on | ||
| 49 | /// spin control. | ||
| 50 | /// | ||
| 51 | typedef enum AddonGUISpinControlType | ||
| 52 | { | ||
| 53 | /// One spin step interpreted as integer | ||
| 54 | ADDON_SPIN_CONTROL_TYPE_INT = 1, | ||
| 55 | /// One spin step interpreted as floating point value | ||
| 56 | ADDON_SPIN_CONTROL_TYPE_FLOAT = 2, | ||
| 57 | /// One spin step interpreted as text string | ||
| 58 | ADDON_SPIN_CONTROL_TYPE_TEXT = 3, | ||
| 59 | /// One spin step interpreted as a page change value | ||
| 60 | ADDON_SPIN_CONTROL_TYPE_PAGE = 4 | ||
| 61 | } AddonGUISpinControlType; | ||
| 62 | //---------------------------------------------------------------------------- | ||
| 63 | |||
| 64 | class ATTRIBUTE_HIDDEN CSpin : public CAddonGUIControlBase | ||
| 65 | { | ||
| 66 | public: | ||
| 67 | //========================================================================== | ||
| 68 | /// | ||
| 69 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 70 | /// @brief Construct a new control | ||
| 71 | /// | ||
| 72 | /// @param[in] window related window control class | ||
| 73 | /// @param[in] controlId Used skin xml control id | ||
| 74 | /// | ||
| 75 | CSpin(CWindow* window, int controlId) | ||
| 76 | : CAddonGUIControlBase(window) | ||
| 77 | { | ||
| 78 | m_controlHandle = m_interface->kodi_gui->window->get_control_spin(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 79 | if (!m_controlHandle) | ||
| 80 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSpin can't create control class from Kodi !!!"); | ||
| 81 | } | ||
| 82 | //-------------------------------------------------------------------------- | ||
| 83 | |||
| 84 | //========================================================================== | ||
| 85 | /// | ||
| 86 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 87 | /// @brief Destructor | ||
| 88 | /// | ||
| 89 | ~CSpin() override = default; | ||
| 90 | //-------------------------------------------------------------------------- | ||
| 91 | |||
| 92 | //========================================================================== | ||
| 93 | /// | ||
| 94 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 95 | /// @brief Set the control on window to visible | ||
| 96 | /// | ||
| 97 | /// @param[in] visible If true visible, otherwise hidden | ||
| 98 | /// | ||
| 99 | void SetVisible(bool visible) | ||
| 100 | { | ||
| 101 | m_interface->kodi_gui->control_spin->set_visible(m_interface->kodiBase, m_controlHandle, visible); | ||
| 102 | } | ||
| 103 | //-------------------------------------------------------------------------- | ||
| 104 | |||
| 105 | //========================================================================== | ||
| 106 | /// | ||
| 107 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 108 | /// @brief Set's the control's enabled/disabled state | ||
| 109 | /// | ||
| 110 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 111 | /// | ||
| 112 | void SetEnabled(bool enabled) | ||
| 113 | { | ||
| 114 | m_interface->kodi_gui->control_spin->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); | ||
| 115 | } | ||
| 116 | //-------------------------------------------------------------------------- | ||
| 117 | |||
| 118 | //========================================================================== | ||
| 119 | /// | ||
| 120 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 121 | /// @brief To set the text string on spin control | ||
| 122 | /// | ||
| 123 | /// @param[in] text Text to show as name for spin | ||
| 124 | /// | ||
| 125 | void SetText(const std::string& text) | ||
| 126 | { | ||
| 127 | m_interface->kodi_gui->control_spin->set_text(m_interface->kodiBase, m_controlHandle, text.c_str()); | ||
| 128 | } | ||
| 129 | //-------------------------------------------------------------------------- | ||
| 130 | |||
| 131 | //========================================================================== | ||
| 132 | /// | ||
| 133 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 134 | /// @brief To reset spin control to defaults | ||
| 135 | /// | ||
| 136 | void Reset() | ||
| 137 | { | ||
| 138 | m_interface->kodi_gui->control_spin->reset(m_interface->kodiBase, m_controlHandle); | ||
| 139 | } | ||
| 140 | //-------------------------------------------------------------------------- | ||
| 141 | |||
| 142 | //========================================================================== | ||
| 143 | /// | ||
| 144 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 145 | /// @brief To set the with SpinControlType defined types of spin. | ||
| 146 | /// | ||
| 147 | /// @param[in] type The type to use | ||
| 148 | /// | ||
| 149 | /// @note See description of \ref AddonGUISpinControlType for available types. | ||
| 150 | /// | ||
| 151 | void SetType(AddonGUISpinControlType type) | ||
| 152 | { | ||
| 153 | m_interface->kodi_gui->control_spin->set_type(m_interface->kodiBase, m_controlHandle, (int)type); | ||
| 154 | } | ||
| 155 | //-------------------------------------------------------------------------- | ||
| 156 | |||
| 157 | //========================================================================== | ||
| 158 | /// | ||
| 159 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 160 | /// @brief To add a label entry in spin defined with a value as string. | ||
| 161 | /// | ||
| 162 | /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function. | ||
| 163 | /// | ||
| 164 | /// @param[in] label Label string to view on skin | ||
| 165 | /// @param[in] value String value to use for selection | ||
| 166 | /// of them. | ||
| 167 | /// | ||
| 168 | void AddLabel(const std::string& label, const std::string& value) | ||
| 169 | { | ||
| 170 | m_interface->kodi_gui->control_spin->add_string_label(m_interface->kodiBase, m_controlHandle, label.c_str(), value.c_str()); | ||
| 171 | } | ||
| 172 | //-------------------------------------------------------------------------- | ||
| 173 | |||
| 174 | //========================================================================== | ||
| 175 | /// | ||
| 176 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 177 | /// @brief To add a label entry in spin defined with a value as integer. | ||
| 178 | /// | ||
| 179 | /// Format must be set to ADDON_SPIN_CONTROL_TYPE_INT to use this function. | ||
| 180 | /// | ||
| 181 | /// @param[in] label Label string to view on skin | ||
| 182 | /// @param[in] value Integer value to use for selection | ||
| 183 | /// of them. | ||
| 184 | /// | ||
| 185 | void AddLabel(const std::string& label, int value) | ||
| 186 | { | ||
| 187 | m_interface->kodi_gui->control_spin->add_int_label(m_interface->kodiBase, m_controlHandle, label.c_str(), value); | ||
| 188 | } | ||
| 189 | //-------------------------------------------------------------------------- | ||
| 190 | |||
| 191 | //========================================================================== | ||
| 192 | /// | ||
| 193 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 194 | /// @brief To change the spin to position with them string as value. | ||
| 195 | /// | ||
| 196 | /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function. | ||
| 197 | /// | ||
| 198 | /// @param[in] value String value to change to | ||
| 199 | /// | ||
| 200 | void SetStringValue(const std::string& value) | ||
| 201 | { | ||
| 202 | m_interface->kodi_gui->control_spin->set_string_value(m_interface->kodiBase, m_controlHandle, value.c_str()); | ||
| 203 | } | ||
| 204 | //-------------------------------------------------------------------------- | ||
| 205 | |||
| 206 | //========================================================================== | ||
| 207 | /// | ||
| 208 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 209 | /// @brief To get the current spin control position with text string value. | ||
| 210 | /// | ||
| 211 | /// Format must be set to ADDON_SPIN_CONTROL_TYPE_TEXT to use this function. | ||
| 212 | /// | ||
| 213 | /// @return Currently selected string value | ||
| 214 | /// | ||
| 215 | std::string GetStringValue() const | ||
| 216 | { | ||
| 217 | std::string value; | ||
| 218 | char* ret = m_interface->kodi_gui->control_spin->get_string_value(m_interface->kodiBase, m_controlHandle); | ||
| 219 | if (ret != nullptr) | ||
| 220 | { | ||
| 221 | if (std::strlen(ret)) | ||
| 222 | value = ret; | ||
| 223 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 224 | } | ||
| 225 | return value; | ||
| 226 | } | ||
| 227 | //-------------------------------------------------------------------------- | ||
| 228 | |||
| 229 | //========================================================================== | ||
| 230 | /// | ||
| 231 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 232 | /// @brief To set the the range as integer of slider, e.g. -10 is the slider | ||
| 233 | /// start and e.g. +10 is the from here defined position where it reach the | ||
| 234 | /// end. | ||
| 235 | /// | ||
| 236 | /// Ad default is the range from 0 to 100. | ||
| 237 | /// | ||
| 238 | /// @param[in] start Integer start value | ||
| 239 | /// @param[in] end Integer end value | ||
| 240 | /// | ||
| 241 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 242 | /// these different values can be not together and can, therefore, only | ||
| 243 | /// one each can be used and must be defined with \ref SetType before. | ||
| 244 | /// | ||
| 245 | void SetIntRange(int start, int end) | ||
| 246 | { | ||
| 247 | m_interface->kodi_gui->control_spin->set_int_range(m_interface->kodiBase, m_controlHandle, start, end); | ||
| 248 | } | ||
| 249 | //-------------------------------------------------------------------------- | ||
| 250 | |||
| 251 | //========================================================================== | ||
| 252 | /// | ||
| 253 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 254 | /// @brief Set the slider position with the given integer value. The Range | ||
| 255 | /// must be defined with a call from \ref SetIntRange before. | ||
| 256 | /// | ||
| 257 | /// @param[in] value Position in range to set with integer | ||
| 258 | /// | ||
| 259 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 260 | /// these different values can be not together and can, therefore, only | ||
| 261 | /// one each can be used and must be defined with \ref SetType before. | ||
| 262 | /// | ||
| 263 | void SetIntValue(int value) | ||
| 264 | { | ||
| 265 | m_interface->kodi_gui->control_spin->set_int_value(m_interface->kodiBase, m_controlHandle, value); | ||
| 266 | } | ||
| 267 | //-------------------------------------------------------------------------- | ||
| 268 | |||
| 269 | //========================================================================== | ||
| 270 | /// | ||
| 271 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 272 | /// @brief To get the current position as integer value. | ||
| 273 | /// | ||
| 274 | /// @return The position as integer | ||
| 275 | /// | ||
| 276 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 277 | /// these different values can be not together and can, therefore, only | ||
| 278 | /// one each can be used and must be defined with \ref SetType before. | ||
| 279 | /// | ||
| 280 | int GetIntValue() const | ||
| 281 | { | ||
| 282 | return m_interface->kodi_gui->control_spin->get_int_value(m_interface->kodiBase, m_controlHandle); | ||
| 283 | } | ||
| 284 | //-------------------------------------------------------------------------- | ||
| 285 | |||
| 286 | //========================================================================== | ||
| 287 | /// | ||
| 288 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 289 | /// @brief To set the the range as float of spin, e.g. -25.0 is the spin | ||
| 290 | /// start and e.g. +25.0 is the from here defined position where it reach | ||
| 291 | /// the end. | ||
| 292 | /// | ||
| 293 | /// As default is the range 0.0 to 1.0. | ||
| 294 | /// | ||
| 295 | /// The float interval is as default 0.1 and can be changed with | ||
| 296 | /// @ref SetFloatInterval. | ||
| 297 | /// | ||
| 298 | /// @param[in] start Integer start value | ||
| 299 | /// @param[in] end Integer end value | ||
| 300 | /// | ||
| 301 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 302 | /// these different values can be not together and can, therefore, only | ||
| 303 | /// one each can be used and must be defined with \ref SetType before. | ||
| 304 | /// | ||
| 305 | void SetFloatRange(float start, float end) | ||
| 306 | { | ||
| 307 | m_interface->kodi_gui->control_spin->set_float_range(m_interface->kodiBase, m_controlHandle, start, end); | ||
| 308 | } | ||
| 309 | //-------------------------------------------------------------------------- | ||
| 310 | |||
| 311 | //========================================================================== | ||
| 312 | /// | ||
| 313 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 314 | /// @brief Set the spin position with the given float value. The Range | ||
| 315 | /// can be defined with a call from \ref SetIntRange before, as default it | ||
| 316 | /// is 0.0 to 1.0. | ||
| 317 | /// | ||
| 318 | /// @param[in] value Position in range to set with float | ||
| 319 | /// | ||
| 320 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 321 | /// these different values can be not together and can, therefore, only | ||
| 322 | /// one each can be used and must be defined with \ref SetType before. | ||
| 323 | /// | ||
| 324 | void SetFloatValue(float value) | ||
| 325 | { | ||
| 326 | m_interface->kodi_gui->control_spin->set_float_value(m_interface->kodiBase, m_controlHandle, value); | ||
| 327 | } | ||
| 328 | //-------------------------------------------------------------------------- | ||
| 329 | |||
| 330 | //========================================================================== | ||
| 331 | /// | ||
| 332 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 333 | /// @brief To get the current position as float value. | ||
| 334 | /// | ||
| 335 | /// @return The position as float | ||
| 336 | /// | ||
| 337 | float GetFloatValue() const | ||
| 338 | { | ||
| 339 | return m_interface->kodi_gui->control_spin->get_float_value(m_interface->kodiBase, m_controlHandle); | ||
| 340 | } | ||
| 341 | //-------------------------------------------------------------------------- | ||
| 342 | |||
| 343 | //========================================================================== | ||
| 344 | /// | ||
| 345 | /// \ingroup cpp_kodi_gui_controls_CSpin | ||
| 346 | /// @brief To set the interval steps of spin, as default is it 0.1 If it | ||
| 347 | /// becomes changed with this function will a step of the user with the | ||
| 348 | /// value fixed here be executed. | ||
| 349 | /// | ||
| 350 | /// @param[in] interval Intervall step to set. | ||
| 351 | /// | ||
| 352 | /// @note Percent, floating point or integer are alone possible. Combining | ||
| 353 | /// these different values can be not together and can, therefore, only | ||
| 354 | /// one each can be used and must be defined with \ref SetType before. | ||
| 355 | /// | ||
| 356 | void SetFloatInterval(float interval) | ||
| 357 | { | ||
| 358 | m_interface->kodi_gui->control_spin->set_float_interval(m_interface->kodiBase, m_controlHandle, interval); | ||
| 359 | } | ||
| 360 | //-------------------------------------------------------------------------- | ||
| 361 | }; | ||
| 362 | |||
| 363 | } /* namespace controls */ | ||
| 364 | } /* namespace gui */ | ||
| 365 | } /* namespace kodi */ | ||
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 | |||
| 14 | namespace kodi | ||
| 15 | { | ||
| 16 | namespace gui | ||
| 17 | { | ||
| 18 | namespace 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 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CTextBox : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 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 */ | ||
