11 #include "../../AddonBase.h"
12 #include "../../c-api/gui/dialogs/progress.h"
61 using namespace ::kodi::addon;
62 m_DialogHandle = CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->new_dialog(
63 CAddonBase::m_interface->toKodi->kodiBase);
66 "kodi::gui::dialogs::CProgress can't create window class from Kodi !!!");
76 using namespace ::kodi::addon;
78 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->delete_dialog(
79 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle);
89 using namespace ::kodi::addon;
90 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->open(
91 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle);
103 using namespace ::kodi::addon;
104 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_heading(
105 CAddonBase::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 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_line(
120 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, iLine, line.c_str());
132 using namespace ::kodi::addon;
133 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_can_cancel(
134 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, canCancel);
146 using namespace ::kodi::addon;
147 return CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->is_canceled(
148 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle);
160 using namespace ::kodi::addon;
161 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_percentage(
162 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, percentage);
174 using namespace ::kodi::addon;
175 return CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->get_percentage(
176 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle);
188 using namespace ::kodi::addon;
189 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->show_progress_bar(
190 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, onOff);
202 using namespace ::kodi::addon;
203 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_progress_max(
204 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, max);
216 using namespace ::kodi::addon;
217 CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->set_progress_advance(
218 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle, steps);
230 using namespace ::kodi::addon;
231 return CAddonBase::m_interface->toKodi->kodi_gui->dialogProgress->abort(
232 CAddonBase::m_interface->toKodi->kodiBase, m_DialogHandle);
237 KODI_GUI_HANDLE m_DialogHandle;
Definition: Progress.h:53
@ ADDON_LOG_FATAL
4 : To notify fatal unrecoverable errors, which can may also indicate upcoming crashes.
Definition: addon_base.h:187
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 ATTRIBUTE_HIDDEN Log(const AddonLog loglevel, const char *format,...)
Add a message to Kodi's log.
Definition: AddonBase.h:749