class ConnectionC

Handle connection-related problems. More...

Definition#include <Connection.h>
InheritsQObject
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Public Static Methods

Protected Methods

Protected Members


Detailed Description

This class is a Controler that handles connection-related events (reconnecting when disconnected, connect on DCC Chat requests, etc).

This class, as most controlers is a singleton.

ConnectionC* instance ()
[static]

Get a pointer to the single ConnectionC instance.

void setServerList (ServerList* pList)

Make the connection controler use pList as its internal server list.

PRECONDITIONS: pList != 0

Parameters:
pListA pointer to an existing ServerList.

void setIRCModule (IRCModule* pModule)

Make the connection controler use pModule to interact with the IRC server.

PRECONDITIONS: pModule != 0

Parameters:
pListA pointer to an existing IRCModule.

void setReconnect (bool value)

Change wether the controler should attempt to reconnect automatically when it gets disconnected from the IRC server. This option is turned on by default, but should be turned off in case of a voluntary disconnection from the server (e.g QUIT)

Parameters:
valueThe new value for the auto-reconnect option.

bool getReconnect ()
[const]

Determine wether the controler currently has auto-reconnect turned on.

Returns: true if auto-reconnect is on, false otherwise.

void connectToNext ()

Make the controler connect to the next available server in list. The list is considered circular, so if the controler reaches the end of the list, it will start again from the beginning. If the connection to the next server fails, the controler will attempt to connect to the server after the next one, and so on. This could unfortunately lead to endless loops if none of the servers are good... =(

void onDisconnect ()
[slot]

Should be connected to an IRCModule::onDisconnect() signal. Notifies the ConnectionC object that the connection to the IRC server has been lost.

void onPrivateCTCP (QString nick,QString ctcpType, QString ctcpText)
[slot]

Should be connected to an IRCModule::onPrivateCTCP() signal. The ConnectionC is only interrested in private DCC Chat requests. All other CTCPs are ignored.