#include <qbwaitcallback.h>
Inheritance diagram for QBWaitCallback:
Definition at line 26 of file qbwaitcallback.h.
Functions Called by Gwenhywfar | |
These are functions internally called by Gwenhywfar. You should never call one of these functions from within your own code ! | |
virtual QBWaitCallback * | instantiate () |
virtual GWEN_WAITCALLBACK_RESULT | checkAbort (unsigned int level) |
virtual void | log (unsigned int level, GWEN_LOGGER_LEVEL loglevel, const char *s) |
QBWaitCallback (const char *id) | |
virtual | ~QBWaitCallback () |
int | registerCallback () |
int | unregisterCallback () |
const char * | getId () const |
const char * | getText () const |
const char * | getUnits () const |
Public Member Functions | |
GWEN_TYPE_UINT64 | getProgressPos () const |
GWEN_TYPE_UINT64 | getProgressTotal () const |
time_t | lastCalled () const |
time_t | lastEntered () const |
void | setDistance (int d) |
int | nestingLevel () const |
GWEN_TYPE_UINT32 | flags () const |
int | getDistance () const |
Protected Member Functions | |
GWEN_WAITCALLBACK * | cCallback () |
QBWaitCallback::QBWaitCallback | ( | const char * | id | ) |
Constructor. Please note that this callback is freed by Gwenhywfar, you should never try to free this callback yourself once it has been registered.
virtual QBWaitCallback::~QBWaitCallback | ( | ) | [virtual] |
GWEN_WAITCALLBACK* QBWaitCallback::cCallback | ( | ) | [protected] |
GWEN_TYPE_UINT64 QBWaitCallback::getProgressPos | ( | ) | const |
Returns the current progress position (as set by GWEN_WaitCallback_SetProgressPos). This can be used by the callback context to correctly display a progress bar.
GWEN_TYPE_UINT64 QBWaitCallback::getProgressTotal | ( | ) | const |
Returns the progress total (as set by GWEN_WaitCallback_SetProgressTotal). This can be used by the callback context to correctly display a progress bar.
time_t QBWaitCallback::lastCalled | ( | ) | const |
Returns the time when the callback function was last called (or 0 if it has never been called)
time_t QBWaitCallback::lastEntered | ( | ) | const |
Returns the time when the callback context was last entered (or 0 if it never has been).
void QBWaitCallback::setDistance | ( | int | d | ) |
Sets the proposed distance in milliseconds between two calls to the callback. This value is never enforced by the callback mechanism itself.
int QBWaitCallback::nestingLevel | ( | ) | const |
GWEN_TYPE_UINT32 QBWaitCallback::flags | ( | ) | const |
virtual QBWaitCallback* QBWaitCallback::instantiate | ( | ) | [virtual] |
Uses this callback as a template to instantiate a new one. For GUI callbacks this function can be used to open a window (such as progress dialogs etc).
Reimplemented in QBFastCallback, QBProgressCallback, and QBSimpleCallback.
virtual GWEN_WAITCALLBACK_RESULT QBWaitCallback::checkAbort | ( | unsigned int | level | ) | [virtual] |
Checks whether the user wants to abort the current action. This function is optional.
level | If the context given to GWEN_WaitCallback_Enter did not exist then a new default context has been created which uses the functions (like this one) of the at that time active context. For such an artificially derived context the level represents the current level below the context given as parameter ctx. So if the level is 0 then the given context actually is the currently active one. |
Reimplemented in QBProgressCallback.
virtual void QBWaitCallback::log | ( | unsigned int | level, | |
GWEN_LOGGER_LEVEL | loglevel, | |||
const char * | s | |||
) | [virtual] |
Logs a message to this callback. A GUI program could use this function to write the given string to an open window. This function is optional.
level | see GWEN_WAITCALLBACK_CHECKABORTFN | |
loglevel | a higher level results in a more detailed output. Loglevels are defined from 0 (the most important level) and 10 (the least important level). | |
s | log string |
Reimplemented in QBProgressCallback.
int QBWaitCallback::registerCallback | ( | ) |
Registers this callback with Gwenhywfar. After having registered this callback its method instantiate() will be called by Gwenhywfar whenever a callback of this type is entered via GWEN_WaitCallback_Enter. You must unregister this callback before exiting from the calling application/library.
int QBWaitCallback::unregisterCallback | ( | ) |
You must call this member in order to make a clean shutdown of your program/library.
const char* QBWaitCallback::getId | ( | ) | const |
Returns the Id of this callback.
const char* QBWaitCallback::getText | ( | ) | const |
const char* QBWaitCallback::getUnits | ( | ) | const |
int QBWaitCallback::getDistance | ( | ) | const |