4 This file is part of libkdepim.
6 Copyright (C) 2000 Don Sanders <sanders@kde.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef KDEPIM_BROADCASTSTATUS_H
24 #define KDEPIM_BROADCASTSTATUS_H
26 #include "kdepim_export.h"
36 Provides a singleton which broadcasts status messages by emitting
37 signals. Interested mainwindows can connect to the statusMsg()
38 signal and update statusBars or whatever they use for showing status.
40 class KDEPIM_EXPORT BroadcastStatus
: public QObject
46 virtual ~BroadcastStatus();
48 /** Return the instance of the singleton object for this class */
49 static BroadcastStatus
*instance();
51 /** Return the last status message from setStatusMsg() */
52 QString
statusMsg() const { return mStatusMsg
; }
54 /** Sets a status bar message with timestamp */
55 void setStatusMsgWithTimestamp( const QString
&message
);
57 /** Sets a transmission completed status bar message */
58 void setStatusMsgTransmissionCompleted( int numMessages
,
60 int numBytesRead
= -1,
61 int numBytesToRead
= -1,
62 bool mLeaveOnServer
= false,
63 KPIM::ProgressItem
*progressItem
= 0 );
64 void setStatusMsgTransmissionCompleted( const QString
&account
,
67 int numBytesRead
= -1,
68 int numBytesToRead
= -1,
69 bool mLeaveOnServer
= false,
70 KPIM::ProgressItem
*progressItem
= 0 );
74 Emit an update status bar signal. It's a slot so it can be hooked up
77 void setStatusMsg( const QString
&message
);
80 Set a status message that will go away again with the next call of
83 void setTransientStatusMsg( const QString
&msg
);
86 Reset the status message to what ever non-transient message was last
87 active or has since been set.
92 /** Emitted when setStatusMsg is called. */
93 void statusMsg( const QString
& );
98 bool mTransientActive
;