KPIM::ProgressItem

Search for usage in LXR

#include <progressmanager.h>

Inheritance diagram for KPIM::ProgressItem:

Public Types

enum  CryptoStatus { Encrypted , Unencrypted , Unknown }
 
- Public Types inherited from QObject
typedef  QObjectList
 

Signals

void progressItemAdded (KPIM::ProgressItem *)
 
void progressItemCanceled (KPIM::ProgressItem *)
 
void progressItemCompleted (KPIM::ProgressItem *)
 
void progressItemCryptoStatus (KPIM::ProgressItem *, KPIM::ProgressItem::CryptoStatus)
 
void progressItemLabel (KPIM::ProgressItem *, const QString &)
 
void progressItemProgress (KPIM::ProgressItem *, unsigned int)
 
void progressItemStatus (KPIM::ProgressItem *, const QString &)
 
void progressItemUsesBusyIndicator (KPIM::ProgressItem *item, bool value)
 

Public Member Functions

void addChild (ProgressItem *kiddo)
 
bool canBeCanceled () const
 
void cancel ()
 
bool canceled () const
 
unsigned int completedItems () const
 
CryptoStatus cryptoStatus () const
 
const QStringid () const
 
void incCompletedItems (unsigned int v=1)
 
const QStringlabel () const
 
ProgressItemparent () const
 
unsigned int progress () const
 
void removeChild (ProgressItem *kiddo)
 
void reset ()
 
void setCanBeCanceled (bool b)
 
void setComplete ()
 
void setCompletedItems (unsigned int v)
 
void setCryptoStatus (ProgressItem::CryptoStatus v)
 
void setLabel (const QString &v)
 
void setProgress (unsigned int v)
 
void setStatus (const QString &v)
 
void setTotalItems (unsigned int v)
 
void setTypeProgressItem (unsigned int)
 
void setUsesBusyIndicator (bool useBusyIndicator)
 
const QStringstatus () const
 
unsigned int totalItems () const
 
unsigned int typeProgressItem () const
 
void updateProgress ()
 
bool usesBusyIndicator () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

 ProgressItem (ProgressItem *parent, const QString &id, const QString &label, const QString &status, bool isCancellable, CryptoStatus cryptoStatus)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Detailed Description

The ProgressItem class.

Definition at line 29 of file progressmanager.h.

Member Enumeration Documentation

◆ CryptoStatus

enum KPIM::ProgressItem::CryptoStatus

Definition at line 35 of file progressmanager.h.

Constructor & Destructor Documentation

◆ ProgressItem()

ProgressItem::ProgressItem ( ProgressItem * parent,
const QString & id,
const QString & label,
const QString & status,
bool isCancellable,
CryptoStatus cryptoStatus )
protected

Definition at line 19 of file progressmanager.cpp.

Member Function Documentation

◆ addChild()

void ProgressItem::addChild ( ProgressItem * kiddo)

Definition at line 58 of file progressmanager.cpp.

◆ canBeCanceled()

bool ProgressItem::canBeCanceled ( ) const
nodiscard
Returns
Whether this item can be canceled.

Definition at line 159 of file progressmanager.cpp.

◆ cancel()

void ProgressItem::cancel ( )

Definition at line 96 of file progressmanager.cpp.

◆ canceled()

bool ProgressItem::canceled ( ) const
nodiscard

Definition at line 81 of file progressmanager.cpp.

◆ completedItems()

unsigned int ProgressItem::completedItems ( ) const
nodiscard

Definition at line 390 of file progressmanager.cpp.

◆ cryptoStatus()

ProgressItem::CryptoStatus ProgressItem::cryptoStatus ( ) const
nodiscard
Returns
Whether this item uses secure communication (Account uses ssl, for example.).

Definition at line 169 of file progressmanager.cpp.

◆ id()

const QString & ProgressItem::id ( ) const
nodiscard
Returns
The id string which uniquely identifies the operation represented by this item.

Definition at line 127 of file progressmanager.cpp.

◆ incCompletedItems()

void ProgressItem::incCompletedItems ( unsigned int v = 1)

Definition at line 385 of file progressmanager.cpp.

◆ label()

const QString & ProgressItem::label ( ) const
nodiscard
Returns
The user visible string to be used to represent this item.

Definition at line 137 of file progressmanager.cpp.

◆ parent()

ProgressItem * ProgressItem::parent ( ) const
nodiscard
Returns
The parent item of this one, if there is one.

Definition at line 132 of file progressmanager.cpp.

◆ progress()

unsigned int ProgressItem::progress ( ) const
nodiscard
Returns
The current progress value of this item in percent.

Definition at line 191 of file progressmanager.cpp.

◆ progressItemAdded

void KPIM::ProgressItem::progressItemAdded ( KPIM::ProgressItem * )
signal

Emitted when a new ProgressItem is added.

Parameters
TheProgressItem that was added.

◆ progressItemCanceled

void KPIM::ProgressItem::progressItemCanceled ( KPIM::ProgressItem * )
signal

Emitted when an item was canceled.

It will not go away immediately, only when the owner sets it complete, which will usually happen. Can be used to visually indicate the canceled status of an item. Should be used by the owner of the item to make sure it is set completed even if it is canceled. There is a ProgressManager::slotStandardCancelHandler which simply sets the item completed and can be used if no other work needs to be done on cancel.

Parameters
Thecanceled item;

◆ progressItemCompleted

void KPIM::ProgressItem::progressItemCompleted ( KPIM::ProgressItem * )
signal

Emitted when a progress item was completed.

The item will be deleted afterwards, so slots connected to this are the last chance to work with this item.

Parameters
Thecompleted item.

◆ progressItemCryptoStatus

void KPIM::ProgressItem::progressItemCryptoStatus ( KPIM::ProgressItem * ,
KPIM::ProgressItem::CryptoStatus  )
signal

Emitted when the crypto status of an item changed.

Should be used by progress dialogs to update the crypto indicator of an item.

Parameters
Theupdated item.
Thenew state.

◆ progressItemLabel

void KPIM::ProgressItem::progressItemLabel ( KPIM::ProgressItem * ,
const QString &  )
signal

Emitted when the label of an item changed.

Should be used by progress dialogs to update the label of an item.

Parameters
Theupdated item.
Thenew label.

◆ progressItemProgress

void KPIM::ProgressItem::progressItemProgress ( KPIM::ProgressItem * ,
unsigned int  )
signal

Emitted when the progress value of an item changes.

Parameters
Theitem which got a new value.
Thevalue, for convenience.

◆ progressItemStatus

void KPIM::ProgressItem::progressItemStatus ( KPIM::ProgressItem * ,
const QString &  )
signal

Emitted when the status message of an item changed.

Should be used by progress dialogs to update the status message for an item.

Parameters
Theupdated item.
Thenew message.

◆ progressItemUsesBusyIndicator

void KPIM::ProgressItem::progressItemUsesBusyIndicator ( KPIM::ProgressItem * item,
bool value )
signal

Emitted when the busy indicator state of an item changes.

Should be used by progress dialogs so that they can adjust the display of the progress bar to the new mode.

Parameters
itemThe updated item
valueTrue if the item uses a busy indicator now, false otherwise

◆ removeChild()

void ProgressItem::removeChild ( ProgressItem * kiddo)

Definition at line 63 of file progressmanager.cpp.

◆ reset()

void ProgressItem::reset ( )

Reset the progress value of this item to 0 and the status string to the empty string.

Definition at line 51 of file progressmanager.cpp.

◆ setCanBeCanceled()

void ProgressItem::setCanBeCanceled ( bool b)
Parameters
bSet if can be canceled

Definition at line 164 of file progressmanager.cpp.

◆ setComplete()

void ProgressItem::setComplete ( )

Tell the item it has finished.

This will Q_EMIT progressItemCompleted() result in the destruction of the item after all slots connected to this signal have executed. This is the only way to get rid of an item and needs to be called even if the item is canceled. Don't use the item after this has been called on it.

Definition at line 31 of file progressmanager.cpp.

◆ setCompletedItems()

void ProgressItem::setCompletedItems ( unsigned int v)

Definition at line 380 of file progressmanager.cpp.

◆ setCryptoStatus()

void ProgressItem::setCryptoStatus ( ProgressItem::CryptoStatus v)

Set whether this item uses encrypted communication, so listeners can display a nice crypto icon.

Parameters
vThe value.

Definition at line 174 of file progressmanager.cpp.

◆ setLabel()

void ProgressItem::setLabel ( const QString & v)
Parameters
vSet the user visible string identifying this item.

Definition at line 142 of file progressmanager.cpp.

◆ setProgress()

void ProgressItem::setProgress ( unsigned int v)

Set the progress (percentage of completion) value of this item.

Parameters
vThe percentage value.

Definition at line 120 of file progressmanager.cpp.

◆ setStatus()

void ProgressItem::setStatus ( const QString & v)

Set the string to be used for showing this item's current status.

Parameters
vThe status string.

Definition at line 153 of file progressmanager.cpp.

◆ setTotalItems()

void KPIM::ProgressItem::setTotalItems ( unsigned int v)

Definition at line 370 of file progressmanager.cpp.

◆ setTypeProgressItem()

void ProgressItem::setTypeProgressItem ( unsigned int type)

Definition at line 91 of file progressmanager.cpp.

◆ setUsesBusyIndicator()

void ProgressItem::setUsesBusyIndicator ( bool useBusyIndicator)

Sets whether this item uses a busy indicator instead of real progress for its progress bar.

If it uses a busy indicator, you are still responsible for calling setProgress() from time to time to update the busy indicator.

Definition at line 185 of file progressmanager.cpp.

◆ status()

const QString & ProgressItem::status ( ) const
nodiscard
Returns
The string to be used for showing this item's current status.

Definition at line 148 of file progressmanager.cpp.

◆ totalItems()

unsigned int ProgressItem::totalItems ( ) const
nodiscard

Definition at line 375 of file progressmanager.cpp.

◆ typeProgressItem()

unsigned int ProgressItem::typeProgressItem ( ) const

Definition at line 86 of file progressmanager.cpp.

◆ updateProgress()

void ProgressItem::updateProgress ( )

Recalculate progress according to total/completed items and update.

Definition at line 115 of file progressmanager.cpp.

◆ usesBusyIndicator()

bool ProgressItem::usesBusyIndicator ( ) const
nodiscard
Returns
whether this item uses a busy indicator instead of real progress display

Definition at line 180 of file progressmanager.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.