Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Dialog Progress

Class: kodi::gui::dialogs::CProgress

Progress dialog shown in center
The with #include <kodi/gui/dialogs/Progress.h> given class are basically used to create Kodi's progress dialog with named text fields. More...

Functions

 kodi::gui::dialogs::CProgress::CProgress ()
 Construct a new dialog.
 
 kodi::gui::dialogs::CProgress::~CProgress ()
 Destructor.
 
void kodi::gui::dialogs::CProgress::Open ()
 To open the dialog.
 
void kodi::gui::dialogs::CProgress::SetHeading (const std::string &heading)
 Set the heading title of dialog.
 
void kodi::gui::dialogs::CProgress::SetLine (unsigned int iLine, const std::string &line)
 To set the line text field on dialog from 0 - 2.
 
void kodi::gui::dialogs::CProgress::SetCanCancel (bool canCancel)
 To enable and show cancel button on dialog.
 
bool kodi::gui::dialogs::CProgress::IsCanceled () const
 To check dialog for clicked cancel button.
 
void kodi::gui::dialogs::CProgress::SetPercentage (int percentage)
 Get the current progress position as percent.
 
int kodi::gui::dialogs::CProgress::GetPercentage () const
 To set the current progress position as percent.
 
void kodi::gui::dialogs::CProgress::ShowProgressBar (bool onOff)
 To show or hide progress bar dialog.
 
void kodi::gui::dialogs::CProgress::SetProgressMax (int max)
 Set the maximum position of progress, needed if SetProgressAdvance(...) is used.
 
void kodi::gui::dialogs::CProgress::SetProgressAdvance (int steps=1)
 To increase progress bar by defined step size until reach of maximum position.
 
bool kodi::gui::dialogs::CProgress::Abort ()
 To check progress was canceled on work.
 

Detailed Description

Class: kodi::gui::dialogs::CProgress

Progress dialog shown in center
The with #include <kodi/gui/dialogs/Progress.h> given class are basically used to create Kodi's progress dialog with named text fields.

Example:

progress->SetHeading("Test progress");
progress->SetLine(1, "line 1");
progress->SetLine(2, "line 2");
progress->SetLine(3, "line 3");
progress->SetCanCancel(true);
progress->ShowProgressBar(true);
progress->Open();
for (unsigned int i = 0; i < 100; i += 10)
{
progress->SetPercentage(i);
sleep(1);
}
delete progress;
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:53
void ShowProgressBar(bool onOff)
To show or hide progress bar dialog.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:186
void SetHeading(const std::string &heading)
Set the heading title of dialog.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:101
void SetLine(unsigned int iLine, const std::string &line)
To set the line text field on dialog from 0 - 2.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:116
void SetPercentage(int percentage)
Get the current progress position as percent.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:158
void SetCanCancel(bool canCancel)
To enable and show cancel button on dialog.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:130
void Open()
To open the dialog.
Definition kodi-dev-kit/include/kodi/gui/dialogs/progress.h:87
sleep(...)
<h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font co...

Function Documentation

◆ Abort()

bool kodi::gui::dialogs::CProgress::Abort ( )
inline

To check progress was canceled on work.

Returns
True if aborted

◆ CProgress()

kodi::gui::dialogs::CProgress::CProgress ( )
inline

Construct a new dialog.

◆ GetPercentage()

int kodi::gui::dialogs::CProgress::GetPercentage ( ) const
inline

To set the current progress position as percent.

Returns
Current Position used from 0 to 100

◆ IsCanceled()

bool kodi::gui::dialogs::CProgress::IsCanceled ( ) const
inline

To check dialog for clicked cancel button.

Returns
True if canceled

◆ Open()

void kodi::gui::dialogs::CProgress::Open ( )
inline

To open the dialog.

◆ SetCanCancel()

void kodi::gui::dialogs::CProgress::SetCanCancel ( bool canCancel)
inline

To enable and show cancel button on dialog.

Parameters
[in]canCancelif true becomes it shown

◆ SetHeading()

void kodi::gui::dialogs::CProgress::SetHeading ( const std::string & heading)
inline

Set the heading title of dialog.

Parameters
[in]headingTitle string to use

◆ SetLine()

void kodi::gui::dialogs::CProgress::SetLine ( unsigned int iLine,
const std::string & line )
inline

To set the line text field on dialog from 0 - 2.

Parameters
[in]iLineLine number
[in]lineText string

◆ SetPercentage()

void kodi::gui::dialogs::CProgress::SetPercentage ( int percentage)
inline

Get the current progress position as percent.

Parameters
[in]percentagePosition to use from 0 to 100

◆ SetProgressAdvance()

void kodi::gui::dialogs::CProgress::SetProgressAdvance ( int steps = 1)
inline

To increase progress bar by defined step size until reach of maximum position.

Parameters
[in]stepsStep size to increase, default is 1

◆ SetProgressMax()

void kodi::gui::dialogs::CProgress::SetProgressMax ( int max)
inline

Set the maximum position of progress, needed if SetProgressAdvance(...) is used.

Parameters
[in]maxBiggest usable position to use

◆ ShowProgressBar()

void kodi::gui::dialogs::CProgress::ShowProgressBar ( bool onOff)
inline

To show or hide progress bar dialog.

Parameters
[in]onOffIf true becomes it shown

◆ ~CProgress()

kodi::gui::dialogs::CProgress::~CProgress ( )
inline

Destructor.