Communi 1.0.0
A cross-platform IRC client library written with Qt 4
Public Types | Public Member Functions | Static Public Member Functions | Properties
IrcMessage Class Reference

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.

List of all members.

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 IrcMessagefromCommand (const QString &sender, IrcCommand *command, QObject *parent=0)
static Q_INVOKABLE IrcMessagefromString (const QString &str, QObject *parent=0)

Properties

QString command
QStringList parameters
IrcSender sender
Type type
bool valid

Detailed Description

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.

See also:
IrcSession::messageReceived(), IrcMessage::Type

Member Enumeration Documentation

This enum describes the supported message types.

Enumerator:
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).


Constructor & Destructor Documentation

IrcMessage::IrcMessage ( QObject parent = 0) [explicit]

Constructs a new IrcMessage with parent.

IrcMessage::~IrcMessage ( ) [virtual]

Destructs the IRC message.


Member Function Documentation

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.


Property Documentation

QString IrcMessage::command [read]

This property holds the message command.

Access functions:
QStringList IrcMessage::parameters [read]

This property holds the message parameters.

Access functions:
IrcSender IrcMessage::sender [read]

This property holds the message sender.

Access functions:
IrcMessage::Type IrcMessage::type [read]

This property holds the message type.

Access functions:
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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Defines