Communi  1.1.0
A cross-platform IRC client library written with Qt 4
 All Classes Files Functions Enumerations Enumerator Properties Macros Groups Pages
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>

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 QByteArray toData () const

Static Public Member Functions

static Q_INVOKABLE IrcMessagefromCommand (const QString &sender, IrcCommand *command, QObject *parent=0)
static Q_INVOKABLE IrcMessagefromData (const QByteArray &data, const QByteArray &encoding, QObject *parent=0)

Properties

QString command
bool own
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).

Private 

A private message (IrcPrivateMessage).

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::fromData ( const QByteArray &  data,
const QByteArray &  encoding,
QObject *  parent = 0 
)
static

Creates a new message from data with encoding and parent.

QByteArray IrcMessage::toData ( ) const

Returns the message as received from an IRC server.


Property Documentation

QString IrcMessage::command
read

This property holds the message command.

Access functions:
  • QString command() const
bool IrcMessage::own
read

This property is true if this is user's own message; otherwise false.

A message is considered own if the sender matches IrcSession::nickName.

QStringList IrcMessage::parameters
read

This property holds the message parameters.

Access functions:
  • QStringList parameters() const
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: