QXmpp  Version:0.9.3
QXmppPresence.h
00001 /*
00002  * Copyright (C) 2008-2014 The QXmpp developers
00003  *
00004  * Author:
00005  *  Manjeet Dahiya
00006  *
00007  * Source:
00008  *  https://github.com/qxmpp-project/qxmpp
00009  *
00010  * This file is a part of QXmpp library.
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  */
00023 
00024 
00025 #ifndef QXMPPPRESENCE_H
00026 #define QXMPPPRESENCE_H
00027 
00028 #include "QXmppStanza.h"
00029 #include "QXmppMucIq.h"
00030 
00031 class QXmppPresencePrivate;
00032 
00036 class QXMPP_EXPORT QXmppPresence : public QXmppStanza
00037 {
00038 public:
00040     enum Type
00041     {
00042         Error = 0,      
00043         Available,      
00044         Unavailable,    
00045         Subscribe,      
00046         Subscribed,     
00047         Unsubscribe,    
00048         Unsubscribed,   
00049         Probe           
00050     };
00051 
00053     enum AvailableStatusType
00054     {
00055         Online = 0,      
00056         Away,           
00057         XA,             
00058         DND,            
00059         Chat,           
00060         Invisible       
00061     };
00062 
00065     enum VCardUpdateType
00066     {
00067         VCardUpdateNone = 0,    
00068         VCardUpdateNoPhoto,     
00069         VCardUpdateValidPhoto,  
00070         VCardUpdateNotReady     
00071 
00074     };
00075 
00076     QXmppPresence(QXmppPresence::Type type = QXmppPresence::Available);
00077     QXmppPresence(const QXmppPresence &other);
00078     ~QXmppPresence();
00079 
00080     QXmppPresence& operator=(const QXmppPresence &other);
00081 
00082     AvailableStatusType availableStatusType() const;
00083     void setAvailableStatusType(AvailableStatusType type);
00084 
00085     int priority() const;
00086     void setPriority(int priority);
00087 
00088     QXmppPresence::Type type() const;
00089     void setType(QXmppPresence::Type);
00090 
00091     QString statusText() const;
00092     void setStatusText(const QString& statusText);
00093 
00095     void parse(const QDomElement &element);
00096     void toXml(QXmlStreamWriter *writer) const;
00098 
00099     // XEP-0045: Multi-User Chat
00100     QXmppMucItem mucItem() const;
00101     void setMucItem(const QXmppMucItem &item);
00102 
00103     QString mucPassword() const;
00104     void setMucPassword(const QString &password);
00105 
00106     QList<int> mucStatusCodes() const;
00107     void setMucStatusCodes(const QList<int> &codes);
00108 
00109     bool isMucSupported() const;
00110     void setMucSupported(bool supported);
00111 
00113     QByteArray photoHash() const;
00114     void setPhotoHash(const QByteArray&);
00115 
00116     VCardUpdateType vCardUpdateType() const;
00117     void setVCardUpdateType(VCardUpdateType type);
00118 
00119     // XEP-0115: Entity Capabilities
00120     QString capabilityHash() const;
00121     void setCapabilityHash(const QString&);
00122 
00123     QString capabilityNode() const;
00124     void setCapabilityNode(const QString&);
00125 
00126     QByteArray capabilityVer() const;
00127     void setCapabilityVer(const QByteArray&);
00128 
00129     QStringList capabilityExt() const;
00130 
00131 private:
00132     QSharedDataPointer<QXmppPresencePrivate> d;
00133 };
00134 
00135 #endif // QXMPPPRESENCE_H
 All Classes Functions Enumerations Enumerator Properties