qbprogress.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: qbprogress.h,v $
00003                              -------------------
00004     cvs         : $Id: qbprogress.h,v 1.4 2006/01/20 14:15:15 cstim Exp $
00005     begin       : Mon Mar 01 2004
00006     copyright   : (C) 2004 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *          Please see toplevel file COPYING for license details           *
00011  ***************************************************************************/
00012 
00013 #ifndef QBANKING_PROGRESS_H
00014 #define QBANKING_PROGRESS_H
00015 
00016 
00017 #include "qbprogress.ui.h"
00018 #include <gwenhywfar/types.h>
00019 #include <aqbanking/banking.h>
00020 
00021 #include <time.h>
00022 
00023 
00024 #define QBPROGRESS_SHOWTIMEOUT 5
00025 
00026 
00027 class QString;
00028 
00029 
00030 class QBProgress: public QBProgressUI {
00031   Q_OBJECT
00032 
00033 public:
00034   typedef enum {
00035     ProgressTypeNormal=0,
00036     ProgressTypeSimple,
00037     ProgressTypeFast
00038   } ProgressType;
00039 
00040 private:
00041   GWEN_TYPE_UINT32 _id;
00042   ProgressType _progressType;
00043   bool _aborted;
00044   bool _closed;
00045   bool _doShowText;
00046   bool _shouldStay;
00047   GWEN_TYPE_UINT32 _total;
00048   GWEN_TYPE_UINT32 _lastProgress;
00049   QString _logtext;
00050   QString _units;
00051   time_t _startTime;
00052   time_t _lastTime;
00053 
00054   static int _openCount;
00055 
00056   bool _handleTime();
00057 
00058 protected:
00059   virtual void closeEvent(QCloseEvent *e);
00060 
00061 public:
00062   QBProgress(GWEN_TYPE_UINT32 id,
00063              ProgressType pt,
00064              const QString& title,
00065              const QString& text,
00066              const QString& units,
00067              QWidget* parent=0, const char* name=0, WFlags fl=0);
00068   ~QBProgress();
00069 
00070   int setTotalPos(GWEN_TYPE_UINT32 total);
00071 
00072   int start(GWEN_TYPE_UINT32 total);
00073   int advance(GWEN_TYPE_UINT32 progress);
00074   int log(AB_BANKING_LOGLEVEL level,
00075           const QString& text);
00076   int end();
00077 
00078   GWEN_TYPE_UINT32 getId();
00079   bool isClosed();
00080 
00081   bool shouldStay();
00082 
00083   void setProgressText(const QString &s);
00084   void setProgressUnits(const QString &s);
00085 
00086   virtual void show();
00087 
00088 protected slots:
00089   void abort();
00090 };
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 #endif /* QBANKING_PROGRESS_H */
00099 
00100 
00101 
00102 

Generated on Tue Apr 10 19:04:09 2007 for aqbanking by  doxygen 1.4.7