From 5f8335c1e49ce108ef3481863833c98efa00411b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 2 Jul 2020 23:09:26 +0200 Subject: sync with upstream --- .../include/kodi/gui/controls/Button.h | 256 ++++----- .../include/kodi/gui/controls/Edit.h | 308 +++++------ .../include/kodi/gui/controls/FadeLabel.h | 227 ++++---- .../include/kodi/gui/controls/Image.h | 162 +++--- .../include/kodi/gui/controls/Label.h | 168 +++--- .../include/kodi/gui/controls/Progress.h | 158 +++--- .../include/kodi/gui/controls/RadioButton.h | 251 ++++----- .../include/kodi/gui/controls/Rendering.h | 323 ++++++------ .../include/kodi/gui/controls/SettingsSlider.h | 550 ++++++++++---------- .../include/kodi/gui/controls/Slider.h | 572 +++++++++++---------- .../include/kodi/gui/controls/Spin.h | 2 +- .../include/kodi/gui/controls/TextBox.h | 257 ++++----- 12 files changed, 1653 insertions(+), 1581 deletions(-) (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls') 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 index a38de1a..081ab06 100644 --- 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 @@ -18,147 +18,153 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CButton Control Button +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CButton } +/// **Standard push button control for window** +/// +/// The button control is used for creating push buttons in Kodi. You can +/// choose the position, size, and look of the button, as well as choosing +/// what action(s) should be performed when pushed. +/// +/// It has the header \ref Button.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref skin_Button_control "button control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CButton : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// \defgroup cpp_kodi_gui_controls_CButton Control Button - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CButton } - /// **Standard push button control for window** + CButton(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_button( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CButton can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The button control is used for creating push buttons in Kodi. You can - /// choose the position, size, and look of the button, as well as choosing - /// what action(s) should be performed when pushed. + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Destructor /// - /// It has the header \ref Button.h "#include " - /// be included to enjoy it. + ~CButton() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref skin_Button_control "button control" + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CButton : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CButton(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_button(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CButton can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_button->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Destructor - /// - ~CButton() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_button->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Set's the control's enabled/disabled state - /// - /// @param[in] enabled If true enabled, otherwise disabled - /// - void SetEnabled(bool enabled) - { - m_interface->kodi_gui->control_button->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Set's the control's enabled/disabled state + /// + /// @param[in] enabled If true enabled, otherwise disabled + /// + void SetEnabled(bool enabled) + { + m_interface->kodi_gui->control_button->set_enabled(m_interface->kodiBase, m_controlHandle, + enabled); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief To set the text string on button - /// - /// @param[in] label Text to show - /// - void SetLabel(const std::string& label) - { - m_interface->kodi_gui->control_button->set_label(m_interface->kodiBase, m_controlHandle, label.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief To set the text string on button + /// + /// @param[in] label Text to show + /// + void SetLabel(const std::string& label) + { + m_interface->kodi_gui->control_button->set_label(m_interface->kodiBase, m_controlHandle, + label.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Get the used text from button - /// - /// @return Text shown - /// - std::string GetLabel() const + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Get the used text from button + /// + /// @return Text shown + /// + std::string GetLabel() const + { + std::string label; + char* ret = + m_interface->kodi_gui->control_button->get_label(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_button->get_label(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return label; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief If two labels are used for button becomes it set with them - /// - /// @param[in] label Text for second label - /// - void SetLabel2(const std::string& label) - { - m_interface->kodi_gui->control_button->set_label2(m_interface->kodiBase, m_controlHandle, label.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief If two labels are used for button becomes it set with them + /// + /// @param[in] label Text for second label + /// + void SetLabel2(const std::string& label) + { + m_interface->kodi_gui->control_button->set_label2(m_interface->kodiBase, m_controlHandle, + label.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// @ingroup cpp_kodi_gui_control_CButton - /// @brief Get the second label if present - /// - /// @return Second label - /// - std::string GetLabel2() const + //========================================================================== + /// + /// @ingroup cpp_kodi_gui_control_CButton + /// @brief Get the second label if present + /// + /// @return Second label + /// + std::string GetLabel2() const + { + std::string label; + char* ret = + m_interface->kodi_gui->control_button->get_label2(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_button->get_label2(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- - }; + return label; + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index 5d30160..99c01de 100644 --- 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 @@ -95,170 +95,180 @@ namespace gui namespace controls { - class CEdit : public CAddonGUIControlBase +class ATTRIBUTE_HIDDEN CEdit : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id + /// + CEdit(CWindow* window, int controlId) : CAddonGUIControlBase(window) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CEdit(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_edit(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::control::CEdit can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- + m_controlHandle = m_interface->kodi_gui->window->get_control_edit( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::control::CEdit can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Destructor - /// - ~CEdit() override = default; - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Destructor + /// + ~CEdit() override = default; + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_edit->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Set the control on window to visible + /// + /// @param[in] visible If true visible, otherwise hidden + /// + void SetVisible(bool visible) + { + m_interface->kodi_gui->control_edit->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Set's the control's enabled/disabled state - /// - /// @param[in] enabled If true enabled, otherwise disabled - /// - void SetEnabled(bool enabled) - { - m_interface->kodi_gui->control_edit->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Set's the control's enabled/disabled state + /// + /// @param[in] enabled If true enabled, otherwise disabled + /// + void SetEnabled(bool enabled) + { + m_interface->kodi_gui->control_edit->set_enabled(m_interface->kodiBase, m_controlHandle, + enabled); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief To set the text string on edit control - /// - /// @param[in] label Text to show - /// - void SetLabel(const std::string& label) - { - m_interface->kodi_gui->control_edit->set_label(m_interface->kodiBase, m_controlHandle, label.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief To set the text string on edit control + /// + /// @param[in] label Text to show + /// + void SetLabel(const std::string& label) + { + m_interface->kodi_gui->control_edit->set_label(m_interface->kodiBase, m_controlHandle, + label.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Returns the text heading for this edit control. - /// - /// @return Heading text - /// - std::string GetLabel() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Returns the text heading for this edit control. + /// + /// @return Heading text + /// + std::string GetLabel() const + { + std::string label; + char* ret = + m_interface->kodi_gui->control_edit->get_label(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_edit->get_label(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return label; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Set's text heading for this edit control. - /// - /// @param[in] text string or unicode - text string. - /// - void SetText(const std::string& text) - { - m_interface->kodi_gui->control_edit->set_text(m_interface->kodiBase, m_controlHandle, text.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Set's text heading for this edit control. + /// + /// @param[in] text string or unicode - text string. + /// + void SetText(const std::string& text) + { + m_interface->kodi_gui->control_edit->set_text(m_interface->kodiBase, m_controlHandle, + text.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Returns the text value for this edit control. - /// - /// @return Text value of control - /// - std::string GetText() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Returns the text value for this edit control. + /// + /// @return Text value of control + /// + std::string GetText() const + { + std::string text; + char* ret = + m_interface->kodi_gui->control_edit->get_text(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string text; - char* ret = m_interface->kodi_gui->control_edit->get_text(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - text = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return text; + if (std::strlen(ret)) + text = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return text; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief Set the cursor position on text. - /// - /// @param[in] iPosition The position to set - /// - void SetCursorPosition(unsigned int iPosition) - { - m_interface->kodi_gui->control_edit->set_cursor_position(m_interface->kodiBase, m_controlHandle, iPosition); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief Set the cursor position on text. + /// + /// @param[in] iPosition The position to set + /// + void SetCursorPosition(unsigned int iPosition) + { + m_interface->kodi_gui->control_edit->set_cursor_position(m_interface->kodiBase, m_controlHandle, + iPosition); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief To get current cursor position on text field - /// - /// @return The current cursor position - /// - unsigned int GetCursorPosition() - { - return m_interface->kodi_gui->control_edit->get_cursor_position(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief To get current cursor position on text field + /// + /// @return The current cursor position + /// + unsigned int GetCursorPosition() + { + return m_interface->kodi_gui->control_edit->get_cursor_position(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CEdit - /// @brief To set field input type which are defined on \ref AddonGUIInputType - /// - /// @param[in] type The \ref AddonGUIInputType "Add-on input type" - /// to use - /// @param[in] heading The heading text for related keyboard - /// dialog - /// - void SetInputType(AddonGUIInputType type, const std::string& heading) - { - m_interface->kodi_gui->control_edit->set_input_type(m_interface->kodiBase, m_controlHandle, static_cast(type), heading.c_str()); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CEdit + /// @brief To set field input type which are defined on \ref AddonGUIInputType + /// + /// @param[in] type The \ref AddonGUIInputType "Add-on input type" + /// to use + /// @param[in] heading The heading text for related keyboard + /// dialog + /// + void SetInputType(AddonGUIInputType type, const std::string& heading) + { + m_interface->kodi_gui->control_edit->set_input_type(m_interface->kodiBase, m_controlHandle, + static_cast(type), heading.c_str()); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index aab8929..02c843f 100644 --- 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 @@ -18,130 +18,135 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CFadeLabel Control Fade Label +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CFadeLabel } +/// **Window control used to show multiple pieces of text in the same position, +/// by fading from one to the other** +/// +/// The fade label control is used for displaying multiple pieces of text in +/// the same space in Kodi. You can choose the font, size, colour, location +/// and contents of the text to be displayed. The first piece of information +/// to display fades in over 50 frames, then scrolls off to the left. Once it +/// is finished scrolling off screen, the second piece of information fades +/// in and the process repeats. A fade label control is not supported in a +/// list container. +/// +/// It has the header \ref FadeLabel.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CFadeLabel : public CAddonGUIControlBase +{ +public: + //========================================================================== /// - /// \defgroup cpp_kodi_gui_controls_CFadeLabel Control Fade Label - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CFadeLabel } - /// **Window control used to show multiple pieces of text in the same position, - /// by fading from one to the other** + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief Construct a new control. /// - /// The fade label control is used for displaying multiple pieces of text in - /// the same space in Kodi. You can choose the font, size, colour, location - /// and contents of the text to be displayed. The first piece of information - /// to display fades in over 50 frames, then scrolls off to the left. Once it - /// is finished scrolling off screen, the second piece of information fades - /// in and the process repeats. A fade label control is not supported in a - /// list container. + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// It has the header \ref FadeLabel.h "#include " - /// be included to enjoy it. + CFadeLabel(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Fade_Label_Control "fade label control" + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief Destructor. + /// + ~CFadeLabel() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief Set the control on window to visible. /// - class CFadeLabel : public CAddonGUIControlBase + /// @param[in] visible If true visible, otherwise hidden + /// + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief Construct a new control. - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CFadeLabel(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_fade_label(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CFadeLabel can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief Destructor. - /// - ~CFadeLabel() override = default; - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief Set the control on window to visible. - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_fade_label->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief To add additional text string on fade label. - /// - /// @param[in] label Text to show - /// - void AddLabel(const std::string& label) - { - m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle, label.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief To add additional text string on fade label. + /// + /// @param[in] label Text to show + /// + void AddLabel(const std::string& label) + { + m_interface->kodi_gui->control_fade_label->add_label(m_interface->kodiBase, m_controlHandle, + label.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief Get the used text from button - /// - /// @return Text shown - /// - std::string GetLabel() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief Get the used text from button + /// + /// @return Text shown + /// + std::string GetLabel() const + { + std::string label; + char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase, + m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_fade_label->get_label(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return label; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief To enable or disable scrolling on fade label - /// - /// @param[in] scroll To enable scrolling set to true, otherwise is - /// disabled - /// - void SetScrolling(bool scroll) - { - m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle, scroll); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief To enable or disable scrolling on fade label + /// + /// @param[in] scroll To enable scrolling set to true, otherwise is + /// disabled + /// + void SetScrolling(bool scroll) + { + m_interface->kodi_gui->control_fade_label->set_scrolling(m_interface->kodiBase, m_controlHandle, + scroll); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CFadeLabel - /// @brief To reset al inserted labels. - /// - void Reset() - { - m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CFadeLabel + /// @brief To reset al inserted labels. + /// + void Reset() + { + m_interface->kodi_gui->control_fade_label->reset(m_interface->kodiBase, m_controlHandle); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index a872ab0..b4d092f 100644 --- 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 @@ -18,94 +18,98 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CImage Control Image +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CImage } +/// **Window control used to show an image.** +/// +/// The image control is used for displaying images in Kodi. You can choose +/// the position, size, transparency and contents of the image to be displayed. +/// +/// It has the header \ref Image.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Image_Control "image control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CImage : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CImage + /// @brief Construct a new control /// - /// \defgroup cpp_kodi_gui_controls_CImage Control Image - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CImage } - /// **Window control used to show an image.** + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id + /// + CImage(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_image( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CImage can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The image control is used for displaying images in Kodi. You can choose - /// the position, size, transparency and contents of the image to be displayed. + /// \ingroup cpp_kodi_gui_controls_CImage + /// @brief Destructor /// - /// It has the header \ref Image.h "#include " - /// be included to enjoy it. + ~CImage() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Image_Control "image control" + /// \ingroup cpp_kodi_gui_controls_CImage + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CImage : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CImage - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CImage(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_image(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CImage can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CImage - /// @brief Destructor - /// - ~CImage() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CImage - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CImage - /// @brief To set the filename used on image control. - /// - /// @param[in] filename Image file to use - /// @param[in] useCache To define storage of image, default is - /// in cache, if false becomes it loaded - /// always on changes again - /// - void SetFileName(const std::string& filename, bool useCache = true) - { - m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, filename.c_str(), useCache); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CImage + /// @brief To set the filename used on image control. + /// + /// @param[in] filename Image file to use + /// @param[in] useCache To define storage of image, default is + /// in cache, if false becomes it loaded + /// always on changes again + /// + void SetFileName(const std::string& filename, bool useCache = true) + { + m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, + filename.c_str(), useCache); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CImage - /// @brief To set set the diffuse color on image. - /// - /// @param[in] colorDiffuse Color to use for diffuse - /// - void SetColorDiffuse(uint32_t colorDiffuse) - { - m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, colorDiffuse); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CImage + /// @brief To set set the diffuse color on image. + /// + /// @param[in] colorDiffuse Color to use for diffuse + /// + void SetColorDiffuse(uint32_t colorDiffuse) + { + m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, + colorDiffuse); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index eecfd8b..82604bd 100644 --- 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 @@ -18,99 +18,103 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CLabel Control Label +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CLabel } +/// **Window control used to show some lines of text.** +/// +/// The label control is used for displaying text in Kodi. You can choose +/// the font, size, colour, location and contents of the text to be displayed. +/// +/// It has the header \ref Label.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Label_Control "label control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CLabel : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CLabel + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// \defgroup cpp_kodi_gui_controls_CLabel Control Label - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CLabel } - /// **Window control used to show some lines of text.** + CLabel(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_label( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CLabel can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The label control is used for displaying text in Kodi. You can choose - /// the font, size, colour, location and contents of the text to be displayed. + /// \ingroup cpp_kodi_gui_controls_CLabel + /// @brief Destructor /// - /// It has the header \ref Label.h "#include " - /// be included to enjoy it. + ~CLabel() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Label_Control "label control" + /// \ingroup cpp_kodi_gui_controls_CLabel + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CLabel : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CLabel - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CLabel(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_label(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CLabel can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CLabel - /// @brief Destructor - /// - ~CLabel() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CLabel - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_label->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_label->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CLabel - /// @brief To set the text string on label - /// - /// @param[in] text Text to show - /// - void SetLabel(const std::string& text) - { - m_interface->kodi_gui->control_label->set_label(m_interface->kodiBase, m_controlHandle, text.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CLabel + /// @brief To set the text string on label + /// + /// @param[in] text Text to show + /// + void SetLabel(const std::string& text) + { + m_interface->kodi_gui->control_label->set_label(m_interface->kodiBase, m_controlHandle, + text.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CLabel - /// @brief Get the used text from control - /// - /// @return Used text on label control - /// - std::string GetLabel() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CLabel + /// @brief Get the used text from control + /// + /// @return Used text on label control + /// + std::string GetLabel() const + { + std::string label; + char* ret = + m_interface->kodi_gui->control_label->get_label(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_label->get_label(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- - }; + return label; + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index 78880c4..8cb582b 100644 --- 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 @@ -18,92 +18,96 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CProgress Control Progress +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CProgress } +/// **Window control to show the progress of a particular operation** +/// +/// The progress control is used to show the progress of an item that may take +/// a long time, or to show how far through a movie you are. You can choose +/// the position, size, and look of the progress control. +/// +/// It has the header \ref Progress.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Progress_Control "progress control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CProgress : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CProgress + /// @brief Construct a new control /// - /// \defgroup cpp_kodi_gui_controls_CProgress Control Progress - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CProgress } - /// **Window control to show the progress of a particular operation** + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id + /// + CProgress(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_progress( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CProgress can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The progress control is used to show the progress of an item that may take - /// a long time, or to show how far through a movie you are. You can choose - /// the position, size, and look of the progress control. + /// \ingroup cpp_kodi_gui_controls_CProgress + /// @brief Destructor /// - /// It has the header \ref Progress.h "#include " - /// be included to enjoy it. + ~CProgress() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Progress_Control "progress control" + /// \ingroup cpp_kodi_gui_controls_CProgress + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CProgress : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CProgress - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CProgress(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_progress(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CProgress can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CProgress - /// @brief Destructor - /// - ~CProgress() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CProgress - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CProgress - /// @brief To set Percent position of control - /// - /// @param[in] percent The percent position to use - /// - void SetPercentage(float percent) - { - m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, percent); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CProgress + /// @brief To set Percent position of control + /// + /// @param[in] percent The percent position to use + /// + void SetPercentage(float percent) + { + m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, + percent); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CProgress - /// @brief Get the active percent position of progress bar - /// - /// @return Progress position as percent - /// - float GetPercentage() const - { - return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CProgress + /// @brief Get the active percent position of progress bar + /// + /// @return Progress position as percent + /// + float GetPercentage() const + { + return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index 1721759..305195d 100644 --- 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 @@ -18,142 +18,149 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CRadioButton Control Radio Button +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CRadioButton } +/// **Window control for a radio button (as used for on/off settings)** +/// +/// The radio button control is used for creating push button on/off settings +/// in Kodi. You can choose the position, size, and look of the button. When +/// the user clicks on the radio button, the state will change, toggling the +/// extra textures (textureradioon and textureradiooff). Used for settings +/// controls. +/// +/// It has the header \ref RadioButton.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Radio_button_control "radio button control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CRadioButton : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// \defgroup cpp_kodi_gui_controls_CRadioButton Control Radio Button - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CRadioButton } - /// **Window control for a radio button (as used for on/off settings)** + CRadioButton(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_radio_button( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CRadioButton can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The radio button control is used for creating push button on/off settings - /// in Kodi. You can choose the position, size, and look of the button. When - /// the user clicks on the radio button, the state will change, toggling the - /// extra textures (textureradioon and textureradiooff). Used for settings - /// controls. + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Destructor /// - /// It has the header \ref RadioButton.h "#include " - /// be included to enjoy it. + ~CRadioButton() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Radio_button_control "radio button control" + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CRadioButton : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CRadioButton(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_radio_button(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CRadioButton can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Destructor - /// - ~CRadioButton() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_radio_button->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_radio_button->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Set's the control's enabled/disabled state - /// - /// @param[in] enabled If true enabled, otherwise disabled - /// - void SetEnabled(bool enabled) - { - m_interface->kodi_gui->control_radio_button->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Set's the control's enabled/disabled state + /// + /// @param[in] enabled If true enabled, otherwise disabled + /// + void SetEnabled(bool enabled) + { + m_interface->kodi_gui->control_radio_button->set_enabled(m_interface->kodiBase, m_controlHandle, + enabled); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief To set the text string on radio button - /// - /// @param[in] label Text to show - /// - void SetLabel(const std::string& label) - { - m_interface->kodi_gui->control_radio_button->set_label(m_interface->kodiBase, m_controlHandle, label.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief To set the text string on radio button + /// + /// @param[in] label Text to show + /// + void SetLabel(const std::string& label) + { + m_interface->kodi_gui->control_radio_button->set_label(m_interface->kodiBase, m_controlHandle, + label.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Get the used text from control - /// - /// @return Text shown - /// - std::string GetLabel() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Get the used text from control + /// + /// @return Text shown + /// + std::string GetLabel() const + { + std::string label; + char* ret = m_interface->kodi_gui->control_radio_button->get_label(m_interface->kodiBase, + m_controlHandle); + if (ret != nullptr) { - std::string label; - char* ret = m_interface->kodi_gui->control_radio_button->get_label(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - label = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return label; + if (std::strlen(ret)) + label = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return label; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief To set radio button condition to on or off - /// - /// @param[in] selected true set radio button to selection on, otherwise - /// off - /// - void SetSelected(bool selected) - { - m_interface->kodi_gui->control_radio_button->set_selected(m_interface->kodiBase, m_controlHandle, selected); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief To set radio button condition to on or off + /// + /// @param[in] selected true set radio button to selection on, otherwise + /// off + /// + void SetSelected(bool selected) + { + m_interface->kodi_gui->control_radio_button->set_selected(m_interface->kodiBase, + m_controlHandle, selected); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRadioButton - /// @brief Get the current selected condition of radio button - /// - /// @return Selected condition - /// - bool IsSelected() const - { - return m_interface->kodi_gui->control_radio_button->is_selected(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRadioButton + /// @brief Get the current selected condition of radio button + /// + /// @return Selected condition + /// + bool IsSelected() const + { + return m_interface->kodi_gui->control_radio_button->is_selected(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index b3dadcd..7cc9b24 100644 --- 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 @@ -10,6 +10,7 @@ #include "../../AddonBase.h" #include "../Window.h" +#include "../renderHelper.h" namespace kodi { @@ -18,186 +19,186 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CRendering Control Rendering +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CRendering } +/// **Window control for rendering own parts** +/// +/// This rendering control is used when own parts are needed. You have the +/// control over them to render direct OpenGL or DirectX content to the +/// screen set by the size of them. +/// +/// Alternative can be the virtual functions from t his been ignored if the +/// callbacks are defined by the \ref CRendering_SetIndependentCallbacks function and +/// class is used as single and not as a parent class. +/// +/// It has the header \ref Rendering.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Addon_Rendering_control "rendering control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// + +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CRendering_Defs Definitions, structures and enumerators +/// \ingroup cpp_kodi_gui_controls_CRendering +/// @brief **Library definition values** +/// + +class ATTRIBUTE_HIDDEN CRendering : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRendering + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id + /// + CRendering(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_render_addon( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (m_controlHandle) + m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, + m_controlHandle, this, OnCreateCB, + OnRenderCB, OnStopCB, OnDirtyCB); + else + kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::%s can't create control class from Kodi !!!", + __FUNCTION__); + } + //-------------------------------------------------------------------------- + + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRendering + /// @brief Destructor + /// + ~CRendering() override + { + m_interface->kodi_gui->control_rendering->destroy(m_interface->kodiBase, m_controlHandle); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// \defgroup cpp_kodi_gui_controls_CRendering Control Rendering - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CRendering } - /// **Window control for rendering own parts** + /// \ingroup cpp_kodi_gui_controls_CRendering + /// @brief To create rendering control on Add-on /// - /// This rendering control is used when own parts are needed. You have the - /// control over them to render direct OpenGL or DirectX content to the - /// screen set by the size of them. + /// Function creates the needed rendering control for Kodi which becomes + /// handled and processed from Add-on /// - /// Alternative can be the virtual functions from t his been ignored if the - /// callbacks are defined by the \ref CRendering_SetIndependentCallbacks function and - /// class is used as single and not as a parent class. + /// @note This is callback function from Kodi to Add-on and not to use + /// for calls from add-on to this function. /// - /// It has the header \ref Rendering.h "#include " - /// be included to enjoy it. + /// @param[in] x Horizontal position + /// @param[in] y Vertical position + /// @param[in] w Width of control + /// @param[in] h Height of control + /// @param[in] device The device to use. For OpenGL is empty + /// on Direct X is the needed device send. + /// @return Add-on needs to return true if successed, + /// otherwise false. /// - /// Here you find the needed skin part for a \ref Addon_Rendering_control "rendering control" + virtual bool Create(int x, int y, int w, int h, void* device) { return false; } + //-------------------------------------------------------------------------- + + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRendering + /// @brief Render process call from Kodi /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @note This is callback function from Kodi to Add-on and not to use + /// for calls from add-on to this function. /// + virtual void Render() {} + //-------------------------------------------------------------------------- - //============================================================================ + //========================================================================== /// - /// \defgroup cpp_kodi_gui_controls_CRendering_Defs Definitions, structures and enumerators /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief **Library definition values** + /// @brief Call from Kodi to stop rendering process /// + /// @note This is callback function from Kodi to Add-on and not to use + /// for calls from add-on to this function. + /// + virtual void Stop() {} + //-------------------------------------------------------------------------- - class CRendering : public CAddonGUIControlBase + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRendering + /// @brief Call from Kodi where add-on becomes asked about dirty rendering + /// region. + /// + /// @note This is callback function from Kodi to Add-on and not to use + /// for calls from add-on to this function. + /// + virtual bool Dirty() { return false; } + //-------------------------------------------------------------------------- + + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CRendering + /// \anchor CRendering_SetIndependentCallbacks + /// @brief If the class is used independent (with "new CRendering") + /// and not as parent (with "cCLASS_own : CRendering") from own must + /// be the callback from Kodi to add-on overdriven with own functions! + /// + void SetIndependentCallbacks( + GUIHANDLE cbhdl, + bool (*CBCreate)(GUIHANDLE cbhdl, int x, int y, int w, int h, void* device), + void (*CBRender)(GUIHANDLE cbhdl), + void (*CBStop)(GUIHANDLE cbhdl), + bool (*CBDirty)(GUIHANDLE cbhdl)) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CRendering(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_render_addon(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (m_controlHandle) - m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, m_controlHandle, this, - OnCreateCB, OnRenderCB, OnStopCB, OnDirtyCB); - else - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::%s can't create control class from Kodi !!!", __FUNCTION__); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief Destructor - /// - ~CRendering() override - { - m_interface->kodi_gui->control_rendering->destroy(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief To create rendering control on Add-on - /// - /// Function creates the needed rendering control for Kodi which becomes - /// handled and processed from Add-on - /// - /// @note This is callback function from Kodi to Add-on and not to use - /// for calls from add-on to this function. - /// - /// @param[in] x Horizontal position - /// @param[in] y Vertical position - /// @param[in] w Width of control - /// @param[in] h Height of control - /// @param[in] device The device to use. For OpenGL is empty - /// on Direct X is the needed device send. - /// @return Add-on needs to return true if successed, - /// otherwise false. - /// - virtual bool Create(int x, int y, int w, int h, void* device) { return false; } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief Render process call from Kodi - /// - /// @note This is callback function from Kodi to Add-on and not to use - /// for calls from add-on to this function. - /// - virtual void Render() { } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief Call from Kodi to stop rendering process - /// - /// @note This is callback function from Kodi to Add-on and not to use - /// for calls from add-on to this function. - /// - virtual void Stop() { } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// @brief Call from Kodi where add-on becomes asked about dirty rendering - /// region. - /// - /// @note This is callback function from Kodi to Add-on and not to use - /// for calls from add-on to this function. - /// - virtual bool Dirty() { return false; } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CRendering - /// \anchor CRendering_SetIndependentCallbacks - /// @brief If the class is used independent (with "new CRendering") - /// and not as parent (with "cCLASS_own : CRendering") from own must - /// be the callback from Kodi to add-on overdriven with own functions! - /// - void SetIndependentCallbacks( - GUIHANDLE cbhdl, - bool (*CBCreate)(GUIHANDLE cbhdl, - int x, - int y, - int w, - int h, - void* device), - void (*CBRender)(GUIHANDLE cbhdl), - void (*CBStop) (GUIHANDLE cbhdl), - bool (*CBDirty) (GUIHANDLE cbhdl)) - { - if (!cbhdl || - !CBCreate || !CBRender || !CBStop || !CBDirty) - { - kodi::Log(ADDON_LOG_ERROR, "kodi::gui::controls::%s called with nullptr !!!", __FUNCTION__); - return; - } - - m_interface->kodi_gui->control_rendering->set_callbacks(m_interface->kodiBase, m_controlHandle, cbhdl, - CBCreate, CBRender, CBStop, CBDirty); - } - //-------------------------------------------------------------------------- - - private: - /* - * Defined callback functions from Kodi to add-on, for use in parent / child system - * (is private)! - */ - static bool OnCreateCB(void* cbhdl, int x, int y, int w, int h, void* device) + if (!cbhdl || !CBCreate || !CBRender || !CBStop || !CBDirty) { - return static_cast(cbhdl)->Create(x, y, w, h, device); + kodi::Log(ADDON_LOG_ERROR, "kodi::gui::controls::%s called with nullptr !!!", __FUNCTION__); + return; } - static void OnRenderCB(void* cbhdl) - { - static_cast(cbhdl)->Render(); - } + m_interface->kodi_gui->control_rendering->set_callbacks( + m_interface->kodiBase, m_controlHandle, cbhdl, CBCreate, CBRender, CBStop, CBDirty); + } + //-------------------------------------------------------------------------- + +private: + /* + * Defined callback functions from Kodi to add-on, for use in parent / child system + * (is private)! + */ + static bool OnCreateCB(void* cbhdl, int x, int y, int w, int h, void* device) + { + static_cast(cbhdl)->m_renderHelper = kodi::gui::GetRenderHelper(); + return static_cast(cbhdl)->Create(x, y, w, h, device); + } - static void OnStopCB(void* cbhdl) - { - static_cast(cbhdl)->Stop(); - } + static void OnRenderCB(void* cbhdl) + { + if (!static_cast(cbhdl)->m_renderHelper) + return; + static_cast(cbhdl)->m_renderHelper->Begin(); + static_cast(cbhdl)->Render(); + static_cast(cbhdl)->m_renderHelper->End(); + } + + static void OnStopCB(void* cbhdl) + { + static_cast(cbhdl)->Stop(); + static_cast(cbhdl)->m_renderHelper = nullptr; + } - static bool OnDirtyCB(void* cbhdl) - { - return static_cast(cbhdl)->Dirty(); - } + static bool OnDirtyCB(void* cbhdl) { return static_cast(cbhdl)->Dirty(); } - }; + std::shared_ptr m_renderHelper; +}; } /* namespace controls */ } /* namespace gui */ 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 index 4f97ba5..76a02aa 100644 --- 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 @@ -18,294 +18,308 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CSettingsSlider Control Settings Slider +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CSettingsSlider } +/// **Window control for moveable slider with text name** +/// +/// The settings slider control is used in the settings screens for when an +/// option is best specified on a sliding scale. You can choose the position, +/// size, and look of the slider control. It is basically a cross between the +/// button control and a slider control. It has a label and focus and non +/// focus textures, as well as a slider control on the right. +/// +/// It has the header \ref SettingsSlider.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Settings_Slider_Control "settings slider control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CSettingsSlider : public CAddonGUIControlBase +{ +public: + //========================================================================== /// - /// \defgroup cpp_kodi_gui_controls_CSettingsSlider Control Settings Slider - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CSettingsSlider } - /// **Window control for moveable slider with text name** + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Construct a new control /// - /// The settings slider control is used in the settings screens for when an - /// option is best specified on a sliding scale. You can choose the position, - /// size, and look of the slider control. It is basically a cross between the - /// button control and a slider control. It has a label and focus and non - /// focus textures, as well as a slider control on the right. + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// It has the header \ref SettingsSlider.h "#include " - /// be included to enjoy it. + CSettingsSlider(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_settings_slider( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CSettingsSlider can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Settings_Slider_Control "settings slider control" + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Destructor + /// + ~CSettingsSlider() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Set the control on window to visible /// - class CSettingsSlider : public CAddonGUIControlBase + /// @param[in] visible If true visible, otherwise hidden + /// + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CSettingsSlider(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_settings_slider(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSettingsSlider can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Destructor - /// - ~CSettingsSlider() override = default; - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_settings_slider->set_visible(m_interface->kodiBase, + m_controlHandle, visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_settings_slider->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Set's the control's enabled/disabled state - /// - /// @param[in] enabled If true enabled, otherwise disabled - /// - void SetEnabled(bool enabled) - { - m_interface->kodi_gui->control_settings_slider->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Set's the control's enabled/disabled state + /// + /// @param[in] enabled If true enabled, otherwise disabled + /// + void SetEnabled(bool enabled) + { + m_interface->kodi_gui->control_settings_slider->set_enabled(m_interface->kodiBase, + m_controlHandle, enabled); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To set the text string on settings slider - /// - /// @param[in] text Text to show - /// - void SetText(const std::string& text) - { - m_interface->kodi_gui->control_settings_slider->set_text(m_interface->kodiBase, m_controlHandle, text.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To set the text string on settings slider + /// + /// @param[in] text Text to show + /// + void SetText(const std::string& text) + { + m_interface->kodi_gui->control_settings_slider->set_text(m_interface->kodiBase, m_controlHandle, + text.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To reset slider on defaults - /// - void Reset() - { - m_interface->kodi_gui->control_settings_slider->reset(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To reset slider on defaults + /// + void Reset() + { + m_interface->kodi_gui->control_settings_slider->reset(m_interface->kodiBase, m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To set the the range as integer of slider, e.g. -10 is the slider - /// start and e.g. +10 is the from here defined position where it reach the - /// end. - /// - /// Ad default is the range from 0 to 100. - /// - /// The integer interval is as default 1 and can be changed with - /// @ref SetIntInterval. - /// - /// @param[in] start Integer start value - /// @param[in] end Integer end value - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only - /// one each can be used. - /// - void SetIntRange(int start, int end) - { - m_interface->kodi_gui->control_settings_slider->set_int_range(m_interface->kodiBase, m_controlHandle, start, end); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To set the the range as integer of slider, e.g. -10 is the slider + /// start and e.g. +10 is the from here defined position where it reach the + /// end. + /// + /// Ad default is the range from 0 to 100. + /// + /// The integer interval is as default 1 and can be changed with + /// @ref SetIntInterval. + /// + /// @param[in] start Integer start value + /// @param[in] end Integer end value + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only + /// one each can be used. + /// + void SetIntRange(int start, int end) + { + m_interface->kodi_gui->control_settings_slider->set_int_range(m_interface->kodiBase, + m_controlHandle, start, end); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Set the slider position with the given integer value. The Range - /// must be defined with a call from \ref SetIntRange before. - /// - /// @param[in] value Position in range to set with integer - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - void SetIntValue(int value) - { - m_interface->kodi_gui->control_settings_slider->set_int_value(m_interface->kodiBase, m_controlHandle, value); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Set the slider position with the given integer value. The Range + /// must be defined with a call from \ref SetIntRange before. + /// + /// @param[in] value Position in range to set with integer + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + void SetIntValue(int value) + { + m_interface->kodi_gui->control_settings_slider->set_int_value(m_interface->kodiBase, + m_controlHandle, value); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To get the current position as integer value. - /// - /// @return The position as integer - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - int GetIntValue() const - { - return m_interface->kodi_gui->control_settings_slider->get_int_value(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To get the current position as integer value. + /// + /// @return The position as integer + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + int GetIntValue() const + { + return m_interface->kodi_gui->control_settings_slider->get_int_value(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To set the interval steps of slider, as default is it 1. If it - /// becomes changed with this function will a step of the user with the - /// value fixed here be executed. - /// - /// @param[in] interval Intervall step to set. - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - void SetIntInterval(int interval) - { - m_interface->kodi_gui->control_settings_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, interval); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To set the interval steps of slider, as default is it 1. If it + /// becomes changed with this function will a step of the user with the + /// value fixed here be executed. + /// + /// @param[in] interval Intervall step to set. + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + void SetIntInterval(int interval) + { + m_interface->kodi_gui->control_settings_slider->set_int_interval(m_interface->kodiBase, + m_controlHandle, interval); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Sets the percent of the slider. - /// - /// @param[in] percent float - Percent value of slide - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - void SetPercentage(float percent) - { - m_interface->kodi_gui->control_settings_slider->set_percentage(m_interface->kodiBase, m_controlHandle, percent); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Sets the percent of the slider. + /// + /// @param[in] percent float - Percent value of slide + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + void SetPercentage(float percent) + { + m_interface->kodi_gui->control_settings_slider->set_percentage(m_interface->kodiBase, + m_controlHandle, percent); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Returns a float of the percent of the slider. - /// - /// @return float - Percent of slider - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - float GetPercentage() const - { - return m_interface->kodi_gui->control_settings_slider->get_percentage(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Returns a float of the percent of the slider. + /// + /// @return float - Percent of slider + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + float GetPercentage() const + { + return m_interface->kodi_gui->control_settings_slider->get_percentage(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To set the the range as float of slider, e.g. -25.0 is the slider - /// start and e.g. +25.0 is the from here defined position where it reach - /// the end. - /// - /// As default is the range 0.0 to 1.0. - /// - /// The float interval is as default 0.1 and can be changed with - /// @ref SetFloatInterval. - /// - /// @param[in] start Integer start value - /// @param[in] end Integer end value - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​ can be not together and can, therefore, only - /// one each can be used. - /// - void SetFloatRange(float start, float end) - { - m_interface->kodi_gui->control_settings_slider->set_float_range(m_interface->kodiBase, m_controlHandle, start, end); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To set the the range as float of slider, e.g. -25.0 is the slider + /// start and e.g. +25.0 is the from here defined position where it reach + /// the end. + /// + /// As default is the range 0.0 to 1.0. + /// + /// The float interval is as default 0.1 and can be changed with + /// @ref SetFloatInterval. + /// + /// @param[in] start Integer start value + /// @param[in] end Integer end value + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​ can be not together and can, therefore, only + /// one each can be used. + /// + void SetFloatRange(float start, float end) + { + m_interface->kodi_gui->control_settings_slider->set_float_range(m_interface->kodiBase, + m_controlHandle, start, end); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief Set the slider position with the given float value. The Range - /// can be defined with a call from \ref SetIntRange before, as default it - /// is 0.0 to 1.0. - /// - /// @param[in] value Position in range to set with float - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - void SetFloatValue(float value) - { - m_interface->kodi_gui->control_settings_slider->set_float_value(m_interface->kodiBase, m_controlHandle, value); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief Set the slider position with the given float value. The Range + /// can be defined with a call from \ref SetIntRange before, as default it + /// is 0.0 to 1.0. + /// + /// @param[in] value Position in range to set with float + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + void SetFloatValue(float value) + { + m_interface->kodi_gui->control_settings_slider->set_float_value(m_interface->kodiBase, + m_controlHandle, value); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To get the current position as float value. - /// - /// @return The position as float - /// - float GetFloatValue() const - { - return m_interface->kodi_gui->control_settings_slider->get_float_value(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To get the current position as float value. + /// + /// @return The position as float + /// + float GetFloatValue() const + { + return m_interface->kodi_gui->control_settings_slider->get_float_value(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSettingsSlider - /// @brief To set the interval steps of slider, as default is it 0.1 If it - /// becomes changed with this function will a step of the user with the - /// value fixed here be executed. - /// - /// @param[in] interval Intervall step to set. - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values ​​can be not together and can, therefore, only - /// one each can be used. - /// - void SetFloatInterval(float interval) - { - m_interface->kodi_gui->control_settings_slider->set_float_interval(m_interface->kodiBase, m_controlHandle, interval); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSettingsSlider + /// @brief To set the interval steps of slider, as default is it 0.1 If it + /// becomes changed with this function will a step of the user with the + /// value fixed here be executed. + /// + /// @param[in] interval Intervall step to set. + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values ​​can be not together and can, therefore, only + /// one each can be used. + /// + void SetFloatInterval(float interval) + { + m_interface->kodi_gui->control_settings_slider->set_float_interval(m_interface->kodiBase, + m_controlHandle, interval); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index 6eae70a..715cc7d 100644 --- 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 @@ -18,307 +18,321 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CSlider Control Slider +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CSlider } +/// **Window control for moveable slider** +/// +/// The slider control is used for things where a sliding bar best represents +/// the operation at hand (such as a volume control or seek control). You can +/// choose the position, size, and look of the slider control. +/// +/// It has the header \ref Slider.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Slider_Control "slider control" +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CSlider : public CAddonGUIControlBase +{ +public: + //========================================================================== /// - /// \defgroup cpp_kodi_gui_controls_CSlider Control Slider - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CSlider } - /// **Window control for moveable slider** + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Construct a new control /// - /// The slider control is used for things where a sliding bar best represents - /// the operation at hand (such as a volume control or seek control). You can - /// choose the position, size, and look of the slider control. + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// It has the header \ref Slider.h "#include " - /// be included to enjoy it. + CSlider(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_slider( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CSlider can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Slider_Control "slider control" + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Destructor /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + ~CSlider() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - class CSlider : public CAddonGUIControlBase + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Set the control on window to visible + /// + /// @param[in] visible If true visible, otherwise hidden + /// + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CSlider(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_slider(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CSlider can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Destructor - /// - ~CSlider() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_slider->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_slider->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Set's the control's enabled/disabled state - /// - /// @param[in] enabled If true enabled, otherwise disabled - /// - void SetEnabled(bool enabled) - { - m_interface->kodi_gui->control_slider->set_enabled(m_interface->kodiBase, m_controlHandle, enabled); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Set's the control's enabled/disabled state + /// + /// @param[in] enabled If true enabled, otherwise disabled + /// + void SetEnabled(bool enabled) + { + m_interface->kodi_gui->control_slider->set_enabled(m_interface->kodiBase, m_controlHandle, + enabled); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To reset slider on defaults - /// - void Reset() - { - m_interface->kodi_gui->control_slider->reset(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To reset slider on defaults + /// + void Reset() + { + m_interface->kodi_gui->control_slider->reset(m_interface->kodiBase, m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief With GetDescription becomes a string value of position returned. - /// - /// @return Text string about current slider position - /// - /// The following are the text definition returned from this: - /// | Value | Without range selection | With range selection | - /// |:---------:|:------------------------|:-------------------------------| - /// | float | %2.2f | [%2.2f, %2.2f] | - /// | integer | %i | [%i, %i] | - /// | percent | %i%% | [%i%%, %i%%] | - /// - std::string GetDescription() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief With GetDescription becomes a string value of position returned. + /// + /// @return Text string about current slider position + /// + /// The following are the text definition returned from this: + /// | Value | Without range selection | With range selection | + /// |:---------:|:------------------------|:-------------------------------| + /// | float | %2.2f | [%2.2f, %2.2f] | + /// | integer | %i | [%i, %i] | + /// | percent | %i%% | [%i%%, %i%%] | + /// + std::string GetDescription() const + { + std::string text; + char* ret = m_interface->kodi_gui->control_slider->get_description(m_interface->kodiBase, + m_controlHandle); + if (ret != nullptr) { - std::string text; - char* ret = m_interface->kodi_gui->control_slider->get_description(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - text = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return text; + if (std::strlen(ret)) + text = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return text; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To set the the range as integer of slider, e.g. -10 is the slider - /// start and e.g. +10 is the from here defined position where it reach the - /// end. - /// - /// Ad default is the range from 0 to 100. - /// - /// The integer interval is as default 1 and can be changed with - /// @ref SetIntInterval. - /// - /// @param[in] start Integer start value - /// @param[in] end Integer end value - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - void SetIntRange(int start, int end) - { - m_interface->kodi_gui->control_slider->set_int_range(m_interface->kodiBase, m_controlHandle, start, end); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To set the the range as integer of slider, e.g. -10 is the slider + /// start and e.g. +10 is the from here defined position where it reach the + /// end. + /// + /// Ad default is the range from 0 to 100. + /// + /// The integer interval is as default 1 and can be changed with + /// @ref SetIntInterval. + /// + /// @param[in] start Integer start value + /// @param[in] end Integer end value + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + void SetIntRange(int start, int end) + { + m_interface->kodi_gui->control_slider->set_int_range(m_interface->kodiBase, m_controlHandle, + start, end); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup CSlider - /// @brief Set the slider position with the given integer value. The Range - /// must be defined with a call from \ref SetIntRange before. - /// - /// @param[in] value Position in range to set with integer - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - void SetIntValue(int value) - { - m_interface->kodi_gui->control_slider->set_int_value(m_interface->kodiBase, m_controlHandle, value); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup CSlider + /// @brief Set the slider position with the given integer value. The Range + /// must be defined with a call from \ref SetIntRange before. + /// + /// @param[in] value Position in range to set with integer + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + void SetIntValue(int value) + { + m_interface->kodi_gui->control_slider->set_int_value(m_interface->kodiBase, m_controlHandle, + value); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To get the current position as integer value. - /// - /// @return The position as integer - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only - /// one each can be used. - /// - int GetIntValue() const - { - return m_interface->kodi_gui->control_slider->get_int_value(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To get the current position as integer value. + /// + /// @return The position as integer + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only + /// one each can be used. + /// + int GetIntValue() const + { + return m_interface->kodi_gui->control_slider->get_int_value(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To set the interval steps of slider, as default is it 1. If it - /// becomes changed with this function will a step of the user with the - /// value fixed here be executed. - /// - /// @param[in] interval Intervall step to set. - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - void SetIntInterval(int interval) - { - m_interface->kodi_gui->control_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, interval); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To set the interval steps of slider, as default is it 1. If it + /// becomes changed with this function will a step of the user with the + /// value fixed here be executed. + /// + /// @param[in] interval Intervall step to set. + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + void SetIntInterval(int interval) + { + m_interface->kodi_gui->control_slider->set_int_interval(m_interface->kodiBase, m_controlHandle, + interval); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Sets the percent of the slider. - /// - /// @param[in] percent float - Percent value of slide - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - void SetPercentage(float percent) - { - m_interface->kodi_gui->control_slider->set_percentage(m_interface->kodiBase, m_controlHandle, percent); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Sets the percent of the slider. + /// + /// @param[in] percent float - Percent value of slide + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + void SetPercentage(float percent) + { + m_interface->kodi_gui->control_slider->set_percentage(m_interface->kodiBase, m_controlHandle, + percent); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Returns a float of the percent of the slider. - /// - /// @return float - Percent of slider - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - float GetPercentage() const - { - return m_interface->kodi_gui->control_slider->get_percentage(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Returns a float of the percent of the slider. + /// + /// @return float - Percent of slider + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + float GetPercentage() const + { + return m_interface->kodi_gui->control_slider->get_percentage(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To set the the range as float of slider, e.g. -25.0 is the slider - /// start and e.g. +25.0 is the from here defined position where it reach - /// the end. - /// - /// As default is the range 0.0 to 1.0. - /// - /// The float interval is as default 0.1 and can be changed with - /// @ref SetFloatInterval. - /// - /// @param[in] start Integer start value - /// @param[in] end Integer end value - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only - /// one each can be used. - /// - void SetFloatRange(float start, float end) - { - m_interface->kodi_gui->control_slider->set_float_range(m_interface->kodiBase, m_controlHandle, start, end); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To set the the range as float of slider, e.g. -25.0 is the slider + /// start and e.g. +25.0 is the from here defined position where it reach + /// the end. + /// + /// As default is the range 0.0 to 1.0. + /// + /// The float interval is as default 0.1 and can be changed with + /// @ref SetFloatInterval. + /// + /// @param[in] start Integer start value + /// @param[in] end Integer end value + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only + /// one each can be used. + /// + void SetFloatRange(float start, float end) + { + m_interface->kodi_gui->control_slider->set_float_range(m_interface->kodiBase, m_controlHandle, + start, end); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief Set the slider position with the given float value. The Range - /// can be defined with a call from \ref SetIntRange before, as default it - /// is 0.0 to 1.0. - /// - /// @param[in] value Position in range to set with float - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only one - /// each can be used. - /// - void SetFloatValue(float value) - { - m_interface->kodi_gui->control_slider->set_float_value(m_interface->kodiBase, m_controlHandle, value); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief Set the slider position with the given float value. The Range + /// can be defined with a call from \ref SetIntRange before, as default it + /// is 0.0 to 1.0. + /// + /// @param[in] value Position in range to set with float + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only one + /// each can be used. + /// + void SetFloatValue(float value) + { + m_interface->kodi_gui->control_slider->set_float_value(m_interface->kodiBase, m_controlHandle, + value); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To get the current position as float value. - /// - /// @return The position as float - /// - float GetFloatValue() const - { - return m_interface->kodi_gui->control_slider->get_float_value(m_interface->kodiBase, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To get the current position as float value. + /// + /// @return The position as float + /// + float GetFloatValue() const + { + return m_interface->kodi_gui->control_slider->get_float_value(m_interface->kodiBase, + m_controlHandle); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CSlider - /// @brief To set the interval steps of slider, as default is it 0.1 If it - /// becomes changed with this function will a step of the user with the - /// value fixed here be executed. - /// - /// @param[in] interval Intervall step to set. - /// - /// @note Percent, floating point or integer are alone possible. Combining - /// these different values can be not together and can, therefore, only - /// one each can be used. - /// - void SetFloatInterval(float interval) - { - m_interface->kodi_gui->control_slider->set_float_interval(m_interface->kodiBase, m_controlHandle, interval); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CSlider + /// @brief To set the interval steps of slider, as default is it 0.1 If it + /// becomes changed with this function will a step of the user with the + /// value fixed here be executed. + /// + /// @param[in] interval Intervall step to set. + /// + /// @note Percent, floating point or integer are alone possible. Combining + /// these different values can be not together and can, therefore, only + /// one each can be used. + /// + void SetFloatInterval(float interval) + { + m_interface->kodi_gui->control_slider->set_float_interval(m_interface->kodiBase, + m_controlHandle, interval); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ 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 index f3017b5..db8d491 100644 --- 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 @@ -61,7 +61,7 @@ namespace controls } AddonGUISpinControlType; //---------------------------------------------------------------------------- - class CSpin : public CAddonGUIControlBase + class ATTRIBUTE_HIDDEN CSpin : public CAddonGUIControlBase { public: //========================================================================== 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 index 13ce1da..b4e8ae0 100644 --- 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 @@ -18,147 +18,150 @@ namespace gui namespace controls { - //============================================================================ +//============================================================================ +/// +/// \defgroup cpp_kodi_gui_controls_CTextBox Control Text Box +/// \ingroup cpp_kodi_gui +/// @brief \cpp_class{ kodi::gui::controls::CTextBox } +/// **Used to show a multi-page piece of text** +/// +/// The text box control can be used to display descriptions, help texts or +/// other larger texts. It corresponds to the representation which is also to +/// be seen on the CDialogTextViewer. +/// +/// It has the header \ref TextBox.h "#include " +/// be included to enjoy it. +/// +/// Here you find the needed skin part for a \ref Text_Box "textbox control". +/// +/// @note The call of the control is only possible from the corresponding +/// window as its class and identification number is required. +/// +class ATTRIBUTE_HIDDEN CTextBox : public CAddonGUIControlBase +{ +public: + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief Construct a new control + /// + /// @param[in] window related window control class + /// @param[in] controlId Used skin xml control id /// - /// \defgroup cpp_kodi_gui_controls_CTextBox Control Text Box - /// \ingroup cpp_kodi_gui - /// @brief \cpp_class{ kodi::gui::controls::CTextBox } - /// **Used to show a multi-page piece of text** + CTextBox(CWindow* window, int controlId) : CAddonGUIControlBase(window) + { + m_controlHandle = m_interface->kodi_gui->window->get_control_text_box( + m_interface->kodiBase, m_Window->GetControlHandle(), controlId); + if (!m_controlHandle) + kodi::Log(ADDON_LOG_FATAL, + "kodi::gui::controls::CTextBox can't create control class from Kodi !!!"); + } + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// The text box control can be used to display descriptions, help texts or - /// other larger texts. It corresponds to the representation which is also to - /// be seen on the CDialogTextViewer. + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief Destructor /// - /// It has the header \ref TextBox.h "#include " - /// be included to enjoy it. + ~CTextBox() override = default; + //-------------------------------------------------------------------------- + + //========================================================================== /// - /// Here you find the needed skin part for a \ref Text_Box "textbox control". + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief Set the control on window to visible /// - /// @note The call of the control is only possible from the corresponding - /// window as its class and identification number is required. + /// @param[in] visible If true visible, otherwise hidden /// - class CTextBox : public CAddonGUIControlBase + void SetVisible(bool visible) { - public: - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief Construct a new control - /// - /// @param[in] window related window control class - /// @param[in] controlId Used skin xml control id - /// - CTextBox(CWindow* window, int controlId) - : CAddonGUIControlBase(window) - { - m_controlHandle = m_interface->kodi_gui->window->get_control_text_box(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); - if (!m_controlHandle) - kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CTextBox can't create control class from Kodi !!!"); - } - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief Destructor - /// - ~CTextBox() override = default; - //-------------------------------------------------------------------------- - - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief Set the control on window to visible - /// - /// @param[in] visible If true visible, otherwise hidden - /// - void SetVisible(bool visible) - { - m_interface->kodi_gui->control_text_box->set_visible(m_interface->kodiBase, m_controlHandle, visible); - } - //-------------------------------------------------------------------------- + m_interface->kodi_gui->control_text_box->set_visible(m_interface->kodiBase, m_controlHandle, + visible); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief To reset box an remove all the text - /// - void Reset() - { - m_interface->kodi_gui->control_text_box->reset(m_controlHandle, m_controlHandle); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief To reset box an remove all the text + /// + void Reset() { m_interface->kodi_gui->control_text_box->reset(m_controlHandle, m_controlHandle); } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief To set the text on box - /// - /// @param[in] text Text to show - /// - void SetText(const std::string& text) - { - m_interface->kodi_gui->control_text_box->set_text(m_interface->kodiBase, m_controlHandle, text.c_str()); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief To set the text on box + /// + /// @param[in] text Text to show + /// + void SetText(const std::string& text) + { + m_interface->kodi_gui->control_text_box->set_text(m_interface->kodiBase, m_controlHandle, + text.c_str()); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief Get the used text from control - /// - /// @return Text shown - /// - std::string GetText() const + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief Get the used text from control + /// + /// @return Text shown + /// + std::string GetText() const + { + std::string text; + char* ret = + m_interface->kodi_gui->control_text_box->get_text(m_interface->kodiBase, m_controlHandle); + if (ret != nullptr) { - std::string text; - char* ret = m_interface->kodi_gui->control_text_box->get_text(m_interface->kodiBase, m_controlHandle); - if (ret != nullptr) - { - if (std::strlen(ret)) - text = ret; - m_interface->free_string(m_interface->kodiBase, ret); - } - return text; + if (std::strlen(ret)) + text = ret; + m_interface->free_string(m_interface->kodiBase, ret); } - //-------------------------------------------------------------------------- + return text; + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief To scroll text on other position - /// - /// @param[in] position The line position to scroll to - /// - void Scroll(unsigned int position) - { - m_interface->kodi_gui->control_text_box->scroll(m_interface->kodiBase, m_controlHandle, position); - } - //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief To scroll text on other position + /// + /// @param[in] position The line position to scroll to + /// + void Scroll(unsigned int position) + { + m_interface->kodi_gui->control_text_box->scroll(m_interface->kodiBase, m_controlHandle, + position); + } + //-------------------------------------------------------------------------- - //========================================================================== - /// - /// \ingroup cpp_kodi_gui_controls_CTextBox - /// @brief To set automatic scrolling of textbox - /// - /// Specifies the timing and conditions of any autoscrolling this textbox - /// should have. Times are in milliseconds. The content is delayed for the - /// given delay, then scrolls at a rate of one line per time interval until - /// the end. If the repeat tag is present, it then delays for the repeat - /// time, fades out over 1 second, and repeats. It does not wrap or reset - /// to the top at the end of the scroll. - /// - /// @param[in] delay Content delay - /// @param[in] time One line per time interval - /// @param[in] repeat Delays with given time, fades out over 1 - /// second, and repeats - /// - void SetAutoScrolling(int delay, int time, int repeat) - { - m_interface->kodi_gui->control_text_box->set_auto_scrolling(m_interface->kodiBase, m_controlHandle, delay, time, repeat); - } - //-------------------------------------------------------------------------- - }; + //========================================================================== + /// + /// \ingroup cpp_kodi_gui_controls_CTextBox + /// @brief To set automatic scrolling of textbox + /// + /// Specifies the timing and conditions of any autoscrolling this textbox + /// should have. Times are in milliseconds. The content is delayed for the + /// given delay, then scrolls at a rate of one line per time interval until + /// the end. If the repeat tag is present, it then delays for the repeat + /// time, fades out over 1 second, and repeats. It does not wrap or reset + /// to the top at the end of the scroll. + /// + /// @param[in] delay Content delay + /// @param[in] time One line per time interval + /// @param[in] repeat Delays with given time, fades out over 1 + /// second, and repeats + /// + void SetAutoScrolling(int delay, int time, int repeat) + { + m_interface->kodi_gui->control_text_box->set_auto_scrolling( + m_interface->kodiBase, m_controlHandle, delay, time, repeat); + } + //-------------------------------------------------------------------------- +}; } /* namespace controls */ } /* namespace gui */ -- cgit v1.2.3