qtmobility/src/contacts/details/qcontactpresence.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    41 
    41 
    42 
    42 
    43 #ifndef QCONTACTPRESENCE_H
    43 #ifndef QCONTACTPRESENCE_H
    44 #define QCONTACTPRESENCE_H
    44 #define QCONTACTPRESENCE_H
    45 
    45 
    46 #include <QtDebug>
       
    47 #include <QString>
    46 #include <QString>
       
    47 #include <QUrl>
    48 
    48 
    49 #include "qtcontactsglobal.h"
    49 #include "qtcontactsglobal.h"
    50 #include "qcontactdetail.h"
    50 #include "qcontactdetail.h"
    51 #include "qcontact.h"
    51 #include "qcontact.h"
    52 
    52 
    55 /* Leaf class */
    55 /* Leaf class */
    56 class Q_CONTACTS_EXPORT QContactPresence : public QContactDetail
    56 class Q_CONTACTS_EXPORT QContactPresence : public QContactDetail
    57 {
    57 {
    58 public:
    58 public:
    59 #ifdef Q_QDOC
    59 #ifdef Q_QDOC
    60     const char* DefinitionName;
    60     static const QLatin1Constant DefinitionName;
    61     const char* FieldAccountUri;
    61     static const QLatin1Constant FieldTimestamp;
    62     const char* FieldNickname;
    62     static const QLatin1Constant FieldNickname;
    63     const char* FieldPresence;
    63     static const QLatin1Constant FieldPresenceState;
    64     const char* FieldStatusMessage;
    64     static const QLatin1Constant FieldPresenceStateText;
    65     const char* PresenceAvailable;
    65     static const QLatin1Constant FieldPresenceStateImageUrl;
    66     const char* PresenceHidden;
    66     static const QLatin1Constant FieldCustomMessage;
    67     const char* PresenceBusy;
       
    68     const char* PresenceAway;
       
    69     const char* PresenceExtendedAway;
       
    70     const char* PresenceUnknown;
       
    71     const char* PresenceOffline;
       
    72 #else
    67 #else
    73     Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactPresence, "Presence")
    68     Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactPresence, "Presence")
    74     Q_DECLARE_LATIN1_LITERAL(FieldAccountUri, "AccountUri");
    69     Q_DECLARE_LATIN1_CONSTANT(FieldTimestamp, "Timestamp");
    75     Q_DECLARE_LATIN1_LITERAL(FieldNickname, "Nickname");
    70     Q_DECLARE_LATIN1_CONSTANT(FieldNickname, "Nickname");
    76     Q_DECLARE_LATIN1_LITERAL(FieldPresence, "Presence");
    71     Q_DECLARE_LATIN1_CONSTANT(FieldPresenceState, "PresenceState");
    77     Q_DECLARE_LATIN1_LITERAL(FieldStatusMessage, "StatusMessage");
    72     Q_DECLARE_LATIN1_CONSTANT(FieldPresenceStateText, "PresenceStateText");
    78     Q_DECLARE_LATIN1_LITERAL(PresenceAvailable, "Available");
    73     Q_DECLARE_LATIN1_CONSTANT(FieldPresenceStateImageUrl, "PresenceStateImageUrl");
    79     Q_DECLARE_LATIN1_LITERAL(PresenceHidden, "Hidden");
    74     Q_DECLARE_LATIN1_CONSTANT(FieldCustomMessage, "CustomMessage");
    80     Q_DECLARE_LATIN1_LITERAL(PresenceBusy, "Busy");
       
    81     Q_DECLARE_LATIN1_LITERAL(PresenceAway, "Away");
       
    82     Q_DECLARE_LATIN1_LITERAL(PresenceExtendedAway, "ExtendedAway");
       
    83     Q_DECLARE_LATIN1_LITERAL(PresenceUnknown, "Unknown");
       
    84     Q_DECLARE_LATIN1_LITERAL(PresenceOffline, "Offline");
       
    85 #endif
    75 #endif
    86 
    76 
    87     void Q_DECL_DEPRECATED setAccountUri(const QString& accountUri) {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); setValue(FieldAccountUri, accountUri);}
    77     enum PresenceState {
    88     QString Q_DECL_DEPRECATED accountUri() const {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); return value(FieldAccountUri);}
    78         PresenceUnknown = 0,
    89     void Q_DECL_DEPRECATED setNickname(const QString& nickname) {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); setValue(FieldNickname, nickname);}
    79         PresenceAvailable,
    90     QString Q_DECL_DEPRECATED nickname() const {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); return value(FieldNickname);}
    80         PresenceHidden,
    91     void Q_DECL_DEPRECATED setPresence(const QString& presence) {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); setValue(FieldPresence, presence);}
    81         PresenceBusy,
    92     QString Q_DECL_DEPRECATED presence() const {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); return value(FieldPresence);}
    82         PresenceAway,
    93     void Q_DECL_DEPRECATED setStatusMessage(const QString& statusMessage) {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); setValue(FieldStatusMessage, statusMessage);}
    83         PresenceExtendedAway,
    94     QString Q_DECL_DEPRECATED statusMessage() const {qWarning("This class has been deprecated!  Please use QContactOnlineAccount and Read-Only Field Constraints!"); return value(FieldStatusMessage);}
    84         PresenceOffline,
       
    85     };
       
    86 
       
    87     void setTimestamp(const QDateTime& timestamp) {setValue(FieldTimestamp, timestamp);}
       
    88     QDateTime timestamp() const {return value<QDateTime>(FieldTimestamp);}
       
    89     void setNickname(const QString& nickname) {setValue(FieldNickname, nickname);}
       
    90     QString nickname() const {return value(FieldNickname);}
       
    91     void setPresenceState(PresenceState presence) {setValue(FieldPresenceState, static_cast<int>(presence));}
       
    92     PresenceState presenceState() const {return static_cast<PresenceState>(value<int>(FieldPresenceState));}
       
    93     void setPresenceStateText(const QString& presenceStateText) {setValue(FieldPresenceStateText, presenceStateText);}
       
    94     QString presenceStateText() const {return value(FieldPresenceStateText);}
       
    95     void setPresenceStateImageUrl(const QUrl& presenceStateImageUrl) {setValue(FieldPresenceStateImageUrl, presenceStateImageUrl);}
       
    96     QUrl presenceStateImageUrl() const {return value(FieldPresenceStateImageUrl);}
       
    97     void setCustomMessage(const QString& customMessage) {setValue(FieldCustomMessage, customMessage);}
       
    98     QString customMessage() const {return value(FieldCustomMessage);}
    95 };
    99 };
    96 
   100 
    97 QTM_END_NAMESPACE
   101 QTM_END_NAMESPACE
    98 
   102 
    99 #endif
   103 #endif