diff options
Diffstat (limited to 'Src/Wasabi/api/wndmgr/guistatuscb.h')
-rw-r--r-- | Src/Wasabi/api/wndmgr/guistatuscb.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Src/Wasabi/api/wndmgr/guistatuscb.h b/Src/Wasabi/api/wndmgr/guistatuscb.h new file mode 100644 index 00000000..f35a4d9f --- /dev/null +++ b/Src/Wasabi/api/wndmgr/guistatuscb.h @@ -0,0 +1,83 @@ +#ifndef _GUISTATUSCB_H +#define _GUISTATUSCB_H + +#include <bfc/dispatch.h> + +class AppCmds; +class ifc_dependent; + +class GuiStatusCallback : public Dispatchable { + public: + void onSetStatusText(const wchar_t *text, int overlay); + void onAddAppCmds(AppCmds *commands); + void onRemoveAppCmds(AppCmds *commands); + void pushCompleted(int max=100); + void incCompleted(int add=1); + void setCompleted(int pos); + void popCompleted(); + + api_dependent *status_getDependencyPtr(); + enum { + STATUS_ONSETTEXT = 101, + STATUS_GETDEP = 200, + STATUS_ADDCTXTCMDS = 300, + STATUS_REMCTXTCMDS = 400, + STATUS_PUSHCOMPLETED = 500, + STATUS_INCCOMPLETED = 600, + STATUS_SETCOMPLETED = 700, + STATUS_POPCOMPLETED = 800, + }; +}; + +inline void GuiStatusCallback ::onSetStatusText(const wchar_t *text, int overlay) { + _voidcall(STATUS_ONSETTEXT, text, overlay); +} + +inline api_dependent *GuiStatusCallback ::status_getDependencyPtr() { + return _call(STATUS_GETDEP, (api_dependent *)NULL); +} + +inline void GuiStatusCallback ::onAddAppCmds(AppCmds *commands) { + _voidcall(STATUS_ADDCTXTCMDS, commands); +} + +inline void GuiStatusCallback ::onRemoveAppCmds(AppCmds *commands) { + _voidcall(STATUS_REMCTXTCMDS, commands); +} + +inline +void GuiStatusCallback::pushCompleted(int max) { + _voidcall(STATUS_PUSHCOMPLETED, max); +} + +inline +void GuiStatusCallback::incCompleted(int add) { + _voidcall(STATUS_INCCOMPLETED, add); +} + +inline +void GuiStatusCallback::setCompleted(int pos) { + _voidcall(STATUS_SETCOMPLETED, pos); +} + +inline +void GuiStatusCallback::popCompleted() { + _voidcall(STATUS_POPCOMPLETED); +} + +class GuiStatusCallbackI : public GuiStatusCallback { + public: + virtual void onSetStatusText(const wchar_t *text, int overlay)=0; + virtual api_dependent *status_getDependencyPtr()=0; + virtual void onAddAppCmds(AppCmds *commands)=0; + virtual void onRemoveAppCmds(AppCmds *commands)=0; + virtual void pushCompleted(int max=100)=0; + virtual void incCompleted(int add=1)=0; + virtual void setCompleted(int pos)=0; + virtual void popCompleted()=0; + + protected: + RECVS_DISPATCH; +}; + +#endif |