-
Notifications
You must be signed in to change notification settings - Fork 220
/
Copy pathChatSelector.h
82 lines (72 loc) · 3.03 KB
/
ChatSelector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//
// This file is part of the aMule Project.
//
// Copyright (c) 2003-2011 aMule Team ( [email protected] / http://www.amule.org )
// Copyright (c) 2002-2011 Merkur ( [email protected] / http://www.emule-project.net )
//
// Any parts of this program derived from the xMule, lMule or eMule project,
// or contributed by third-party developers are copyrighted by their
// respective authors.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
#ifndef CHATSELECTOR_H
#define CHATSELECTOR_H
#include "MuleTextCtrl.h"
#include "MuleNotebook.h"
#include "Types.h" // Needed for uint16
class CClientRef;
class CFriend;
/**
* This class is used to display chat sessions.
*/
class CChatSession : public CMuleTextCtrl
{
public:
CChatSession(wxWindow *parent, wxWindowID id = -1, const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr );
~CChatSession();
uint64 m_client_id;
bool m_active;
/**
* Appends the specified text.
*
* @param text The text to add.
* @param style The style of the new text.
* @param newline If a newline should be added to the end of the line.
*
* If newline is false, then no newlines will be at the end of added text,
* even if the passed string ends with newlines. Multiline strings are
* broken into individual lines and each are timestamped with the same date.
*/
void AddText( const wxString& text, const wxTextAttr& style, bool newline = true );
};
class CChatSelector : public CMuleNotebook
{
public:
CChatSelector(wxWindow* parent, wxWindowID id, const wxPoint& pos, wxSize siz, long style);
virtual ~CChatSelector() {};
CChatSession* StartSession(uint64 client_id, const wxString& client_name, bool show = true);
void EndSession(uint64 client_id = 0);
CChatSession* GetPageByClientID(uint64 client_id);
int GetTabByClientID(uint64 client_id);
bool ProcessMessage(uint64 sender_id, const wxString& message);
bool SendMessage(const wxString& message, const wxString& client_name = wxEmptyString, uint64 to_id = 0);
void ConnectionResult(bool success, const wxString& message, uint64 id);
void RefreshFriend(uint64 toupdate_id, const wxString& new_name);
void ShowCaptchaResult(uint64 id, bool ok);
bool GetCurrentClient(CClientRef&) const;
};
#endif
// File_checked_for_headers