]>
Commit | Line | Data |
---|---|---|
34138703 JS |
1 | #ifndef _WX_TASKBAR_H_BASE_ |
2 | #define _WX_TASKBAR_H_BASE_ | |
3 | ||
3191ff3b VS |
4 | #include "wx/defs.h" |
5 | ||
6 | #ifdef wxHAS_TASK_BAR_ICON | |
7 | ||
6af507f7 VS |
8 | #include "wx/event.h" |
9 | ||
dae73d74 VS |
10 | class WXDLLIMPEXP_ADV wxTaskBarIconEvent; |
11 | ||
6af507f7 VS |
12 | // ---------------------------------------------------------------------------- |
13 | // wxTaskBarIconBase: define wxTaskBarIcon interface | |
14 | // ---------------------------------------------------------------------------- | |
15 | ||
131f235d | 16 | class WXDLLIMPEXP_ADV wxTaskBarIconBase : public wxEvtHandler |
6af507f7 | 17 | { |
fc7a2a60 VZ |
18 | public: |
19 | wxTaskBarIconBase() { } | |
cb719f2e | 20 | |
dae73d74 VS |
21 | // Operations: |
22 | virtual bool SetIcon(const wxIcon& icon, | |
23 | const wxString& tooltip = wxEmptyString) = 0; | |
24 | virtual bool RemoveIcon() = 0; | |
25 | virtual bool PopupMenu(wxMenu *menu) = 0; | |
26 | ||
27 | protected: | |
28 | // creates menu to be displayed when user clicks on the icon | |
29 | virtual wxMenu *CreatePopupMenu() { return NULL; } | |
cb719f2e | 30 | |
fc7a2a60 | 31 | private: |
dae73d74 | 32 | // default events handling, calls CreatePopupMenu: |
6466d41e | 33 | void OnRightButtonDown(wxTaskBarIconEvent& event); |
cb719f2e | 34 | |
dae73d74 | 35 | DECLARE_EVENT_TABLE() |
fc7a2a60 | 36 | DECLARE_NO_COPY_CLASS(wxTaskBarIconBase) |
6af507f7 VS |
37 | }; |
38 | ||
39 | ||
40 | // ---------------------------------------------------------------------------- | |
41 | // now include the actual class declaration | |
42 | // ---------------------------------------------------------------------------- | |
43 | ||
34138703 | 44 | #if defined(__WXMSW__) |
6af507f7 | 45 | #include "wx/msw/taskbar.h" |
fb29dcac VS |
46 | #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) |
47 | #include "wx/unix/taskbarx11.h" | |
f1d9e1ec | 48 | #elif defined (__WXMAC__) && __WXMAC_OSX__ |
32c479fd | 49 | #include "wx/mac/taskbarosx.h" |
f1d9e1ec DE |
50 | #elif defined (__WXCOCOA__) |
51 | #include "wx/cocoa/taskbar.h" | |
34138703 JS |
52 | #endif |
53 | ||
6af507f7 VS |
54 | // ---------------------------------------------------------------------------- |
55 | // wxTaskBarIcon events | |
56 | // ---------------------------------------------------------------------------- | |
57 | ||
131f235d | 58 | class WXDLLIMPEXP_ADV wxTaskBarIconEvent : public wxEvent |
6af507f7 VS |
59 | { |
60 | public: | |
61 | wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon) | |
cb719f2e | 62 | : wxEvent(wxID_ANY, evtType) |
6af507f7 VS |
63 | { |
64 | SetEventObject(tbIcon); | |
65 | } | |
66 | ||
67 | virtual wxEvent *Clone() const { return new wxTaskBarIconEvent(*this); } | |
fc7a2a60 VZ |
68 | |
69 | private: | |
a6cbc4db | 70 | DECLARE_NO_ASSIGN_CLASS(wxTaskBarIconEvent) |
6af507f7 VS |
71 | }; |
72 | ||
6466d41e VS |
73 | typedef void (wxEvtHandler::*wxTaskBarIconEventFunction)(wxTaskBarIconEvent&); |
74 | ||
6af507f7 | 75 | BEGIN_DECLARE_EVENT_TYPES() |
131f235d VS |
76 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_MOVE,1550) |
77 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_DOWN,1551) | |
78 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_UP,1552) | |
79 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DOWN,1553) | |
80 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_UP,1554) | |
81 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_DCLICK,1555) | |
82 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DCLICK,1556) | |
6af507f7 VS |
83 | END_DECLARE_EVENT_TYPES() |
84 | ||
cb719f2e WS |
85 | #define EVT_TASKBAR_MOVE(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_MOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), |
86 | #define EVT_TASKBAR_LEFT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
87 | #define EVT_TASKBAR_LEFT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
88 | #define EVT_TASKBAR_RIGHT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
89 | #define EVT_TASKBAR_RIGHT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
90 | #define EVT_TASKBAR_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
91 | #define EVT_TASKBAR_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), | |
6af507f7 | 92 | |
b400d50a | 93 | #endif |
3191ff3b VS |
94 | // wxHAS_TASK_BAR_ICON |
95 | ||
34138703 JS |
96 | #endif |
97 | // _WX_TASKBAR_H_BASE_ |