00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef QBANKING_WAIT_CALLBACK_H
00015 #define QBANKING_WAIT_CALLBACK_H
00016
00017 #include <gwenhywfar/gwenhywfarapi.h>
00018 #include <gwenhywfar/waitcallback.h>
00019 #include <gwenhywfar/misc.h>
00020
00021
00026 class QBWaitCallback {
00027 private:
00028 GWEN_WAITCALLBACK *_ctx;
00029
00030 static GWEN_WAITCALLBACK *_instantiate(GWEN_WAITCALLBACK *ctx);
00031 static GWEN_WAITCALLBACK_RESULT _checkAbort(GWEN_WAITCALLBACK *ctx,
00032 unsigned int level);
00033 static void _log(GWEN_WAITCALLBACK *ctx,
00034 unsigned int level,
00035 GWEN_LOGGER_LEVEL logLevel,
00036 const char *s);
00037 static void _freeData(void *bp, void *p);
00038
00039 protected:
00040 GWEN_WAITCALLBACK *cCallback();
00041
00042 public:
00049 GWEN_TYPE_UINT64 getProgressPos() const;
00050
00057 GWEN_TYPE_UINT64 getProgressTotal() const;
00058
00063 time_t lastCalled() const;
00064
00069 time_t lastEntered() const;
00070
00076 void setDistance(int d);
00077
00078 int nestingLevel() const;
00079
00080 GWEN_TYPE_UINT32 flags() const;
00081
00090
00096 virtual QBWaitCallback *instantiate();
00097
00098
00109 virtual GWEN_WAITCALLBACK_RESULT checkAbort(unsigned int level);
00110
00122 virtual void log(unsigned int level,
00123 GWEN_LOGGER_LEVEL loglevel,
00124 const char *s);
00125
00131 QBWaitCallback(const char *id);
00132 virtual ~QBWaitCallback();
00133
00134 public:
00135
00144 int registerCallback();
00145
00150 int unregisterCallback();
00151
00155 const char *getId() const;
00156
00157 const char *getText() const;
00158
00159 const char *getUnits() const;
00160
00163 int getDistance() const;
00164
00165
00166 };
00167
00168
00169 #endif
00170
00171