Communi  3.4.0
A cross-platform IRC framework written with Qt
Public Slots | Public Member Functions | Protected Slots | Properties | List of all members
IrcProtocol Class Reference

Implements the IRC protocol and provides means for implementing support for custom protocols. More...

Inherits QObject.

Public Slots

void receiveMessage (IrcMessage *message)
 

Public Member Functions

 IrcProtocol (IrcConnection *connection)
 
virtual ~IrcProtocol ()
 
virtual void close ()
 
virtual void open ()
 
virtual void read ()
 
virtual bool write (const QByteArray &data)
 

Protected Slots

void setActiveCapabilities (const QSet< QString > &capabilities)
 
void setAvailableCapabilities (const QSet< QString > &capabilities)
 
void setInfo (const QHash< QString, QString > &info)
 
void setNickName (const QString &name)
 
void setStatus (IrcConnection::Status status)
 

Properties

IrcConnection connection
 
QAbstractSocket socket
 

Detailed Description

Since
3.2
See also
IrcConnection::protocol

Constructor & Destructor Documentation

IrcProtocol::IrcProtocol ( IrcConnection connection)
explicit

Constructs a new IRC protocol for connection.

IrcProtocol::~IrcProtocol ( )
virtual

Destructs the IRC protocol.

Member Function Documentation

void IrcProtocol::close ( )
virtual

This method is called when the connection has been lost.

void IrcProtocol::open ( )
virtual

This method is called when the connection has been established.

The default implementation sends the NICK, USER and PASSWORD commands as defined in RFC 1459.

Furthermore, it sends a CAP LS command as specified in IRC Client Capabilities Extension.

void IrcProtocol::read ( )
virtual

This method is called when the socket has new data available for read.

The default implementation reads lines as specified in RFC 1459.

See also
socket
void IrcProtocol::receiveMessage ( IrcMessage message)
slot

This method should be called by the protocol implementation to make the underlying IRC connection receive a message.

See also
IrcConnection::messageReceived()
void IrcProtocol::setActiveCapabilities ( const QSet< QString > &  capabilities)
protectedslot

This method should be called by the protocol implementation to notify the underlying IRC network about a change in active capabilities.

See also
IrcNetwork::activeCapabilities
void IrcProtocol::setAvailableCapabilities ( const QSet< QString > &  capabilities)
protectedslot

This method should be called by the protocol implementation to notify the underlying IRC network about a change in available capabilities.

See also
IrcNetwork::availableCapabilities
void IrcProtocol::setInfo ( const QHash< QString, QString > &  info)
protectedslot

This method should be called by the protocol implementation to initialize the underlying IRC network connection info.

See also
IrcNetwork::initialized
void IrcProtocol::setNickName ( const QString name)
protectedslot

This method should be called by the protocol implementation to notify the underlying IRC connection about a nick name change.

See also
IrcConnection::nickName
void IrcProtocol::setStatus ( IrcConnection::Status  status)
protectedslot

This method should be called by the protocol implementation to notify the underlying IRC connection about a status change.

See also
IrcConnection::status
bool IrcProtocol::write ( const QByteArray data)
virtual

This method is called when raw data should be written to the socket.

The default implementation writes the data and appends "\r\n" as specified in RFC 1459.

See also
socket

Property Documentation

IrcConnection * IrcProtocol::connection
read

This property holds the connection.

Access function:
QAbstractSocket * IrcProtocol::socket
read

This property holds the socket.

Access functions: