| 1 | ///////////////////////////////////////////////////////////////////////// |
| 2 | // File: wx/msw/taskbar.h |
| 3 | // Purpose: Defines wxTaskBarIcon class for manipulating icons on the |
| 4 | // Windows task bar. |
| 5 | // Author: Julian Smart |
| 6 | // Modified by: Vaclav Slavik |
| 7 | // Created: 24/3/98 |
| 8 | // RCS-ID: $Id$ |
| 9 | // Copyright: (c) Julian Smart |
| 10 | // Licence: wxWindows licence |
| 11 | ///////////////////////////////////////////////////////////////////////// |
| 12 | |
| 13 | #ifndef _TASKBAR_H_ |
| 14 | #define _TASKBAR_H_ |
| 15 | |
| 16 | #include "wx/icon.h" |
| 17 | |
| 18 | // private helper class: |
| 19 | class WXDLLIMPEXP_ADV wxTaskBarIconWindow; |
| 20 | |
| 21 | class WXDLLIMPEXP_ADV wxTaskBarIcon: public wxTaskBarIconBase |
| 22 | { |
| 23 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon) |
| 24 | public: |
| 25 | wxTaskBarIcon(); |
| 26 | virtual ~wxTaskBarIcon(); |
| 27 | |
| 28 | // Accessors |
| 29 | inline bool IsOk() const { return true; } |
| 30 | inline bool IsIconInstalled() const { return m_iconAdded; } |
| 31 | |
| 32 | // Operations |
| 33 | bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); |
| 34 | bool RemoveIcon(void); |
| 35 | bool PopupMenu(wxMenu *menu); //, int x, int y); |
| 36 | |
| 37 | #if WXWIN_COMPATIBILITY_2_4 |
| 38 | wxDEPRECATED( bool IsOK() const ); |
| 39 | |
| 40 | // Overridables |
| 41 | virtual void OnMouseMove(wxEvent&); |
| 42 | virtual void OnLButtonDown(wxEvent&); |
| 43 | virtual void OnLButtonUp(wxEvent&); |
| 44 | virtual void OnRButtonDown(wxEvent&); |
| 45 | virtual void OnRButtonUp(wxEvent&); |
| 46 | virtual void OnLButtonDClick(wxEvent&); |
| 47 | virtual void OnRButtonDClick(wxEvent&); |
| 48 | #endif |
| 49 | |
| 50 | // Implementation |
| 51 | protected: |
| 52 | friend class wxTaskBarIconWindow; |
| 53 | long WindowProc(unsigned int msg, unsigned int wParam, long lParam); |
| 54 | void RegisterWindowMessages(); |
| 55 | |
| 56 | // Data members |
| 57 | protected: |
| 58 | wxTaskBarIconWindow *m_win; |
| 59 | bool m_iconAdded; |
| 60 | wxIcon m_icon; |
| 61 | wxString m_strTooltip; |
| 62 | |
| 63 | #if WXWIN_COMPATIBILITY_2_4 |
| 64 | // non-virtual default event handlers to forward events to the virtuals |
| 65 | void _OnMouseMove(wxTaskBarIconEvent&); |
| 66 | void _OnLButtonDown(wxTaskBarIconEvent&); |
| 67 | void _OnLButtonUp(wxTaskBarIconEvent&); |
| 68 | void _OnRButtonDown(wxTaskBarIconEvent&); |
| 69 | void _OnRButtonUp(wxTaskBarIconEvent&); |
| 70 | void _OnLButtonDClick(wxTaskBarIconEvent&); |
| 71 | void _OnRButtonDClick(wxTaskBarIconEvent&); |
| 72 | |
| 73 | DECLARE_EVENT_TABLE() |
| 74 | #endif |
| 75 | }; |
| 76 | |
| 77 | #if WXWIN_COMPATIBILITY_2_4 |
| 78 | inline bool wxTaskBarIcon::IsOK() const { return IsOk(); } |
| 79 | #endif |
| 80 | |
| 81 | #endif |
| 82 | // _TASKBAR_H_ |