23 #ifndef _TelepathyQt_presence_h_HEADER_GUARD_
24 #define _TelepathyQt_presence_h_HEADER_GUARD_
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
30 #include <TelepathyQt/Constants>
31 #include <TelepathyQt/Types>
45 static Presence available(
const QString &statusMessage = QString());
46 static Presence chat(
const QString &statusMessage = QString());
47 static Presence away(
const QString &statusMessage = QString());
48 static Presence brb(
const QString &statusMessage = QString());
49 static Presence busy(
const QString &statusMessage = QString());
50 static Presence dnd(
const QString &statusMessage = QString());
51 static Presence xa(
const QString &statusMessage = QString());
52 static Presence hidden(
const QString &statusMessage = QString());
53 static Presence offline(
const QString &statusMessage = QString());
55 bool isValid()
const {
return mPriv.constData() != 0; }
62 QString status()
const;
63 QString statusMessage()
const;
66 const QString &statusMessage);
67 void setStatusMessage(
const QString &statusMessage);
73 friend struct Private;
74 QSharedDataPointer<Private> mPriv;
83 CanHaveStatusMessage = 0x2,
84 AllFlags = MaySetOnSelf | CanHaveStatusMessage
86 Q_DECLARE_FLAGS(SimpleStatusFlags, SimpleStatusFlag);
93 static PresenceSpec available(SimpleStatusFlags flags = AllFlags);
94 static PresenceSpec chat(SimpleStatusFlags flags = AllFlags);
95 static PresenceSpec pstn(SimpleStatusFlags flags = CanHaveStatusMessage);
96 static PresenceSpec away(SimpleStatusFlags flags = AllFlags);
97 static PresenceSpec brb(SimpleStatusFlags flags = AllFlags);
98 static PresenceSpec dnd(SimpleStatusFlags flags = AllFlags);
99 static PresenceSpec busy(SimpleStatusFlags flags = AllFlags);
100 static PresenceSpec xa(SimpleStatusFlags flags = AllFlags);
101 static PresenceSpec hidden(SimpleStatusFlags flags = AllFlags);
102 static PresenceSpec offline(SimpleStatusFlags flags = CanHaveStatusMessage);
103 static PresenceSpec unknown(SimpleStatusFlags flags = CanHaveStatusMessage);
104 static PresenceSpec error(SimpleStatusFlags flags = CanHaveStatusMessage);
106 bool isValid()
const {
return mPriv.constData() != 0; }
113 Presence presence(
const QString &statusMessage = QString())
const;
114 bool maySetOnSelf()
const;
115 bool canHaveStatusMessage()
const;
121 friend struct Private;
122 QSharedDataPointer<Private> mPriv;
131 SimpleStatusSpecMap::const_iterator i = specMap.constBegin();
132 SimpleStatusSpecMap::const_iterator end = specMap.end();
133 for (; i != end; ++i) {
134 QString status = i.key();
144 QMap<QString, PresenceSpec>
toMap()
const
146 QMap<QString, PresenceSpec> ret;
163 Q_DECLARE_OPERATORS_FOR_FLAGS(PresenceSpec::SimpleStatusFlags)
bool operator!=(const AccessControl &v1, const AccessControl &v2)
Definition: build/TelepathyQt/_gen/types.h:144
PresenceSpecList(const QList< PresenceSpec > &other)
Definition: presence.h:139
bool operator==(const SUSocketAddress &v1, const SUSocketAddress &v2)
Definition: types.cpp:50
bool isValid() const
Definition: presence.h:106
Definition: build/TelepathyQt/_gen/types.h:2733
QMap< QString, PresenceSpec > toMap() const
Definition: presence.h:144
Presence presence(const QString &statusMessage=QString()) const
Definition: presence.cpp:419
QString status() const
Definition: presence.cpp:162
PresenceSpecList()
Definition: presence.h:128
The Presence class represents a Telepathy simple presence.
Definition: presence.h:36
ConnectionPresenceType
Definition: build/TelepathyQt/_gen/constants.h:2026
SimpleStatusSpec bareSpec() const
Definition: presence.cpp:451
SimpleStatusFlag
Definition: presence.h:80
Definition: build/TelepathyQt/_gen/types.h:3849
SimpleStatusSpecMap bareSpecs() const
Definition: presence.h:153
bool isValid() const
Definition: presence.h:55
The PresenceSpecList class represents a list of PresenceSpec.
Definition: presence.h:125
PresenceSpecList(const SimpleStatusSpecMap &specMap)
Definition: presence.h:129
Definition: build/TelepathyQt/_gen/types.h:2787
The PresenceSpec class represents a Telepathy presence information supported by a protocol...
Definition: presence.h:77