ircdock.h
1 //------------------------------------------------------------------------------
2 // ircdock.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2010 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef __IRCDOCK_H_
24 #define __IRCDOCK_H_
25 
26 #include "dptr.h"
27 
28 #include <QDockWidget>
29 
30 class IRCAdapterBase;
31 class IRCDockTabContents;
32 class IRCNetworkAdapter;
34 class IRCSounds;
35 
39 class IRCDock : public QDockWidget
40 {
41  Q_OBJECT;
42 
43  public:
44  IRCDock(QWidget* parent = NULL);
45  ~IRCDock();
46 
47  IRCDockTabContents* addIRCAdapter(IRCAdapterBase* pIRCAdapter);
48 
53  bool hasTabFocus(const IRCDockTabContents* pTab) const;
54 
55  void performNetworkAutojoins();
56 
57  IRCSounds& sounds();
58  IRCDockTabContents *tabWithFocus();
59 
60  private:
61  DPtr<IRCDock> d;
62 
63  IRCNetworkAdapter* networkWithUiFocus();
64 
76  void connectToNewNetwork(IRCNetworkConnectionInfo& connectionInfo, bool bFocusOnNewTab);
77 
82  QString prefixMessage(IRCAdapterBase* pTargetChatWindow, IRCAdapterBase* pMessageSender, const QString& message);
83  void setupToolbar();
84 
85  private slots:
86  void chatWindowCloseRequestSlot(IRCDockTabContents* pCaller);
87  void tabCloseRequestedSlot(int index);
88  void tabCurrentChanged(int index);
89  void tabFocusRequest(IRCDockTabContents* pCaller);
90  void titleChange(IRCDockTabContents* caller);
91  void titleChangeWithColorOfSenderIfNotFocused();
92  void toolBarAction(QAction* pAction);
93 
94 
95 };
96 
97 #endif
Interprets communication between the client and the IRC server.
Dockable widget designed for IRC communication.
Definition: ircdock.h:39
Provides an unified communication interface between a client and IRC network entities.
Struct containing information about client's connection to the IRC server.
Dockable widget designed for IRC communication.
void applyAppearanceSettings()
Applies IRC appearance settings to all open tabs.
Definition: ircdock.cpp:86
Part of IRC UI package. Plays IRC related sounds.
Definition: ircsounds.h:36