Communi  3.0.0
A cross-platform IRC framework written with Qt
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Macros Groups Pages
Public Slots | Signals | Public Member Functions | Properties | List of all members
IrcBuffer Class Reference

Keeps track of buffer status. More...

Inherits QObject.

Inherited by IrcChannel.

Public Slots

void receiveMessage (IrcMessage *message)
 

Signals

void messageReceived (IrcMessage *message)
 

Public Member Functions

Q_INVOKABLE IrcBuffer (QObject *parent=0)
 
virtual ~IrcBuffer ()
 
Q_INVOKABLE bool sendCommand (IrcCommand *command)
 
Q_INVOKABLE IrcChanneltoChannel ()
 

Properties

bool active
 
bool channel
 
IrcConnection connection
 
IrcBufferModel model
 
QString name
 
IrcNetwork network
 
bool persistent
 
QString prefix
 
bool sticky
 
QString title
 

Detailed Description

See Also
IrcBufferModel

Constructor & Destructor Documentation

IrcBuffer::IrcBuffer ( QObject parent = 0)
explicit

Constructs a new buffer object with parent.

IrcBuffer::~IrcBuffer ( )
virtual

Destructs the buffer object.

Member Function Documentation

void IrcBuffer::messageReceived ( IrcMessage message)
signal
void IrcBuffer::receiveMessage ( IrcMessage message)
slot

Emits messageReceived() with message.

IrcBufferModel handles only buffer specific messages and delivers them to the appropriate IrcBuffer instances. When applications decide to handle IrcBuffer::messageReceived(), IrcBufferModel::messageIgnored() makes it easy to implement handling for the rest, non-buffer specific messages. This method can be used to forward such ignored messages to the desired buffers (for instance the one that is currently active in the GUI).

bool IrcBuffer::sendCommand ( IrcCommand command)

Sends a command to the server.

This method is provided for convenience. It is equal to:

connection->sendCommand(command);
See Also
IrcConnection::sendCommand()
IrcChannel * IrcBuffer::toChannel ( )

Returns the buffer cast to a IrcChannel, if the class is actually a channel, 0 otherwise.

See Also
isChannel()

Property Documentation

bool IrcBuffer::active
read

This property holds whether the buffer is active.

A buffer is considered active when a connection is established. Furthermore, channel buffers are only considered active when the user is on the channel.

Access function:
  • bool isActive() const
Notifier signal:
  • void activeChanged(bool active)
See Also
IrcConnection::connected
bool IrcBuffer::channel
read

This property holds whether the buffer is a channel.

Access function:
  • bool isChannel() const
See Also
toChannel()
IrcConnection * IrcBuffer::connection
read

This property holds the connection of the buffer.

Access function:
IrcBufferModel * IrcBuffer::model
read

This property holds the model of the buffer.

Access function:
QString IrcBuffer::name
readwrite

This property holds the name part of the buffer title.

Access functions:
Notifier signal:
  • void nameChanged(const QString& name)
IrcNetwork * IrcBuffer::network
read

This property holds the network of the buffer.

Access function:
bool IrcBuffer::persistent
readwrite

This property holds whether the buffer is persistent.

The default value is false.

A persistent buffer does not get removed and destructed when calling IrcBufferModel::clear(), or when when leaving the corresponding channel. In order to remove a persistent buffer, either explicitly call IrcBufferModel::remove() or delete the buffer.

Access functions:
  • bool isPersistent() const
  • void setPersistent(bool persistent)
Notifier signal:
  • void persistentChanged(bool persistent)
QString IrcBuffer::prefix
readwrite

This property holds the prefix part of the buffer title.

Access functions:
Notifier signal:
  • void prefixChanged(const QString& prefix)
bool IrcBuffer::sticky
readwrite

This property holds whether the buffer is sticky.

A sticky buffer stays in the beginning (Qt::AscendingOrder) or end (Qt::DescendingOrder) of the list of buffers in IrcBufferModel.

The default value is false.

Access functions:
  • bool isSticky() const
  • void setSticky(bool sticky)
Notifier signal:
  • void stickyChanged(bool sticky)
QString IrcBuffer::title
read

This property holds the whole buffer title.

The title consists of prefix and name.

Access function:
Notifier signal:
  • void titleChanged(const QString& title)