kmail Library API Documentation

kmbroadcaststatus.h

00001 /* KMail broadcast status message and related classes
00002 
00003    Copyright (C) 2000 Don Sanders <sanders@kde.org>
00004 
00005    License GPL
00006 */
00007 
00008 #ifndef __km_broadcast_status_h
00009 #define __km_broadcast_status_h
00010 
00011 #include <qwidget.h>
00012 #include <qframe.h>
00013 
00014 class KProgress;
00015 class QPushButton;
00016 class QWidgetStack;
00017 class QBoxLayout;
00018 class QLabel;
00019 namespace KMail {
00020   class SSLLabel;
00021 }
00022 using KMail::SSLLabel;
00023 #undef None
00024 
00032 class KMBroadcastStatus : public QObject
00033 {
00034 
00035   Q_OBJECT
00036 
00037 public:
00038 
00040   static KMBroadcastStatus *instance();
00042   void setStatusMsg( const QString& );
00044   void setStatusMsgWithTimestamp( const QString& message );
00046   void setStatusMsgTransmissionCompleted( int numMessages,
00047                                           int numBytes = -1,
00048                                           int numBytesRead = -1,
00049                                           int numBytesToRead = -1,
00050                                           bool mLeaveOnServer = false );
00051   void setStatusMsgTransmissionCompleted( const QString& account,
00052                                           int numMessages,
00053                                           int numBytes = -1,
00054                                           int numBytesRead = -1,
00055                                           int numBytesToRead = -1,
00056                                           bool mLeaveOnServer = false );
00058   void setStatusProgressEnable( const QString&, bool );
00060   void setStatusProgressPercent( const QString&, unsigned long );
00062   void setUsingSSL( bool );
00063 
00068   bool abortRequested();
00070   void reset();
00071 
00072 signals:
00073 
00075   void statusMsg( const QString& );
00077   void statusProgressEnable( bool );
00079   void statusProgressPercent( unsigned long );
00081   void resetRequested();
00083   void signalAbortRequested();
00084   void signalUsingSSL( bool );
00085 
00086 public slots:
00087 
00089   void requestAbort();
00090 
00091 protected:
00092 
00093   KMBroadcastStatus();
00094   static KMBroadcastStatus* instance_;
00095   bool abortRequested_;
00096   QMap<QString,unsigned long> ids;
00097 };
00098 
00101 class KMLittleProgressDlg : public QFrame {
00102 
00103   Q_OBJECT
00104 
00105 public:
00106 
00107   KMLittleProgressDlg( QWidget* parent, bool button = true );
00108 
00109 public slots:
00110 
00111   virtual void slotEnable( bool );
00112   virtual void slotJustPercent( unsigned long );
00113   virtual void slotClean();
00114   virtual void slotSetSSL( bool );
00115 
00116 protected:
00117   KProgress* m_pProgressBar;
00118   QLabel* m_pLabel;
00119   SSLLabel* m_sslLabel;
00120   QPushButton* m_pButton;
00121 
00122   enum Mode { None, Clean, Label, Progress };
00123 
00124   uint mode;
00125   bool m_bShowButton;
00126 
00127   void setMode();
00128 
00129   virtual bool eventFilter( QObject *, QEvent * );
00130   QBoxLayout *box;
00131   QWidgetStack *stack;
00132 };
00133 
00134 #endif
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:19 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003