QXmpp: QXmppMucRoom Class Reference

QXmpp Version:0.7.5

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Functions Variables Enumerations Enumerator Properties Groups
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>`

## 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 ()
| Destroys a QXmppMucRoom.
Actions | allowedActions () const
bool | isJoined () const
QString | jid () const
QString | name () const
QString | nickName () const
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
void | setPassword (const QString &password)
QString | subject () const
void | setSubject (const QString &subject)

## Properties
QXmppMucRoom::Actions | allowedActions
| Returns the actions you are allowed to perform on the room.
bool | isJoined
| Returns true if you are currently in the room.
QString | jid
| Returns the chat room's bare JID.
QString | name
QString | nickName
| Returns your own nickname.
QStringList | participants
QString | password
| Returns the chat room password.
QString | subject
| Returns 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

enum QXmppMucRoom::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

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

bool QXmppMucRoom::join | ( |  | ) |
| slot

Joins the chat room.

Returns
  true if the request was sent, false otherwise

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

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

Leaves the chat room.

Parameters

  message | An optional message.

Returns
  true if the request was sent, false otherwise

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

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

bool QXmppMucRoom::requestConfiguration | ( |  | ) |
| slot

Request the configuration form for the chat room.

Returns
  true if the request was sent, false otherwise

See Also
  configurationReceived()

bool QXmppMucRoom::requestPermissions | ( |  | ) |
| slot

Request the room's permissions.

Returns
  true if the request was sent, false otherwise

See Also
  permissionsReceived()

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

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

Sends a message to the room.

Returns
  true if the request was sent, false otherwise

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

void QXmppMucRoom::setNickName | ( | const QString & | nickName | ) |

Sets your own nickname.

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

Parameters

  nickName |

void QXmppMucRoom::setPassword | ( | const QString & | password | ) |

Sets the chat room password.

Parameters

  password |

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

Sets the room's permissions.

Parameters

  permissions |

Returns
  true if the request was sent, false otherwise

void QXmppMucRoom::setSubject | ( | const QString & | subject | ) |

Sets the chat room's subject.

Parameters

  subject |

## Property Documentation

QString QXmppMucRoom::name
| read

Returns the chat room's human-readable name.

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

QStringList QXmppMucRoom::participants
| read

Returns the list of participant JIDs.

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

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

- QXmppMucManager.h
- QXmppMucManager.cpp