- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

# include/ircsession_p.h

    00001 /*
    00002 * Copyright (C) 2008-2009 J-P Nurmi jpnurmi@gmail.com
    00003 *
    00004 * This library is free software; you can redistribute it and/or modify it
    00005 * under the terms of the GNU Lesser General Public License as published by
    00006 * the Free Software Foundation; either version 2 of the License, or (at your
    00007 * option) any later version.
    00008 *
    00009 * This library is distributed in the hope that it will be useful, but WITHOUT
    00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00011 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00012 * License for more details.
    00013 */
    00014
    00015 #ifndef IRC_SESSION_P_H
    00016 #define IRC_SESSION_P_H
    00017
    00018 #include <QHash>
    00019 #include <QTimer>
    00020 #include <QStringList>
    00021 #include <QVariantList>
    00022 #include <QAbstractSocket>
    00023 #include "ircbuffer.h"
    00024
    00025 namespace Irc
    00026 {
    00027     class SessionPrivate
    00028     {
    00029         Q_DECLARE_PUBLIC(Session)
    00030
    00031     public:
    00032         SessionPrivate();
    00033
    00034         void init(Session* session);
    00035
    00036         void _q_connected();
    00037         void _q_disconnected();
    00038         void _q_reconnect();
    00039         void _q_error();
    00040         void _q_state(QAbstractSocket::SocketState state);
    00041         void _q_readData();
    00042
    00043         QString readString(const QByteArray& data) const;
    00044         void readLines(const QByteArray& delimiter);
    00045         void processLine(const QByteArray& line);
    00046         Irc::Buffer::MessageFlags getMessageFlags(QString& message) const;
    00047         bool isConnected() const;
    00048         QString resolveTarget(const QString& sender, const QString& receiver) const;
    00049
    00050         Buffer* createBuffer(const QString& receiver);
    00051         void removeBuffer(Buffer* buffer);
    00052
    00053         Session* q_ptr;
    00054         QByteArray buffer;
    00055         Session::Options options;
    00056         QAbstractSocket* socket;
    00057         QString ident;
    00058         QString password;
    00059         QString nick;
    00060         QString realName;
    00061         QString host;
    00062         quint16 port;
    00063         QString motd;
    00064         QStringList channels;
    00065         QByteArray encoding;
    00066         int delay;
    00067         QTimer timer;
    00068         Buffer* defaultBuffer;
    00069         QHash<QString, Buffer*> buffers;
    00070         bool welcomed;
    00071
    00072         // Capabilities supported by the server
    00073         QStringList capabilities;
    00074         // Capabilities enabled for this connection
    00075         QStringList enabledCapabilities;
    00076         // Capabilities to request only when connecting
    00077         QStringList wantedCapabilities;
    00078         // Temporary building list of capabilities in transmission
    00079         QStringList tempCapabilities;
    00080         // Whether the server has CAP implemented
    00081         bool        capabilitiesSupported;
    00082
    00083 #ifndef IRC_NO_DEPRECATED
    00084         // TODO: for backwards compatibility, to be removed in 1.0
    00085         void emitCompatSignal(const char* signal, const QVariantList& params);
    00086         void _q_joined(const QString& origin);
    00087         void _q_parted(const QString& origin, const QString& message);
    00088         void _q_quit(const QString& origin, const QString& message);
    00089         void _q_nickChanged(const QString& origin, const QString& nick);
    00090         void _q_modeChanged(const QString& origin, const QString& mode, const QString& args);
    00091         void _q_topicChanged(const QString& origin, const QString& topic);
    00092         void _q_invited(const QString& origin, const QString& receiver, const QString& channel);
    00093         void _q_kicked(const QString& origin, const QString& nick, const QString& message);
    00094         void _q_messageReceived(const QString& origin, const QString& message);
    00095         void _q_noticeReceived(const QString& origin, const QString& notice);
    00096         void _q_ctcpRequestReceived(const QString& origin, const QString& request);
    00097         void _q_ctcpReplyReceived(const QString& origin, const QString& reply);
    00098         void _q_ctcpActionReceived(const QString& origin, const QString& action);
    00099         void _q_numericMessageReceived(const QString& origin, uint code, const QStringList& params);
    00100         void _q_unknownMessageReceived(const QString& origin, const QStringList& params);
    00101 #endif // IRC_NO_DEPRECATED
    00102     };
    00103 }
    00104
    00105 #endif // IRC_BUFFER_P_H