1 #ifndef _WX_TASKBAR_H_BASE_
2 #define _WX_TASKBAR_H_BASE_
6 #ifdef wxHAS_TASK_BAR_ICON
10 class WXDLLIMPEXP_ADV wxTaskBarIconEvent
;
12 // ----------------------------------------------------------------------------
13 // wxTaskBarIconBase: define wxTaskBarIcon interface
14 // ----------------------------------------------------------------------------
16 class WXDLLIMPEXP_ADV wxTaskBarIconBase
: public wxEvtHandler
19 wxTaskBarIconBase() { }
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;
28 // creates menu to be displayed when user clicks on the icon
29 virtual wxMenu
*CreatePopupMenu() { return NULL
; }
32 // default events handling, calls CreatePopupMenu:
33 void OnRightButtonDown(wxTaskBarIconEvent
& event
);
36 DECLARE_NO_COPY_CLASS(wxTaskBarIconBase
)
40 // ----------------------------------------------------------------------------
41 // now include the actual class declaration
42 // ----------------------------------------------------------------------------
44 #if defined(__WXPALMOS__)
45 #include "wx/palmos/taskbar.h"
46 #elif defined(__WXMSW__)
47 #include "wx/msw/taskbar.h"
48 #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__)
49 #include "wx/unix/taskbarx11.h"
50 #elif defined (__WXMAC__) && defined(__WXMAC_OSX__)
51 #include "wx/mac/taskbarosx.h"
52 #elif defined (__WXCOCOA__)
53 #include "wx/cocoa/taskbar.h"
56 // ----------------------------------------------------------------------------
57 // wxTaskBarIcon events
58 // ----------------------------------------------------------------------------
60 class WXDLLIMPEXP_ADV wxTaskBarIconEvent
: public wxEvent
63 wxTaskBarIconEvent(wxEventType evtType
, wxTaskBarIcon
*tbIcon
)
64 : wxEvent(wxID_ANY
, evtType
)
66 SetEventObject(tbIcon
);
69 virtual wxEvent
*Clone() const { return new wxTaskBarIconEvent(*this); }
72 DECLARE_NO_ASSIGN_CLASS(wxTaskBarIconEvent
)
75 typedef void (wxEvtHandler::*wxTaskBarIconEventFunction
)(wxTaskBarIconEvent
&);
77 BEGIN_DECLARE_EVENT_TYPES()
78 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_MOVE
,1550)
79 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_LEFT_DOWN
,1551)
80 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_LEFT_UP
,1552)
81 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_RIGHT_DOWN
,1553)
82 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_RIGHT_UP
,1554)
83 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_LEFT_DCLICK
,1555)
84 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV
,wxEVT_TASKBAR_RIGHT_DCLICK
,1556)
85 END_DECLARE_EVENT_TYPES()
87 #define wxTaskBarIconEventHandler(func) \
88 (wxObjectEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func)
90 #define wx__DECLARE_TASKBAREVT(evt, fn) \
91 wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn))
93 #define EVT_TASKBAR_MOVE(fn) wx__DECLARE_TASKBAREVT(MOVE, fn)
94 #define EVT_TASKBAR_LEFT_DOWN(fn) wx__DECLARE_TASKBAREVT(LEFT_DOWN, fn)
95 #define EVT_TASKBAR_LEFT_UP(fn) wx__DECLARE_TASKBAREVT(LEFT_UP, fn)
96 #define EVT_TASKBAR_RIGHT_DOWN(fn) wx__DECLARE_TASKBAREVT(RIGHT_DOWN, fn)
97 #define EVT_TASKBAR_RIGHT_UP(fn) wx__DECLARE_TASKBAREVT(RIGHT_UP, fn)
98 #define EVT_TASKBAR_LEFT_DCLICK(fn) wx__DECLARE_TASKBAREVT(LEFT_DCLICK, fn)
99 #define EVT_TASKBAR_RIGHT_DCLICK(fn) wx__DECLARE_TASKBAREVT(RIGHT_DCLICK, fn)
102 // wxHAS_TASK_BAR_ICON
105 // _WX_TASKBAR_H_BASE_