2 // This file is part of the aMule Project.
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2008 Merkur ( devs@emule-project.net / http://www.emule-project.net )
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
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
29 #include <wx/panel.h> // Needed for wxPanel
30 #include <wx/notebook.h> // Needed for wxNotebookEvent
35 class CFriendListCtrl
;
38 class CChatWnd
: public wxPanel
41 CChatWnd(wxWindow
* pParent
= NULL
);
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
);
60 * Event-handler for displaying the chat-popup menu.
62 void OnNMRclickChatTab(wxMouseEvent
& evt
);
64 * Event-handler fo the Close item on the popup-menu.
66 void OnPopupClose(wxCommandEvent
& evt
);
69 * Event-handler fo the CloseAll item on the popup-menu.
71 void OnPopupCloseAll(wxCommandEvent
& evt
);
74 * Event-handler fo the CloseOthers item on the popup-menu.
76 void OnPopupCloseOthers(wxCommandEvent
& evt
);
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();
90 //! Variable used to ensure that the popup menu doesn't get displayed twice.
92 //! Pointer to the control serving as the friend list
93 CFriendListCtrl
* friendlistctrl
;
94 //! Pointer to the chat tabs.
95 CChatSelector
* chatselector
;
99 // File_checked_for_headers