QXmpp Version:0.3.91
Classes | Public Types | Public Member Functions
QXmppPresence Class Reference

The QXmppPresence class represents an XMPP presence stanza. More...

#include <QXmppPresence.h>

Inheritance diagram for QXmppPresence:
QXmppStanza

List of all members.

Classes

class  Status
 The QXmppPresence::Status class represents the status of an XMPP entity. More...

Public Types

enum  Type {
  Error = 0, Available, Unavailable, Subscribe,
  Subscribed, Unsubscribe, Unsubscribed, Probe
}
 This enum is used to describe a presence type. More...
enum  VCardUpdateType { VCardUpdateNone = 0, VCardUpdateNoPhoto, VCardUpdateValidPhoto, VCardUpdateNotReady }

Public Member Functions

 QXmppPresence (QXmppPresence::Type type=QXmppPresence::Available, const QXmppPresence::Status &status=QXmppPresence::Status())
 ~QXmppPresence ()
 Destroys a QXmppPresence.
QXmppPresence::Type type () const
void setType (QXmppPresence::Type)
QXmppPresence::Statusstatus ()
 Returns a reference to the presence status, allowing you to change it.
const QXmppPresence::Statusstatus () const
 Returns the presence status.
void setStatus (const QXmppPresence::Status &)
QXmppMucItem mucItem () const
 Returns the MUC item.
void setMucItem (const QXmppMucItem &item)
QList< int > mucStatusCodes () const
 Returns the MUC status codes.
void setMucStatusCodes (const QList< int > &codes)
QByteArray photoHash () const
 XEP-0153: vCard-Based Avatars
void setPhotoHash (const QByteArray &)
VCardUpdateType vCardUpdateType () const
void setVCardUpdateType (VCardUpdateType type)
QString capabilityHash () const
 XEP-0115: Entity Capabilities
void setCapabilityHash (const QString &)
 XEP-0115: Entity Capabilities
QString capabilityNode () const
 XEP-0115: Entity Capabilities
void setCapabilityNode (const QString &)
 XEP-0115: Entity Capabilities
QByteArray capabilityVer () const
 XEP-0115: Entity Capabilities
void setCapabilityVer (const QByteArray &)
 XEP-0115: Entity Capabilities
QStringList capabilityExt () const
 Legacy XEP-0115: Entity Capabilities

Detailed Description

The QXmppPresence class represents an XMPP presence stanza.


Member Enumeration Documentation

This enum is used to describe a presence type.

Enumerator:
Error 

An error has occurred regarding processing or delivery of a previously-sent presence stanza.

Available 

Signals that the sender is online and available for communication.

Unavailable 

Signals that the sender is no longer available for communication.

Subscribe 

The sender wishes to subscribe to the recipient's presence.

Subscribed 

The sender has allowed the recipient to receive their presence.

Unsubscribe 

The sender is unsubscribing from another entity's presence.

Unsubscribed 

The subscription request has been denied or a previously-granted subscription has been cancelled.

Probe 

A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.

Enumerator:
VCardUpdateNone 

Protocol is not supported.

VCardUpdateNoPhoto 

User is not using any image.

VCardUpdateValidPhoto 

User is advertising an image.

VCardUpdateNotReady 

User is not ready to advertise an image.

Note:
This enables recipients to distinguish between the absence of an image (empty photo element) and mere support for the protocol (empty update child).

Constructor & Destructor Documentation

QXmppPresence::QXmppPresence ( QXmppPresence::Type  type = QXmppPresence::Available,
const QXmppPresence::Status status = QXmppPresence::Status() 
)

Constructs a QXmppPresence.

Parameters:
type
status

Member Function Documentation

QByteArray QXmppPresence::photoHash ( ) const

XEP-0153: vCard-Based Avatars

Returns the photo-hash of the VCardUpdate.

Returns:
QByteArray
void QXmppPresence::setMucItem ( const QXmppMucItem item)

Sets the MUC item.

Parameters:
item
void QXmppPresence::setMucStatusCodes ( const QList< int > &  codes)

Sets the MUC status codes.

Parameters:
codes
void QXmppPresence::setPhotoHash ( const QByteArray &  photoHash)

Sets the photo-hash of the VCardUpdate.

Parameters:
photoHashas QByteArray
void QXmppPresence::setStatus ( const QXmppPresence::Status status)

Sets the presence status.

Parameters:
status
void QXmppPresence::setType ( QXmppPresence::Type  type)

Sets the presence type.

Parameters:
type
void QXmppPresence::setVCardUpdateType ( VCardUpdateType  type)

Sets the type of VCardUpdate

Parameters:
typeVCardUpdateType
QXmppPresence::Type QXmppPresence::type ( ) const

Returns the presence type.

You can use this method to determine the action which needs to be taken in response to receiving the presence. For instance, if the type is QXmppPresence::Available or QXmppPresence::Unavailable, you could update the icon representing a contact's availability.

QXmppPresence::VCardUpdateType QXmppPresence::vCardUpdateType ( ) const

Returns the type of VCardUpdate

Returns:
VCardUpdateType

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations Enumerator Properties