QXmpp  Version:1.3.0
Public Types | Public Slots | Signals | Public Member Functions | Properties | Friends | List of all members
QXmppMucRoom Class Reference

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

#include <QXmppMucManager.h>

Inherits QObject.

Public Types

enum  Action {
  NoAction = 0, SubjectAction = 1, ConfigurationAction = 2, PermissionsAction = 4,
  KickAction = 8
}
 This enum is used to describe chat room actions. More...
 

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 setConfiguration (const QXmppDataForm &form)
 
bool setPermissions (const QList< QXmppMucItem > &permissions)
 
bool sendInvitation (const QString &jid, const QString &reason)
 
bool sendMessage (const QString &text)
 

Signals

void allowedActionsChanged (QXmppMucRoom::Actions actions) const
 This signal is emitted when the allowed actions change.
 
void configurationReceived (const QXmppDataForm &configuration)
 This signal is emitted when the configuration form for the room is received.
 
void error (const QXmppStanza::Error &error)
 This signal is emitted when an error is encountered.
 
void joined ()
 This signal is emitted once you have joined the room.
 
void kicked (const QString &jid, const QString &reason)
 This signal is emitted if you get kicked from the room.
 
void left ()
 This signal is emitted once you have left the room.
 
void messageReceived (const QXmppMessage &message)
 This signal is emitted when a message is received.
 
void nameChanged (const QString &name)
 This signal is emitted when the room's human-readable name changes.
 
void nickNameChanged (const QString &nickName)
 This signal is emitted when your own nick name changes.
 
void participantAdded (const QString &jid)
 This signal is emitted when a participant joins the room.
 
void participantChanged (const QString &jid)
 This signal is emitted when a participant changes.
 
void participantRemoved (const QString &jid)
 This signal is emitted when a participant leaves the room.
 
void permissionsReceived (const QList< QXmppMucItem > &permissions)
 This signal is emitted when the room's permissions are received.
 
void subjectChanged (const QString &subject)
 This signal is emitted when the room's subject changes.
 

Public Member Functions

 ~QXmppMucRoom () override
 Destroys a QXmppMucRoom.
 
Actions allowedActions () const
 Returns the actions you are allowed to perform on the room.
 
bool isJoined () const
 Returns true if you are currently in the room.
 
QString jid () const
 Returns the chat room's bare JID.
 
QString name () const
 
QString nickName () const
 Returns your own nickname.
 
void setNickName (const QString &nickName)
 
Q_INVOKABLE QString participantFullJid (const QString &jid) const
 
QXmppPresence participantPresence (const QString &jid) const
 
QStringList participants () const
 
QString password () const
 Returns the chat room password.
 
void setPassword (const QString &password)
 
QString subject () const
 Returns the room's subject.
 
void setSubject (const QString &subject)
 

Properties

QXmppMucRoom::Actions allowedActions
 The actions you are allowed to perform on the room.
 
bool isJoined
 Whether you are currently in the room.
 
QString jid
 The chat room's bare JID.
 
QString name
 The chat room's human-readable name.
 
QString nickName
 Your own nickname.
 
QStringList participants
 The list of participant JIDs.
 
QString password
 The chat room password.
 
QString subject
 The room's subject.
 

Friends

class QXmppMucManager
 

Detailed Description

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

See also
QXmppMucManager

Member Enumeration Documentation

◆ Action

This enum is used to describe chat room actions.

Enumerator
NoAction 

no action

SubjectAction 

change the room's subject

ConfigurationAction 

change the room's configuration

PermissionsAction 

change the room's permissions

KickAction 

kick users from the room

Member Function Documentation

◆ ban

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

Bans the specified user from the chat room.

The specified jid is the Bare JID of the form "user@host".

Returns
true if the request was sent, false otherwise

◆ join

bool QXmppMucRoom::join ( )
slot

Joins the chat room.

Returns
true if the request was sent, false otherwise

◆ kick

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

Kicks the specified user from the chat room.

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

Returns
true if the request was sent, false otherwise

◆ leave

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

Leaves the chat room.

Parameters
messageAn optional message.
Returns
true if the request was sent, false otherwise

◆ name()

QString QXmppMucRoom::name ( ) const

Returns the chat room's human-readable name.

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

◆ participantFullJid()

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".

◆ participantPresence()

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".

◆ participants()

QStringList QXmppMucRoom::participants ( ) const

Returns the list of participant JIDs.

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

◆ requestConfiguration

bool QXmppMucRoom::requestConfiguration ( )
slot

Request the configuration form for the chat room.

Returns
true if the request was sent, false otherwise
See also
configurationReceived()

◆ requestPermissions

bool QXmppMucRoom::requestPermissions ( )
slot

Request the room's permissions.

Returns
true if the request was sent, false otherwise
See also
permissionsReceived()

◆ sendInvitation

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

Invites a user to the chat room.

Parameters
jid
reason
Returns
true if the request was sent, false otherwise

◆ sendMessage

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

Sends a message to the room.

Returns
true if the request was sent, false otherwise

◆ setConfiguration

bool QXmppMucRoom::setConfiguration ( const QXmppDataForm form)
slot

Send the configuration form for the chat room.

Parameters
form
Returns
true if the request was sent, false otherwise

◆ setNickName()

void QXmppMucRoom::setNickName ( const QString &  nickName)

Sets your own nickname.

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

Parameters
nickName

◆ setPassword()

void QXmppMucRoom::setPassword ( const QString &  password)

Sets the chat room password.

Parameters
password

◆ setPermissions

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

Sets the room's permissions.

Parameters
permissions
Returns
true if the request was sent, false otherwise

◆ setSubject()

void QXmppMucRoom::setSubject ( const QString &  subject)

Sets the chat room's subject.

Parameters
subject

The documentation for this class was generated from the following files: