aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/wndmgr/guistatuscb.h
blob: f35a4d9f5fd405f6321d9520c830a45231d7f10b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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