QXmppMucRoom Class

The QXmppMucRoom class represents a multi-user chat room as defined by XEP-0045: Multi-User Chat. More...

Header: #include <QXmppMucManager.h>

Public Types

enum Action { NoAction, SubjectAction, ConfigurationAction, PermissionsAction, KickAction }
flags Actions

Properties

Public Functions

QXmppMucRoom::Actions allowedActions() const
bool isJoined() const
QString jid() const
QString name() const
QString nickName() const
QString participantFullJid(const QString &jid) const
QXmppPresence participantPresence(const QString &jid) const
QStringList participants() const
QString password() const
void setNickName(const QString &nickName)
void setPassword(const QString &password)
void setSubject(const QString &subject)
QString subject() const

Public Slots

bool ban(const QString &jid, const QString &reason)
bool join()
bool kick(const QString &jid, const QString &reason)
bool leave(const QString &message = QString())
bool requestConfiguration()
bool requestPermissions()
bool sendInvitation(const QString &jid, const QString &reason)
bool sendMessage(const QString &text)
bool setConfiguration(const QXmppDataForm &form)
bool setPermissions(const QList<QXmppMucItem> &permissions)

Signals

void allowedActionsChanged(QXmppMucRoom::Actions actions)
void configurationReceived(const QXmppDataForm &configuration)
void error(const QXmppStanza::Error &error)
void isJoinedChanged()
void joined()
void kicked(const QString &jid, const QString &reason)
void left()
void messageReceived(const QXmppMessage &message)
void nameChanged(const QString &name)
void nickNameChanged(const QString &nickName)
void participantAdded(const QString &jid)
void participantChanged(const QString &jid)
void participantRemoved(const QString &jid)
void participantsChanged()
void permissionsReceived(const QList<QXmppMucItem> &permissions)
void subjectChanged(const QString &subject)

Detailed Description

See also QXmppMucManager.

Member Type Documentation

enum QXmppMucRoom::Action
flags QXmppMucRoom::Actions

This enum is used to describe chat room actions.

ConstantValueDescription
QXmppMucRoom::NoAction0no action.
QXmppMucRoom::SubjectAction1change the room's subject.
QXmppMucRoom::ConfigurationAction2change the room's configuration.
QXmppMucRoom::PermissionsAction4change the room's permissions.
QXmppMucRoom::KickAction8kick users from the room.

The Actions type is a typedef for QFlags<Action>. It stores an OR combination of Action values.

Property Documentation

[read-only] allowedActions : QXmppMucRoom::Actions

The actions you are allowed to perform on the room

Access functions:

QXmppMucRoom::Actions allowedActions() const

Notifier signal:

void allowedActionsChanged(QXmppMucRoom::Actions actions)

[read-only] isJoined : bool

Whether you are currently in the room

Access functions:

bool isJoined() const

Notifier signal:

void isJoinedChanged()

[read-only] jid : const QString

The chat room's bare JID

Access functions:

QString jid() const

[read-only] name : QString

The chat room's human-readable name

Access functions:

QString name() const

Notifier signal:

void nameChanged(const QString &name)

nickName : QString

Your own nickname

Access functions:

QString nickName() const
void setNickName(const QString &nickName)

Notifier signal:

void nickNameChanged(const QString &nickName)

[read-only] participants : QStringList

The list of participant JIDs

Access functions:

QStringList participants() const

Notifier signal:

void participantsChanged()

password : QString

The chat room password

Access functions:

QString password() const
void setPassword(const QString &password)

subject : QString

The room's subject

Access functions:

QString subject() const
void setSubject(const QString &subject)

Notifier signal:

void subjectChanged(const QString &subject)

Member Function Documentation

QXmppMucRoom::Actions QXmppMucRoom::allowedActions() const

Returns the actions you are allowed to perform on the room.

Note: Getter function for property allowedActions.

[signal] void QXmppMucRoom::allowedActionsChanged(QXmppMucRoom::Actions actions)

This signal is emitted when the allowed actions change.

Note: Notifier signal for property allowedActions.

[slot] bool QXmppMucRoom::ban(const QString &jid, const QString &reason)

Bans the specified user from the chat room.

The specified jid is the Bare JID of the form "user@host". reason gives the reason for the ban.

Returns true if the request was sent, false otherwise.

[signal] void QXmppMucRoom::configurationReceived(const QXmppDataForm &configuration)

This signal is emitted when the configuration form for the room is received.

[signal] void QXmppMucRoom::error(const QXmppStanza::Error &error)

This signal is emitted when an error is encountered.

bool QXmppMucRoom::isJoined() const

Returns true if you are currently in the room.

Note: Getter function for property isJoined.

QString QXmppMucRoom::jid() const

Returns the chat room's bare JID.

Note: Getter function for property jid.

[slot] bool QXmppMucRoom::join()

Joins the chat room.

Returns true if the request was sent, false otherwise.

[signal] void QXmppMucRoom::joined()

This signal is emitted once you have joined the room.

[slot] bool QXmppMucRoom::kick(const QString &jid, const QString &reason)

Kicks the specified user from the chat room.

The specified jid is the Occupant JID of the form "room@service/nick". reason gives the reason for the kick.

Returns true if the request was sent, false otherwise.

[signal] void QXmppMucRoom::kicked(const QString &jid, const QString &reason)

This signal is emitted if you get kicked from the room.

jid and reason.

[slot] bool QXmppMucRoom::leave(const QString &message = QString())

Leaves the chat room with an optional message.

Returns true if the request was sent, false otherwise.

[signal] void QXmppMucRoom::left()

This signal is emitted once you have left the room.

[signal] void QXmppMucRoom::messageReceived(const QXmppMessage &message)

This signal is emitted when a message is received.

QString QXmppMucRoom::name() const

Returns the chat room's human-readable name.

This name will only be available after the room has been joined.

Note: Getter function for property name.

[signal] void QXmppMucRoom::nameChanged(const QString &name)

This signal is emitted when the room's human-readable name changes.

Note: Notifier signal for property name.

QString QXmppMucRoom::nickName() const

Returns your own nickname.

Note: Getter function for property nickName.

See also setNickName().

[signal] void QXmppMucRoom::nickNameChanged(const QString &nickName)

This signal is emitted when your own nick name changes.

nickName.

Note: Notifier signal for property nickName.

[signal] void QXmppMucRoom::participantAdded(const QString &jid)

This signal is emitted when a participant joins the room.

jid.

[signal] void QXmppMucRoom::participantChanged(const QString &jid)

This signal is emitted when a participant changes.

jid.

[invokable] QString QXmppMucRoom::participantFullJid(const QString &jid) const

Returns the "Full JID" of the given participant.

The specified jid is the Occupant JID of the form "room@service/nick".

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QXmppPresence QXmppMucRoom::participantPresence(const QString &jid) const

Returns the presence for the given participant.

The specified jid is the Occupant JID of the form "room@service/nick".

[signal] void QXmppMucRoom::participantRemoved(const QString &jid)

This signal is emitted when a participant leaves the room.

jid.

QStringList QXmppMucRoom::participants() const

Returns the list of participant JIDs.

These JIDs are Occupant JIDs of the form "room@service/nick".

Note: Getter function for property participants.

QString QXmppMucRoom::password() const

Returns the chat room password.

Note: Getter function for property password.

See also setPassword().

[signal] void QXmppMucRoom::permissionsReceived(const QList<QXmppMucItem> &permissions)

This signal is emitted when the room's permissions are received.

[slot] bool QXmppMucRoom::requestConfiguration()

Request the configuration form for the chat room.

Returns true if the request was sent, false otherwise.

See also configurationReceived().

[slot] bool QXmppMucRoom::requestPermissions()

Request the room's permissions.

Returns true if the request was sent, false otherwise.

See also permissionsReceived().

[slot] bool QXmppMucRoom::sendInvitation(const QString &jid, const QString &reason)

Invites the user with JID jid to the chat room with the given reason.

Returns true if the request was sent, false otherwise.

[slot] bool QXmppMucRoom::sendMessage(const QString &text)

Sends a message with body text to the room.

This is just a helper function, you can as well also send a message to the channel manually by setting the message type to 'groupchat' and addressing the JID of the MUC room.

Returns true if the request was sent, false otherwise.

[slot] bool QXmppMucRoom::setConfiguration(const QXmppDataForm &form)

Send the configuration form for the chat room.

Returns true if the request was sent, false otherwise.

void QXmppMucRoom::setNickName(const QString &nickName)

Sets your own nickname to nickName.

You need to set your nickname before calling join().

Note: Setter function for property nickName.

See also nickName().

void QXmppMucRoom::setPassword(const QString &password)

Sets the chat room password.

Note: Setter function for property password.

See also password().

[slot] bool QXmppMucRoom::setPermissions(const QList<QXmppMucItem> &permissions)

Sets the room's permissions.

Returns true if the request was sent, false otherwise.

void QXmppMucRoom::setSubject(const QString &subject)

Sets the chat room's subject.

Note: Setter function for property subject.

See also subject().

QString QXmppMucRoom::subject() const

Returns the room's subject.

Note: Getter function for property subject.

See also setSubject().

[signal] void QXmppMucRoom::subjectChanged(const QString &subject)

This signal is emitted when the room's subject changes.

Note: Notifier signal for property subject.