LibIrcClient-Qt: include/ircbuffer.h Source File

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

- File List
- File Members

# include/ircbuffer.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_BUFFER_H
    00016 #define IRC_BUFFER_H
    00017
    00018 #include <ircglobal.h>
    00019 #include <QStringList>
    00020 #include <QObject>
    00021
    00022 namespace Irc
    00023 {
    00024     class Session;
    00025     class BufferPrivate;
    00026
    00027     class IRC_EXPORT Buffer : public QObject
    00028     {
    00029         Q_OBJECT
    00030         Q_PROPERTY(QString receiver READ receiver)
    00031         Q_PROPERTY(QString topic READ topic)
    00032         Q_PROPERTY(QStringList names READ names)
    00033         Q_FLAGS(MessageFlags)
    00034         Q_ENUMS(MessageFlag)
    00035
    00036     public:
    00037         ~Buffer();
    00038
    00039         Session* session() const;
    00040
    00041         QString receiver() const;
    00042         QString topic() const;
    00043         QStringList names() const;
    00044         QString modes(const QString& name) const;
    00045         QString visualMode(const QString& name) const;
    00046
    00047         enum MessageFlag
    00048         {
    00049             NoFlags = 0x0,
    00050             IdentifiedFlag = 0x1,
    00051             EchoFlag = 0x2,
    00052         };
    00053         Q_DECLARE_FLAGS(MessageFlags, MessageFlag)
    00054
    00055     public Q_SLOTS:
    00056         bool message(const QString& message);
    00057         bool notice(const QString& notice);
    00058         bool ctcpAction(const QString& action);
    00059
    00060     Q_SIGNALS:
    00061         void receiverChanged(const QString& receiver);
    00062         void motdReceived(const QString& motd);
    00063         void joined(const QString& origin);
    00064         void parted(const QString& origin, const QString& message);
    00065         void quit(const QString& origin, const QString& message);
    00066         void nickChanged(const QString& origin, const QString& nick);
    00067         void modeChanged(const QString& origin, const QString& mode, const QString& args);
    00068         void topicChanged(const QString& origin, const QString& topic);
    00069         void invited(const QString& origin, const QString& receiver, const QString& channel);
    00070         void kicked(const QString& origin, const QString& nick, const QString& message);
    00071         void messageReceived(const QString& origin, const QString& message,
    00072                              Irc::Buffer::MessageFlags flags = Irc::Buffer::NoFlags);
    00073         void noticeReceived(const QString& origin, const QString& notice,
    00074                             Irc::Buffer::MessageFlags flags = Irc::Buffer::NoFlags);
    00075         void ctcpRequestReceived(const QString& origin, const QString& request,
    00076                                  Irc::Buffer::MessageFlags flags = Irc::Buffer::NoFlags);
    00077         void ctcpReplyReceived(const QString& origin, const QString& reply,
    00078                                Irc::Buffer::MessageFlags flags = Irc::Buffer::NoFlags);
    00079         void ctcpActionReceived(const QString& origin, const QString& action,
    00080                                 Irc::Buffer::MessageFlags flags = Irc::Buffer::NoFlags);
    00081         void numericMessageReceived(const QString& origin, uint code, const QStringList& params);
    00082         void unknownMessageReceived(const QString& origin, const QStringList& params);
    00083
    00084     protected:
    00085         Buffer(const QString& receiver, Session* parent = 0);
    00086         Buffer(BufferPrivate& dd, const QString& receiver, Session* parent = 0);
    00087         BufferPrivate* const d_ptr;
    00088
    00089     private:
    00090         Q_DECLARE_PRIVATE(Buffer)
    00091         Q_DISABLE_COPY(Buffer)
    00092         friend class SessionPrivate;
    00093         friend class Session;
    00094     };
    00095 }
    00096
    00097 #ifndef QT_NO_DEBUG_STREAM
    00098 IRC_EXPORT QDebug operator<<(QDebug debug, const Irc::Buffer* buffer);
    00099 #endif // QT_NO_DEBUG_STREAM
    00100
    00101 Q_DECLARE_OPERATORS_FOR_FLAGS(Irc::Buffer::MessageFlags)
    00102
    00103 #endif // IRC_BUFFER_H