diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Progress.h | 158 |
1 files changed, 81 insertions, 77 deletions
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 | |||
| 18 | namespace controls | 18 | namespace controls |
| 19 | { | 19 | { |
| 20 | 20 | ||
| 21 | //============================================================================ | 21 | //============================================================================ |
| 22 | /// | ||
| 23 | /// \defgroup cpp_kodi_gui_controls_CProgress Control Progress | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CProgress } | ||
| 26 | /// **Window control to show the progress of a particular operation** | ||
| 27 | /// | ||
| 28 | /// The progress control is used to show the progress of an item that may take | ||
| 29 | /// a long time, or to show how far through a movie you are. You can choose | ||
| 30 | /// the position, size, and look of the progress control. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Progress.h "#include <kodi/gui/controls/Progress.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref Progress_Control "progress control" | ||
| 36 | /// | ||
| 37 | /// @note The call of the control is only possible from the corresponding | ||
| 38 | /// window as its class and identification number is required. | ||
| 39 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CProgress : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | //========================================================================== | ||
| 44 | /// | ||
| 45 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 46 | /// @brief Construct a new control | ||
| 22 | /// | 47 | /// |
| 23 | /// \defgroup cpp_kodi_gui_controls_CProgress Control Progress | 48 | /// @param[in] window related window control class |
| 24 | /// \ingroup cpp_kodi_gui | 49 | /// @param[in] controlId Used skin xml control id |
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CProgress } | 50 | /// |
| 26 | /// **Window control to show the progress of a particular operation** | 51 | CProgress(CWindow* window, int controlId) : CAddonGUIControlBase(window) |
| 52 | { | ||
| 53 | m_controlHandle = m_interface->kodi_gui->window->get_control_progress( | ||
| 54 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, | ||
| 57 | "kodi::gui::controls::CProgress can't create control class from Kodi !!!"); | ||
| 58 | } | ||
| 59 | //-------------------------------------------------------------------------- | ||
| 60 | |||
| 61 | //========================================================================== | ||
| 27 | /// | 62 | /// |
| 28 | /// The progress control is used to show the progress of an item that may take | 63 | /// \ingroup cpp_kodi_gui_controls_CProgress |
| 29 | /// a long time, or to show how far through a movie you are. You can choose | 64 | /// @brief Destructor |
| 30 | /// the position, size, and look of the progress control. | ||
| 31 | /// | 65 | /// |
| 32 | /// It has the header \ref Progress.h "#include <kodi/gui/controls/Progress.h>" | 66 | ~CProgress() override = default; |
| 33 | /// be included to enjoy it. | 67 | //-------------------------------------------------------------------------- |
| 68 | |||
| 69 | //========================================================================== | ||
| 34 | /// | 70 | /// |
| 35 | /// Here you find the needed skin part for a \ref Progress_Control "progress control" | 71 | /// \ingroup cpp_kodi_gui_controls_CProgress |
| 72 | /// @brief Set the control on window to visible | ||
| 36 | /// | 73 | /// |
| 37 | /// @note The call of the control is only possible from the corresponding | 74 | /// @param[in] visible If true visible, otherwise hidden |
| 38 | /// window as its class and identification number is required. | ||
| 39 | /// | 75 | /// |
| 40 | class CProgress : public CAddonGUIControlBase | 76 | void SetVisible(bool visible) |
| 41 | { | 77 | { |
| 42 | public: | 78 | m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle, |
| 43 | //========================================================================== | 79 | visible); |
| 44 | /// | 80 | } |
| 45 | /// \ingroup cpp_kodi_gui_controls_CProgress | 81 | //-------------------------------------------------------------------------- |
| 46 | /// @brief Construct a new control | ||
| 47 | /// | ||
| 48 | /// @param[in] window related window control class | ||
| 49 | /// @param[in] controlId Used skin xml control id | ||
| 50 | /// | ||
| 51 | CProgress(CWindow* window, int controlId) | ||
| 52 | : CAddonGUIControlBase(window) | ||
| 53 | { | ||
| 54 | m_controlHandle = m_interface->kodi_gui->window->get_control_progress(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CProgress can't create control class from Kodi !!!"); | ||
| 57 | } | ||
| 58 | //-------------------------------------------------------------------------- | ||
| 59 | |||
| 60 | //========================================================================== | ||
| 61 | /// | ||
| 62 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 63 | /// @brief Destructor | ||
| 64 | /// | ||
| 65 | ~CProgress() override = default; | ||
| 66 | //-------------------------------------------------------------------------- | ||
| 67 | |||
| 68 | //========================================================================== | ||
| 69 | /// | ||
| 70 | /// \ingroup cpp_kodi_gui_controls_CProgress | ||
| 71 | /// @brief Set the control on window to visible | ||
| 72 | /// | ||
| 73 | /// @param[in] visible If true visible, otherwise hidden | ||
| 74 | /// | ||
| 75 | void SetVisible(bool visible) | ||
| 76 | { | ||
| 77 | m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle, visible); | ||
| 78 | } | ||
| 79 | //-------------------------------------------------------------------------- | ||
| 80 | 82 | ||
| 81 | //========================================================================== | 83 | //========================================================================== |
| 82 | /// | 84 | /// |
| 83 | /// \ingroup cpp_kodi_gui_controls_CProgress | 85 | /// \ingroup cpp_kodi_gui_controls_CProgress |
| 84 | /// @brief To set Percent position of control | 86 | /// @brief To set Percent position of control |
| 85 | /// | 87 | /// |
| 86 | /// @param[in] percent The percent position to use | 88 | /// @param[in] percent The percent position to use |
| 87 | /// | 89 | /// |
| 88 | void SetPercentage(float percent) | 90 | void SetPercentage(float percent) |
| 89 | { | 91 | { |
| 90 | m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, percent); | 92 | m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle, |
| 91 | } | 93 | percent); |
| 92 | //-------------------------------------------------------------------------- | 94 | } |
| 95 | //-------------------------------------------------------------------------- | ||
| 93 | 96 | ||
| 94 | //========================================================================== | 97 | //========================================================================== |
| 95 | /// | 98 | /// |
| 96 | /// \ingroup cpp_kodi_gui_controls_CProgress | 99 | /// \ingroup cpp_kodi_gui_controls_CProgress |
| 97 | /// @brief Get the active percent position of progress bar | 100 | /// @brief Get the active percent position of progress bar |
| 98 | /// | 101 | /// |
| 99 | /// @return Progress position as percent | 102 | /// @return Progress position as percent |
| 100 | /// | 103 | /// |
| 101 | float GetPercentage() const | 104 | float GetPercentage() const |
| 102 | { | 105 | { |
| 103 | return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, m_controlHandle); | 106 | return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase, |
| 104 | } | 107 | m_controlHandle); |
| 105 | //-------------------------------------------------------------------------- | 108 | } |
| 106 | }; | 109 | //-------------------------------------------------------------------------- |
| 110 | }; | ||
| 107 | 111 | ||
| 108 | } /* namespace controls */ | 112 | } /* namespace controls */ |
| 109 | } /* namespace gui */ | 113 | } /* namespace gui */ |
