Fix compilation with wxWidgets 2.8.12
[amule.git] / src / ChatWnd.h
bloba59f5f3ef9835c22955f51ff821f3349b50efb08
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2011 Merkur ( devs@emule-project.net / http://www.emule-project.net )
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 CHATWND_H
27 #define CHATWND_H
29 #include <wx/panel.h> // Needed for wxPanel
30 #include <wx/notebook.h> // Needed for wxNotebookEvent
31 #include "Types.h"
33 class CFriend;
34 class CChatSelector;
35 class CFriendListCtrl;
36 class CMD4Hash;
38 class CChatWnd : public wxPanel
40 public:
41 CChatWnd(wxWindow* pParent = NULL);
42 ~CChatWnd() {};
44 void StartSession(CFriend* friend_client, bool setfocus = true);
46 void UpdateFriend(CFriend* toupdate);
47 void RemoveFriend(CFriend* todel);
49 void ProcessMessage(uint64 sender, const wxString& message);
50 void ConnectionResult(bool success, const wxString& message, uint64 id);
52 void SendMessage(const wxString& message, const wxString& client_name = wxEmptyString, uint64 to_id = 0);
54 bool IsIdValid(uint64 id);
55 void ShowCaptchaResult(uint64 id, bool ok);
56 void EndSession(uint64 id);
58 protected:
59 /**
60 * Event-handler for displaying the chat-popup menu.
62 void OnNMRclickChatTab(wxMouseEvent& evt);
63 /**
64 * Event-handler fo the Close item on the popup-menu.
66 void OnPopupClose(wxCommandEvent& evt);
68 /**
69 * Event-handler fo the CloseAll item on the popup-menu.
71 void OnPopupCloseAll(wxCommandEvent& evt);
73 /**
74 * Event-handler fo the CloseOthers item on the popup-menu.
76 void OnPopupCloseOthers(wxCommandEvent& evt);
78 /**
79 * Event-handler fo the AddFriend item on the popup-menu.
81 void OnAddFriend(wxCommandEvent& evt);
83 void OnBnClickedCsend(wxCommandEvent& evt);
84 void OnBnClickedCclose(wxCommandEvent& evt);
85 void OnAllPagesClosed(wxNotebookEvent& evt);
86 void CheckNewButtonsState();
88 DECLARE_EVENT_TABLE()
90 //! Variable used to ensure that the popup menu doesn't get displayed twice.
91 wxMenu* m_menu;
92 //! Pointer to the control serving as the friend list
93 CFriendListCtrl* friendlistctrl;
94 //! Pointer to the chat tabs.
95 CChatSelector* chatselector;
98 #endif
99 // File_checked_for_headers