guistatuscb.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef _GUISTATUSCB_H
  2. #define _GUISTATUSCB_H
  3. #include <bfc/dispatch.h>
  4. class AppCmds;
  5. class ifc_dependent;
  6. class GuiStatusCallback : public Dispatchable {
  7. public:
  8. void onSetStatusText(const wchar_t *text, int overlay);
  9. void onAddAppCmds(AppCmds *commands);
  10. void onRemoveAppCmds(AppCmds *commands);
  11. void pushCompleted(int max=100);
  12. void incCompleted(int add=1);
  13. void setCompleted(int pos);
  14. void popCompleted();
  15. api_dependent *status_getDependencyPtr();
  16. enum {
  17. STATUS_ONSETTEXT = 101,
  18. STATUS_GETDEP = 200,
  19. STATUS_ADDCTXTCMDS = 300,
  20. STATUS_REMCTXTCMDS = 400,
  21. STATUS_PUSHCOMPLETED = 500,
  22. STATUS_INCCOMPLETED = 600,
  23. STATUS_SETCOMPLETED = 700,
  24. STATUS_POPCOMPLETED = 800,
  25. };
  26. };
  27. inline void GuiStatusCallback ::onSetStatusText(const wchar_t *text, int overlay) {
  28. _voidcall(STATUS_ONSETTEXT, text, overlay);
  29. }
  30. inline api_dependent *GuiStatusCallback ::status_getDependencyPtr() {
  31. return _call(STATUS_GETDEP, (api_dependent *)NULL);
  32. }
  33. inline void GuiStatusCallback ::onAddAppCmds(AppCmds *commands) {
  34. _voidcall(STATUS_ADDCTXTCMDS, commands);
  35. }
  36. inline void GuiStatusCallback ::onRemoveAppCmds(AppCmds *commands) {
  37. _voidcall(STATUS_REMCTXTCMDS, commands);
  38. }
  39. inline
  40. void GuiStatusCallback::pushCompleted(int max) {
  41. _voidcall(STATUS_PUSHCOMPLETED, max);
  42. }
  43. inline
  44. void GuiStatusCallback::incCompleted(int add) {
  45. _voidcall(STATUS_INCCOMPLETED, add);
  46. }
  47. inline
  48. void GuiStatusCallback::setCompleted(int pos) {
  49. _voidcall(STATUS_SETCOMPLETED, pos);
  50. }
  51. inline
  52. void GuiStatusCallback::popCompleted() {
  53. _voidcall(STATUS_POPCOMPLETED);
  54. }
  55. class GuiStatusCallbackI : public GuiStatusCallback {
  56. public:
  57. virtual void onSetStatusText(const wchar_t *text, int overlay)=0;
  58. virtual api_dependent *status_getDependencyPtr()=0;
  59. virtual void onAddAppCmds(AppCmds *commands)=0;
  60. virtual void onRemoveAppCmds(AppCmds *commands)=0;
  61. virtual void pushCompleted(int max=100)=0;
  62. virtual void incCompleted(int add=1)=0;
  63. virtual void setCompleted(int pos)=0;
  64. virtual void popCompleted()=0;
  65. protected:
  66. RECVS_DISPATCH;
  67. };
  68. #endif