summaryrefslogtreecommitdiffstats
path: root/libkdepim/progressmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'libkdepim/progressmanager.h')
-rw-r--r--libkdepim/progressmanager.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libkdepim/progressmanager.h b/libkdepim/progressmanager.h
index b4233f8df..bf2842716 100644
--- a/libkdepim/progressmanager.h
+++ b/libkdepim/progressmanager.h
@@ -96,6 +96,18 @@ class KDE_EXPORT ProgressItem : public QObject
void setUsesCrypto( bool v );
/**
+ * @return whether this item uses a busy indicator instead of real progress display
+ */
+ bool usesBusyIndicator() const { return mUsesBusyIndicator; }
+
+ /**
+ * 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.
+ */
+ void setUsesBusyIndicator( bool useBusyIndicator );
+
+ /**
* @return The current progress value of this item in percent.
*/
unsigned int progress() const { return mProgress; }
@@ -192,6 +204,15 @@ signals:
*/
void progressItemUsesCrypto( KPIM::ProgressItem*, bool );
+ /**
+ * 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.
+ * @param item The updated item
+ * @param value True if the item uses a busy indicator now, false otherwise
+ */
+ void progressItemUsesBusyIndicator( KPIM::ProgressItem *item, bool value );
+
protected:
/* Only to be used by our good friend the ProgressManager */
@@ -217,6 +238,7 @@ signals:
bool mWaitingForKids;
bool mCanceled;
bool mUsesCrypto;
+ bool mUsesBusyIndicator;
};
/**
@@ -335,6 +357,9 @@ class KDE_EXPORT ProgressManager : public QObject
/**
* @return the only top level progressitem when there's only one.
* Returns 0 if there is no item, or more than one top level item.
+ * Since this is used to calculate the overall progress, it will also return
+ * 0 if there is an item which uses a busy indicator, since that will invalidate
+ * the overall progress.
*/
ProgressItem* singleItem() const;
@@ -361,6 +386,8 @@ class KDE_EXPORT ProgressManager : public QObject
void progressItemLabel( KPIM::ProgressItem*, const TQString& );
/** @see ProgressItem::progressItemUsesCrypto() */
void progressItemUsesCrypto( KPIM::ProgressItem*, bool );
+ /** @see ProgressItem::progressItemUsesBusyIndicator */
+ void progressItemUsesBusyIndicator( KPIM::ProgressItem*, bool );
/**
* Emitted when an operation requests the listeners to be shown.