11#include "../../AddonBase.h"
12#include "../../c-api/gui/dialogs/progress.h"
61 using namespace ::kodi::addon;
62 m_DialogHandle = CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->new_dialog(
63 CPrivateBase::m_interface->toKodi->kodiBase);
66 "kodi::gui::dialogs::CProgress can't create window class from Kodi !!!");
76 using namespace ::kodi::addon;
78 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->delete_dialog(
79 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle);
89 using namespace ::kodi::addon;
90 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->open(
91 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle);
103 using namespace ::kodi::addon;
104 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_heading(
105 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, heading.c_str());
116 void SetLine(
unsigned int iLine,
const std::string& line)
118 using namespace ::kodi::addon;
119 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_line(
120 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, iLine, line.c_str());
132 using namespace ::kodi::addon;
133 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_can_cancel(
134 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, canCancel);
146 using namespace ::kodi::addon;
147 return CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->is_canceled(
148 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle);
160 using namespace ::kodi::addon;
161 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_percentage(
162 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, percentage);
174 using namespace ::kodi::addon;
175 return CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->get_percentage(
176 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle);
188 using namespace ::kodi::addon;
189 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->show_progress_bar(
190 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, onOff);
202 using namespace ::kodi::addon;
203 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_progress_max(
204 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, max);
216 using namespace ::kodi::addon;
217 CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->set_progress_advance(
218 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle, steps);
230 using namespace ::kodi::addon;
231 return CPrivateBase::m_interface->toKodi->kodi_gui->dialogProgress->abort(
232 CPrivateBase::m_interface->toKodi->kodiBase, m_DialogHandle);
237 KODI_GUI_HANDLE m_DialogHandle;
@ ADDON_LOG_FATAL
4 : To notify fatal unrecoverable errors, which can may also indicate upcoming crashes.
Definition addon_base.h:197
void SetPercentage(int percentage)
Get the current progress position as percent.
Definition Progress.h:158
void SetCanCancel(bool canCancel)
To enable and show cancel button on dialog.
Definition Progress.h:130
void ShowProgressBar(bool onOff)
To show or hide progress bar dialog.
Definition Progress.h:186
void Open()
To open the dialog.
Definition Progress.h:87
bool Abort()
To check progress was canceled on work.
Definition Progress.h:228
void SetLine(unsigned int iLine, const std::string &line)
To set the line text field on dialog from 0 - 2.
Definition Progress.h:116
int GetPercentage() const
To set the current progress position as percent.
Definition Progress.h:172
void SetProgressMax(int max)
Set the maximum position of progress, needed if SetProgressAdvance(...) is used.
Definition Progress.h:200
~CProgress()
Destructor.
Definition Progress.h:74
bool IsCanceled() const
To check dialog for clicked cancel button.
Definition Progress.h:144
void SetProgressAdvance(int steps=1)
To increase progress bar by defined step size until reach of maximum position.
Definition Progress.h:214
CProgress()
Construct a new dialog.
Definition Progress.h:59
void SetHeading(const std::string &heading)
Set the heading title of dialog.
Definition Progress.h:101
void ATTR_DLL_LOCAL Log(const ADDON_LOG loglevel, const char *format,...)
Add a message to Kodi's log.
Definition AddonBase.h:1938