libkdepim

broadcaststatus.h

00001 /*
00002   broadcaststatus.h
00003 
00004   This file is part of KDEPIM.
00005 
00006   Copyright (C) 2000 Don Sanders <sanders@kde.org>
00007 
00008   License GPL
00009 */
00010 
00011 #ifndef __kpim_broadcast_status_h
00012 #define __kpim_broadcast_status_h
00013 
00014 #include <tqobject.h>
00015 #include <tqmap.h>
00016 
00017 #include <kdepimmacros.h>
00018 
00019 #undef None
00020 
00021 namespace KPIM {
00022 
00023 class ProgressItem;
00024 
00032 class KDE_EXPORT BroadcastStatus : public TQObject
00033 {
00034 
00035   Q_OBJECT
00036   TQ_OBJECT
00037 
00038 public:
00039   virtual ~BroadcastStatus();
00040 
00042   static BroadcastStatus *instance();
00043 
00045   TQString statusMsg() const { return mStatusMsg; }
00047   void setStatusMsgWithTimestamp( const TQString& message );
00049   void setStatusMsgTransmissionCompleted( int numMessages,
00050                                           int numBytes = -1,
00051                                           int numBytesRead = -1,
00052                                           int numBytesToRead = -1,
00053                                           bool mLeaveOnServer = false,
00054                                           KPIM::ProgressItem* progressItem = 0 ); // set the same status in this progress item
00055   void setStatusMsgTransmissionCompleted( const TQString& account,
00056                                           int numMessages,
00057                                           int numBytes = -1,
00058                                           int numBytesRead = -1,
00059                                           int numBytesToRead = -1,
00060                                           bool mLeaveOnServer = false,
00061                                           KPIM::ProgressItem* progressItem = 0 ); // set the same status in this progress item
00062 
00063 public slots:
00066   void setStatusMsg( const TQString& message );
00067 
00072   void setTransienStatusMsg( const TQString& msg );
00077   void reset();
00078 
00079 signals:
00080 
00082   void statusMsg( const TQString& );
00083 
00084 protected:
00085 
00086   BroadcastStatus();
00087   TQString mStatusMsg;
00088   bool mTransientActive;
00089   static BroadcastStatus* instance_;
00090 };
00091 
00092 
00093 }
00094 #endif