summaryrefslogtreecommitdiffstats
path: root/libtdepim/broadcaststatus.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:57:02 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:57:02 -0600
commit2c2fbd828ca474671bb9e03681b30b115d8d6035 (patch)
tree526a9da418f8d3d7ccf515c37048d3dfc80f2843 /libtdepim/broadcaststatus.h
parentf0610eece3676b6fe99f42cf4ef2b19a39a5c4e8 (diff)
downloadtdepim-2c2fbd828ca474671bb9e03681b30b115d8d6035.tar.gz
tdepim-2c2fbd828ca474671bb9e03681b30b115d8d6035.zip
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'libtdepim/broadcaststatus.h')
-rw-r--r--libtdepim/broadcaststatus.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/libtdepim/broadcaststatus.h b/libtdepim/broadcaststatus.h
new file mode 100644
index 000000000..c29e0ff05
--- /dev/null
+++ b/libtdepim/broadcaststatus.h
@@ -0,0 +1,94 @@
+/*
+ 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 <tqobject.h>
+#include <tqmap.h>
+
+#include <tdepimmacros.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 TQObject
+{
+
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ virtual ~BroadcastStatus();
+
+ /** Return the instance of the singleton object for this class */
+ static BroadcastStatus *instance();
+
+ /** Return the last status message from seStatusMsg() */
+ TQString statusMsg() const { return mStatusMsg; }
+ /** Sets a status bar message with timestamp */
+ void seStatusMsgWithTimestamp( const TQString& message );
+ /** Sets a transmission completed status bar message */
+ void seStatusMsgTransmissionCompleted( 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 seStatusMsgTransmissionCompleted( const TQString& 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 seStatusMsg( const TQString& message );
+
+ /**
+ Set a status message that will go away again with the next call of
+ reset().
+ */
+ void setTransienStatusMsg( const TQString& msg );
+ /**
+ Reset the status message to what ever non-transient message was last
+ active or has since been set.
+ */
+ void reset();
+
+signals:
+
+ /** Emitted when seStatusMsg is called. */
+ void statusMsg( const TQString& );
+
+protected:
+
+ BroadcastStatus();
+ TQString mStatusMsg;
+ bool mTransientActive;
+ static BroadcastStatus* instance_;
+};
+
+
+}
+#endif