summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsession.h
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircsession.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircsession.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircsession.h b/noncore/net/opieirc/ircsession.h
new file mode 100644
index 0000000..59c26aa
--- a/dev/null
+++ b/noncore/net/opieirc/ircsession.h
@@ -0,0 +1,73 @@
1/*
2 OpieIRC - An embedded IRC client
3 Copyright (C) 2002 Wenzel Jakob
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20
21#ifndef __IRCSESSION_H
22#define __IRCSESSION_H
23
24#include <qstring.h>
25#include <qlist.h>
26#include "ircserver.h"
27#include "ircconnection.h"
28#include "ircmessage.h"
29#include "ircchannel.h"
30#include "ircoutput.h"
31
32class IRCMessageParser;
33
34/* The IRCSession stores all information relating to the connection
35 to one IRC server. IRCSession makes it possible to run multiple
36 IRC server connections from within the same program */
37
38class IRCSession : public QObject {
39friend class IRCMessageParser;
40 Q_OBJECT
41public:
42 IRCSession(IRCServer *server);
43 ~IRCSession();
44
45 void join(QString channel);
46 void part(IRCChannel *channel);
47 void beginSession();
48 bool isSessionActive();
49 void endSession();
50
51 void sendMessage(IRCPerson *person, QString message);
52 void sendMessage(IRCChannel *channel, QString message);
53 IRCChannel *getChannel(QString channelname);
54 IRCPerson *getPerson(QString nickname);
55protected:
56 void addPerson(IRCPerson *person);
57 void addChannel(IRCChannel *channel);
58 void removeChannel(IRCChannel *channel);
59 void removePerson(IRCPerson *person);
60 void getChannelsByPerson(IRCPerson *person, QList<IRCChannel> &channels);
61protected slots:
62 void handleMessage(IRCMessage *message);
63signals:
64 void outputReady(IRCOutput output);
65protected:
66 IRCServer *m_server;
67 IRCConnection *m_connection;
68 IRCMessageParser *m_parser;
69 QList<IRCChannel> m_channels;
70 QList<IRCPerson> m_people;
71};
72
73#endif /* __IRCSESSION_H */