Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ircsession.h

Go to the documentation of this file.
00001 /*
00002     OpieIRC - An embedded IRC client
00003     Copyright (C) 2002 Wenzel Jakob
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 */
00020 
00021 #ifndef __IRCSESSION_H
00022 #define __IRCSESSION_H
00023 
00024 #include <qstring.h>
00025 #include <qlist.h>
00026 #include "ircserver.h"
00027 #include "ircconnection.h"
00028 #include "ircmessage.h"
00029 #include "ircchannel.h"
00030 #include "ircoutput.h"
00031 
00032 class IRCMessageParser;
00033 class IRCServerTab;
00034 
00035 /* The IRCSession stores all information relating to the connection
00036    to one IRC server. IRCSession makes it possible to run multiple
00037    IRC server connections from within the same program */
00038 
00039 class IRCSession : public QObject {
00040 friend class IRCMessageParser;
00041     Q_OBJECT
00042 public:
00043     IRCSession(QObject *parent, IRCServer *server);
00044     ~IRCSession();
00045     
00046     void join(QString channel);
00047     void quit(QString message);
00048     void quit();
00049     void raw(QString message);
00050     void topic(IRCChannel *channel, QString message);
00051     void mode(IRCChannel *channel, QString message);
00052     void mode(IRCPerson *person, QString message);
00053     void mode(QString message);
00054     void part(IRCChannel *channel);
00055     void op(IRCChannel *channel, IRCPerson *person);
00056     void kick(IRCChannel *channel, IRCPerson *person);
00057     void kick(IRCChannel *channel, IRCPerson *person, QString message);
00058     void beginSession();
00059     bool isSessionActive();
00060     void endSession();
00061     bool isLoggedIn();
00062     void sendMessage(IRCPerson *person, QString message);
00063     void sendMessage(IRCChannel *channel, QString message);
00064     void sendAction(IRCPerson *person, QString message);
00065     void sendAction(IRCChannel *channel, QString message);
00066     void updateNickname(const QString &oldNickname, const QString &newNickname);
00067     void setValidUsermodes(const QString &modes);
00068     void setValidChannelmodes(const QString &modes);
00069     void whois(const QString &nickname);
00070     void sendCTCPPing(const QString &nickname);
00071     void sendCTCPRequest(const QString &nickname, const QString &type, const QString &args);
00072     void sendCTCPReply(const QString &nickname, const QString &type, const QString &args);
00073     IRCChannel *getChannel(QString channelname);
00074     IRCPerson  *getPerson(QString nickname);
00075 protected:
00076     void addPerson(IRCPerson *person);
00077     void addChannel(IRCChannel *channel);
00078     void removeChannel(IRCChannel *channel);
00079     void removePerson(IRCPerson *person);
00080     void getChannelsByPerson(IRCPerson *person, QList<IRCChannel> &channels);
00081 protected slots:
00082     void handleMessage(IRCMessage *message);
00083 signals:
00084     void outputReady(IRCOutput output);
00085     void updateChannels();
00086 protected:
00087     IRCServer             *m_server;
00088     IRCConnection         *m_connection;
00089     IRCMessageParser      *m_parser;
00090     QList<IRCChannel>      m_channels;
00091     QList<IRCPerson>       m_people;
00092     QString                m_validUsermodes;
00093     QString                m_validChannelmodes;
00094 };
00095 
00096 #endif /* __IRCSESSION_H */

Generated on Sat Nov 5 16:17:41 2005 for OPIE by  doxygen 1.4.2