LeechCraft  0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
LeechCraft::ProcessStateInfo Struct Reference

State of a single process represented in a IJobHolder model. More...

#include "ijobholder.h"

Public Types

enum  State {
  State::Unknown,
  State::Running,
  State::Paused,
  State::Error
}
 Describes the state of the process. More...
 

Public Member Functions

 ProcessStateInfo ()=default
 Default-constructs a process description. More...
 
 ProcessStateInfo (qlonglong done, qlonglong total, TaskParameters params)
 Constructs the description with the given values. More...
 
 ProcessStateInfo (qlonglong done, qlonglong total, TaskParameters params, State state)
 Constructs the description with the given values and state. More...
 

Public Attributes

qlonglong Done_ = 0
 The amount of items already processed or downloaded. More...
 
qlonglong Total_ = 0
 The total amount of items to be processed or downloaded. More...
 
TaskParameters Params_ = {}
 The flags of the task as it was originally added to the downloader, if relevant. More...
 
enum LeechCraft::ProcessStateInfo::State State_ = State::Unknown
 

Detailed Description

State of a single process represented in a IJobHolder model.

This structure describes the a process represented by a row in an IJobHolder model and should be returned via the JobHolderRole::ProcessState role.

The value of the CustomDataRoles::RoleJobHolderRow role should be either JobHolderRow::DownloadProgress or JobHolderRow::ProcessProgress.

See also
IJobHolder
JobHolderRow

Definition at line 114 of file ijobholder.h.

Member Enumeration Documentation

◆ State

Describes the state of the process.

Enumerator
Unknown 

Unknown state.

Running 

The process is running just fine.

Paused 

The process is paused.

Error 

There was an error completing the process.

Definition at line 144 of file ijobholder.h.

Constructor & Destructor Documentation

◆ ProcessStateInfo() [1/3]

LeechCraft::ProcessStateInfo::ProcessStateInfo ( )
default

Default-constructs a process description.

◆ ProcessStateInfo() [2/3]

LeechCraft::ProcessStateInfo::ProcessStateInfo ( qlonglong  done,
qlonglong  total,
TaskParameters  params 
)
inline

Constructs the description with the given values.

Parameters
[in]doneThe value for the Done_ variable.
[in]totalThe value for the Total_ variable.
[in]paramsThe value for the Params_ variable.
See also
Done_
Total_
Params_

Definition at line 177 of file ijobholder.h.

References Unknown.

◆ ProcessStateInfo() [3/3]

LeechCraft::ProcessStateInfo::ProcessStateInfo ( qlonglong  done,
qlonglong  total,
TaskParameters  params,
State  state 
)
inline

Constructs the description with the given values and state.

Parameters
[in]doneThe value for the Done_ variable.
[in]totalThe value for the Total_ variable.
[in]paramsThe value for the Params_ variable.
[in]stateThe value for the State_ variable.
See also
Done_
Total_
Params_
State_

Definition at line 195 of file ijobholder.h.

Member Data Documentation

◆ Done_

qlonglong LeechCraft::ProcessStateInfo::Done_ = 0

The amount of items already processed or downloaded.

This can be the number of already downloaded bytes in an HTTP client, a number of messages fetched in an email client, and so on.

Definition at line 122 of file ijobholder.h.

Referenced by LeechCraft::Util::SetJobHolderProgress().

◆ Params_

TaskParameters LeechCraft::ProcessStateInfo::Params_ = {}

The flags of the task as it was originally added to the downloader, if relevant.

This field only makes sense if the relevant process is a download process, that is, if value of the CustomDataRoles::RoleJobHolderRow role is JobHolderRow::DownloadProgress.

Definition at line 140 of file ijobholder.h.

◆ State_

enum LeechCraft::ProcessStateInfo::State LeechCraft::ProcessStateInfo::State_ = State::Unknown

◆ Total_

qlonglong LeechCraft::ProcessStateInfo::Total_ = 0

The total amount of items to be processed or downloaded.

This can be the number of already downloaded bytes in an HTTP client, a number of messages fetched in an email client, and so on.

Definition at line 130 of file ijobholder.h.


The documentation for this struct was generated from the following file: