Communi  3.0.0
A cross-platform IRC framework written with Qt
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Macros Groups Pages
ircclient.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 The Communi Project
3  *
4  * This example is free, and not covered by the LGPL license. There is no
5  * restriction applied to their modification, redistribution, using and so on.
6  * You can study them, modify them, use them in your own program - either
7  * completely or partially.
8  */
9 
10 #ifndef IRCCLIENT_H
11 #define IRCCLIENT_H
12 
13 #include <QSplitter>
14 #include <QHash>
15 
16 class IrcBuffer;
17 class IrcConnection;
18 class IrcMessage;
19 class IrcUserModel;
20 class IrcBufferModel;
21 class IrcCommandParser;
22 
23 QT_FORWARD_DECLARE_CLASS(QLineEdit)
24 QT_FORWARD_DECLARE_CLASS(QListView)
25 QT_FORWARD_DECLARE_CLASS(QTextEdit)
26 QT_FORWARD_DECLARE_CLASS(QCompleter)
27 QT_FORWARD_DECLARE_CLASS(QModelIndex)
28 QT_FORWARD_DECLARE_CLASS(QTextDocument)
29 
30 class IrcClient : public QSplitter
31 {
32  Q_OBJECT
33 
34 public:
35  IrcClient(QWidget* parent = 0);
36  ~IrcClient();
37 
38 private slots:
39  void onConnected();
40  void onConnecting();
41  void onDisconnected();
42 
43  void onTextEdited();
44  void onTextEntered();
45 
46  void onBufferAdded(IrcBuffer* buffer);
47  void onBufferRemoved(IrcBuffer* buffer);
48 
49  void onBufferActivated(const QModelIndex& index);
50  void onUserActivated(const QModelIndex& index);
51 
52  void receiveMessage(IrcMessage* message);
53 
54 private:
55  void createLayout();
56  void createCompleter();
57  void createParser();
58  void createUserList();
59  void createBufferList();
60  void createConnection();
61 
62  QLineEdit* lineEdit;
63  QTextEdit* textEdit;
64  QCompleter* completer;
65  QListView* userList;
66  QListView* bufferList;
67 
68  IrcCommandParser* parser;
69  IrcConnection* connection;
70  IrcBufferModel* bufferModel;
73 };
74 
75 #endif // IRCCLIENT_H
Keeps track of buffer status.
Definition: ircbuffer.h:34
Keeps track of channel users.
Definition: ircusermodel.h:30
Provides means to establish a connection to an IRC server.
Definition: ircconnection.h:32
The base class of all messages.
Definition: ircmessage.h:32
Keeps track of buffers.
Definition: ircbuffermodel.h:32
Parses commands from user input.
Definition: irccommandparser.h:28
QObject * parent() const