1 #ifndef SPRINGLOBBY_HEADERGUARD_MAINCHATTAB_H
2 #define SPRINGLOBBY_HEADERGUARD_MAINCHATTAB_H
3 
4 #include <wx/scrolwin.h>
5 
6 class Ui;
7 class ChatPanel;
8 class Server;
9 class Channel;
10 class User;
11 class wxAuiNotebookEvent;
12 class SLChatNotebook;
13 class wxBoxSizer;
14 class wxImageList;
15 class wxString;
16 
17 //! @brief The main chat tab.
18 class MainChatTab : public wxScrolledWindow
19 {
20 public:
21 	MainChatTab( wxWindow* parent );
22 	~MainChatTab();
23 
24 	ChatPanel* GetActiveChatPanel();
25 	ChatPanel* GetChannelChatPanel( const wxString& channel );
26 	ChatPanel* GetUserChatPanel( const wxString& user );
27 
28 	ChatPanel& ServerChat();
29 
30 	ChatPanel* AddChatPanel( Channel& channel, bool doFocus  );
31 	ChatPanel* AddChatPanel( Server& server, const wxString& name );
32 	ChatPanel* AddChatPanel( const User& user );
33 	/** \brief this is only used if channel is left via raw command in server tab */
34 	bool RemoveChatPanel( ChatPanel* panel );
35 
36 
37 	void RejoinChannels();
38 	void LeaveChannels();
39 
40 	void BroadcastMessage( const wxString& message );
41 
42 	void OnUserConnected( User& user );
43 	void OnUserDisconnected( User& user );
44 
45 
46 	void UpdateNicklistHighlights();
47 
48 	void AdvanceSelection( bool forward );
49 
50 private:
51 	ChatPanel* GetCurrentPanel();
52 
53 	void OnTabsChanged( wxAuiNotebookEvent& event );
54 	void OnTabClose( wxAuiNotebookEvent& event );
55 
56 	void LoadPerspective( const wxString& perspective_name = wxEmptyString );
57 	void SavePerspective( const wxString& perspective_name = wxEmptyString );
58 
59 	wxImage ReplaceChannelStatusColour( wxBitmap img, const wxColour& colour ) const;
60 
61 
62 	wxWindow* m_close_window;
63 	SLChatNotebook* m_chat_tabs;
64 	wxBoxSizer* m_main_sizer;
65 	wxImageList* m_imagelist;
66 	ChatPanel* m_server_chat;
67 //	ChatPanel* m_main_chat;
68 	int m_newtab_sel;
69 
70 	enum {
71 		CHAT_TABS = wxID_HIGHEST
72 	};
73 
74 	DECLARE_EVENT_TABLE()
75 };
76 
77 
78 
79 #endif // SPRINGLOBBY_HEADERGUARD_MAINCHATTAB_H
80 
81 /**
82     This file is part of SpringLobby,
83     Copyright (C) 2007-2011
84 
85     SpringLobby is free software: you can redistribute it and/or modify
86     it under the terms of the GNU General Public License version 2 as published by
87     the Free Software Foundation.
88 
89     SpringLobby is distributed in the hope that it will be useful,
90     but WITHOUT ANY WARRANTY; without even the implied warranty of
91     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
92     GNU General Public License for more details.
93 
94     You should have received a copy of the GNU General Public License
95     along with SpringLobby.  If not, see <http://www.gnu.org/licenses/>.
96 **/
97 
98