Fix compilation with wxWidgets 2.8.12
[amule.git] / src / MuleTrayIcon.h
blob9d45b3434fcf05ba22f35695ff5de1234b6e312e
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2004-2011 Angel Vidal ( kry@amule.org )
5 // Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #ifndef MULETRAYICON_H
27 #define MULETRAYICON_H
29 #ifndef AMULE_DAEMON
32 enum TaskbarNotifier
34 TBN_NULL = 0,
35 TBN_CHAT,
36 TBN_DLOAD,
37 TBN_LOG,
38 TBN_IMPORTANTEVENT,
39 TBN_NEWVERSION
42 #include <wx/taskbar.h>
43 #include <wx/icon.h>
44 #include <wx/dcmemory.h>
46 #include "Types.h" // Needed for uint32
48 class wxString;
49 class wxMenu;
51 enum {
52 TRAY_ICON_DISCONNECTED,
53 TRAY_ICON_LOWID,
54 TRAY_ICON_HIGHID
58 /**
59 * The mule tray icon class is responsible for drawing the mule systray icon
60 * and reacting to the user input on it.
62 class CMuleTrayIcon : public wxTaskBarIcon
64 public:
65 /**
66 * Contructor.
68 CMuleTrayIcon();
70 /**
71 * Destructor.
73 ~CMuleTrayIcon();
75 /**
76 * Set the Tray icon.
77 * @param Icon The wxIcon object with the new tray icon
79 void SetTrayIcon(int Icon, uint32 percent);
81 /**
82 * Set the Tray tooltip
83 * @param Tip The wxString object with the new tray tooltip
85 void SetTrayToolTip(const wxString& Tip);
87 private:
89 virtual wxMenu* CreatePopupMenu();
91 void UpdateTray();
93 void SwitchShow(wxTaskBarIconEvent&);
94 void SetUploadSpeed(wxCommandEvent&);
95 void SetDownloadSpeed(wxCommandEvent&);
96 void ServerConnection(wxCommandEvent&);
97 void ShowHide(wxCommandEvent&);
98 void Close(wxCommandEvent&);
100 int Old_Icon;
101 int Old_SpeedSize;
103 int Disconnected_Icon_size;
104 int LowId_Icon_size;
105 int HighId_Icon_size;
107 wxIcon CurrentIcon;
108 wxMemoryDC IconWithSpeed;
109 wxString CurrentTip;
111 DECLARE_EVENT_TABLE()
114 #endif // DAEMON
116 #endif //MULETRAYICON_H
117 // File_checked_for_headers