summaryrefslogtreecommitdiffstats
path: root/libkdepim/broadcaststatus.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /libkdepim/broadcaststatus.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/broadcaststatus.h')
-rw-r--r--libkdepim/broadcaststatus.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/libkdepim/broadcaststatus.h b/libkdepim/broadcaststatus.h
new file mode 100644
index 000000000..e15ca87db
--- /dev/null
+++ b/libkdepim/broadcaststatus.h
@@ -0,0 +1,93 @@
+/*
+ broadcaststatus.h
+
+ This file is part of KDEPIM.
+
+ Copyright (C) 2000 Don Sanders <sanders@kde.org>
+
+ License GPL
+*/
+
+#ifndef __kpim_broadcast_status_h
+#define __kpim_broadcast_status_h
+
+#include <qobject.h>
+#include <qmap.h>
+
+#include <kdepimmacros.h>
+
+#undef None
+
+namespace KPIM {
+
+class ProgressItem;
+
+/**
+ Provides a singleton which broadcasts status messages by emitting
+ signals. Interested mainwindows can connect to the statusMsg()
+ signal and update statusBars or whatever they use for showing status.
+ */
+
+
+class KDE_EXPORT BroadcastStatus : public QObject
+{
+
+ Q_OBJECT
+
+public:
+ virtual ~BroadcastStatus();
+
+ /** Return the instance of the singleton object for this class */
+ static BroadcastStatus *instance();
+
+ /** Return the last status message from setStatusMsg() */
+ QString statusMsg() const { return mStatusMsg; }
+ /** Sets a status bar message with timestamp */
+ void setStatusMsgWithTimestamp( const QString& message );
+ /** Sets a transmission completed status bar message */
+ void setStatusMsgTransmissionCompleted( int numMessages,
+ int numBytes = -1,
+ int numBytesRead = -1,
+ int numBytesToRead = -1,
+ bool mLeaveOnServer = false,
+ KPIM::ProgressItem* progressItem = 0 ); // set the same status in this progress item
+ void setStatusMsgTransmissionCompleted( const QString& account,
+ int numMessages,
+ int numBytes = -1,
+ int numBytesRead = -1,
+ int numBytesToRead = -1,
+ bool mLeaveOnServer = false,
+ KPIM::ProgressItem* progressItem = 0 ); // set the same status in this progress item
+
+public slots:
+ /** Emit an update status bar signal. It's a slot so it can be hooked up
+ to other signals. */
+ void setStatusMsg( const QString& message );
+
+ /**
+ Set a status message that will go away again with the next call of
+ reset().
+ */
+ void setTransientStatusMsg( const QString& msg );
+ /**
+ Reset the status message to what ever non-transient message was last
+ active or has since been set.
+ */
+ void reset();
+
+signals:
+
+ /** Emitted when setStatusMsg is called. */
+ void statusMsg( const QString& );
+
+protected:
+
+ BroadcastStatus();
+ QString mStatusMsg;
+ bool mTransientActive;
+ static BroadcastStatus* instance_;
+};
+
+
+}
+#endif