summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h')
-rw-r--r--xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h b/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h
new file mode 100644
index 0000000..83b16aa
--- /dev/null
+++ b/xbmc/addons/kodi-dev-kit/include/kodi/gui/controls/Progress.h
@@ -0,0 +1,112 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../../c-api/gui/controls/progress.h"
12#include "../Window.h"
13
14#ifdef __cplusplus
15
16namespace kodi
17{
18namespace gui
19{
20namespace controls
21{
22
23//==============================================================================
24/// @defgroup cpp_kodi_gui_windows_controls_CProgress Control Progress
25/// @ingroup cpp_kodi_gui_windows_controls
26/// @brief @cpp_class{ kodi::gui::controls::CProgress }
27/// **Window control to show the progress of a particular operation**\n
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.
30///
31/// You can choose the position, size, and look of the progress control.
32///
33/// It has the header @ref Progress.h "#include <kodi/gui/controls/Progress.h>"
34/// be included to enjoy it.
35///
36/// Here you find the needed skin part for a @ref Progress_Control "progress control".
37///
38/// @note The call of the control is only possible from the corresponding
39/// window as its class and identification number is required.
40///
41class ATTRIBUTE_HIDDEN CProgress : public CAddonGUIControlBase
42{
43public:
44 //============================================================================
45 /// @ingroup cpp_kodi_gui_windows_controls_CProgress
46 /// @brief Construct a new control.
47 ///
48 /// @param[in] window Related window control class
49 /// @param[in] controlId Used skin xml control id
50 ///
51 CProgress(CWindow* window, int controlId) : CAddonGUIControlBase(window)
52 {
53 m_controlHandle = m_interface->kodi_gui->window->get_control_progress(
54 m_interface->kodiBase, m_Window->GetControlHandle(), controlId);
55 if (!m_controlHandle)
56 kodi::Log(ADDON_LOG_FATAL,
57 "kodi::gui::controls::CProgress can't create control class from Kodi !!!");
58 }
59 //----------------------------------------------------------------------------
60
61 //============================================================================
62 /// @ingroup cpp_kodi_gui_windows_controls_CProgress
63 /// @brief Destructor.
64 ///
65 ~CProgress() override = default;
66 //----------------------------------------------------------------------------
67
68 //============================================================================
69 /// @ingroup cpp_kodi_gui_windows_controls_CProgress
70 /// @brief Set the control on window to visible.
71 ///
72 /// @param[in] visible If true visible, otherwise hidden
73 ///
74 void SetVisible(bool visible)
75 {
76 m_interface->kodi_gui->control_progress->set_visible(m_interface->kodiBase, m_controlHandle,
77 visible);
78 }
79 //----------------------------------------------------------------------------
80
81 //============================================================================
82 /// @ingroup cpp_kodi_gui_windows_controls_CProgress
83 /// @brief To set Percent position of control.
84 ///
85 /// @param[in] percent The percent position to use
86 ///
87 void SetPercentage(float percent)
88 {
89 m_interface->kodi_gui->control_progress->set_percentage(m_interface->kodiBase, m_controlHandle,
90 percent);
91 }
92 //----------------------------------------------------------------------------
93
94 //============================================================================
95 /// @ingroup cpp_kodi_gui_windows_controls_CProgress
96 /// @brief Get the active percent position of progress bar.
97 ///
98 /// @return Progress position as percent
99 ///
100 float GetPercentage() const
101 {
102 return m_interface->kodi_gui->control_progress->get_percentage(m_interface->kodiBase,
103 m_controlHandle);
104 }
105 //----------------------------------------------------------------------------
106};
107
108} /* namespace controls */
109} /* namespace gui */
110} /* namespace kodi */
111
112#endif /* __cplusplus */