class Channels

Handle an internal list of channels. More...

Definition#include <Channels.h>
InheritsQObject [private]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members


Detailed Description

This class provides methods to access and update an internal channel list.

Channels provides a public interface for read-only access to the channels' information, and a protected interface for updating that information.

const Channel* findChannel (QString name)
[const]

Find the channel object associated with a specified channel name.

Parameters:
nameThe name of the channel to find.

Returns: Channel* A pointer to a Channel object, or 0 if the channel cannot be found.

Channel* findChannelForUpdate (QString name)
[protected]

Find the channel object associated with a specified channel name.

This method returns a pointer to a non-const channel object, allowing updates of the channel object. A pointer obtained through the findChannelForUpdate method should NEVER be deleted.

Parameters:
nameThe name of the channel to find.

void nickChange (const QString& nick, const QString& newNick)
[protected]

Notify the channels object that a user changed nicknames.

call this method when a user changes nicknames, so all channels the user is on updates information on his new nickname.

Parameters:
nickThe user's previous nick.
newNickThe user's new nickname.

void userQuit (const QString& nick)
[protected]

Notify the channels that a user quit IRC. Call this method when a user quits to make sure he is correctly removed from all the Channel objects where he was listed.

Parameters:
nickThe nickname of the user who quit IRC.

void remChannel (QString name)
[protected]

Remove a channel from the internal list and free memory associated with it.

PRECONDITIONS: findChannel(name)

POSTCONDITIONS: !findChannel(name)

Parameters:
nameThe name of the channel to remove

void addChannel (Channel* chan)
[protected]

Add a channel object to the internal list.

PRECONDITIONS: chan != 0; !findChannel(chan->getName())

POSTCONDITIONS: findChannel(chan->getName())

void clear ()
[protected]

Remove all channels from the internal list and free memory associated with them.

Call this method when you want the channel list to be emptied, for instance when the client disconnects from the server.