Communi 1.0.0
A cross-platform IRC client library written with Qt 4
|
The IrcMessage class is the base class of all IRC message classes. More...
#include <IrcMessage>
Inherits QObject.
Inherited by IrcErrorMessage, IrcInviteMessage, IrcJoinMessage, IrcKickMessage, IrcModeMessage, IrcNickMessage, IrcNoticeMessage, IrcNumericMessage, IrcPartMessage, IrcPingMessage, IrcPongMessage, IrcPrivateMessage, IrcQuitMessage, and IrcTopicMessage.
Public Types | |
enum | Type { Unknown, Nick, Quit, Join, Part, Topic, Invite, Kick, Mode, Private, Notice, Ping, Pong, Error, Numeric } |
Public Member Functions | |
Q_INVOKABLE | IrcMessage (QObject *parent=0) |
virtual | ~IrcMessage () |
Q_INVOKABLE QString | toString () const |
Static Public Member Functions | |
static Q_INVOKABLE IrcMessage * | fromCommand (const QString &sender, IrcCommand *command, QObject *parent=0) |
static Q_INVOKABLE IrcMessage * | fromString (const QString &str, QObject *parent=0) |
Properties | |
QString | command |
QStringList | parameters |
IrcSender | sender |
Type | type |
bool | valid |
The IrcMessage class is the base class of all IRC message classes.
IRC messages are received from an IRC server. IrcSession translates received messages into IrcMessage instances and emits the IrcSession::messageReceived() signal upon message received.
Subclasses of IrcMessage contain specialized accessors for parameters that are specific to the particular type of message. See IrcMessage::Type for the list of supported message types.
enum IrcMessage::Type |
This enum describes the supported message types.
Unknown |
An unknown message (IrcMessage). |
Nick |
A nick message (IrcNickMessage). |
Quit |
A quit message (IrcQuitMessage). |
Join |
A join message (IrcJoinMessage). |
Part |
A part message (IrcPartMessage). |
Topic |
A topic message (IrcTopicMessage). |
Invite |
An invite message (IrcInviteMessage). |
Kick |
A kick message (IrcKickMessage). |
Mode |
A mode message (IrcModeMessage). |
Notice |
A notice message (IrcNoticeMessage). |
Ping |
A ping message (IrcPingMessage). |
Pong |
A pong message (IrcPongMessage). |
Error |
An error message (IrcErrorMessage). |
Numeric |
A numeric message (IrcNumericMessage). |
IrcMessage::IrcMessage | ( | QObject * | parent = 0 | ) | [explicit] |
Constructs a new IrcMessage with parent.
IrcMessage::~IrcMessage | ( | ) | [virtual] |
Destructs the IRC message.
IrcMessage * IrcMessage::fromCommand | ( | const QString & | sender, |
IrcCommand * | command, | ||
QObject * | parent = 0 |
||
) | [static] |
Creates a new message from sender and command with parent.
IrcMessage * IrcMessage::fromString | ( | const QString & | str, |
QObject * | parent = 0 |
||
) | [static] |
Creates a new message from str with parent.
QString IrcMessage::toString | ( | ) | const |
Returns the message as a raw string as received from an IRC server.
QString IrcMessage::command [read] |
This property holds the message command.
QStringList IrcMessage::parameters [read] |
This property holds the message parameters.
IrcSender IrcMessage::sender [read] |
This property holds the message sender.
IrcMessage::Type IrcMessage::type [read] |
This property holds the message type.
bool IrcMessage::valid [read] |
This property is true
if the message is valid; otherwise false
.
A message is considered valid if the sender is valid and the parameters match the message.