00001
00023 #ifndef _TelepathyQt_protocol_info_h_HEADER_GUARD_
00024 #define _TelepathyQt_protocol_info_h_HEADER_GUARD_
00025
00026 #ifndef IN_TP_QT_HEADER
00027 #error IN_TP_QT_HEADER
00028 #endif
00029
00030 #include <TelepathyQt/AvatarSpec>
00031 #include <TelepathyQt/Global>
00032 #include <TelepathyQt/PresenceSpec>
00033 #include <TelepathyQt/ProtocolParameter>
00034 #include <TelepathyQt/Types>
00035
00036 #include <QSharedDataPointer>
00037 #include <QString>
00038 #include <QList>
00039
00040 namespace Tp
00041 {
00042
00043 class ConnectionCapabilities;
00044 class PendingString;
00045
00046 class TP_QT_EXPORT ProtocolInfo
00047 {
00048 public:
00049 ProtocolInfo();
00050 ProtocolInfo(const ProtocolInfo &other);
00051 ~ProtocolInfo();
00052
00053 bool isValid() const { return mPriv.constData() != 0; }
00054
00055 ProtocolInfo &operator=(const ProtocolInfo &other);
00056
00057 QString cmName() const;
00058
00059 QString name() const;
00060
00061 ProtocolParameterList parameters() const;
00062 bool hasParameter(const QString &name) const;
00063
00064 bool canRegister() const;
00065
00066 ConnectionCapabilities capabilities() const;
00067
00068 QString vcardField() const;
00069
00070 QString englishName() const;
00071
00072 QString iconName() const;
00073
00074 PresenceSpecList allowedPresenceStatuses() const;
00075
00076 AvatarSpec avatarRequirements() const;
00077
00078 QStringList addressableVCardFields() const;
00079 QStringList addressableUriSchemes() const;
00080
00081 PendingString *normalizeVCardAddress(const QString &vcardField, const QString &vcardAddress);
00082 PendingString *normalizeContactUri(const QString &uri);
00083
00084 private:
00085 friend class ConnectionManager;
00086
00087 TP_QT_NO_EXPORT ProtocolInfo(const ConnectionManagerPtr &cm, const QString &name);
00088
00089 TP_QT_NO_EXPORT void addParameter(const ParamSpec &spec);
00090 TP_QT_NO_EXPORT void setVCardField(const QString &vcardField);
00091 TP_QT_NO_EXPORT void setEnglishName(const QString &englishName);
00092 TP_QT_NO_EXPORT void setIconName(const QString &iconName);
00093 TP_QT_NO_EXPORT void setRequestableChannelClasses(const RequestableChannelClassList &caps);
00094 TP_QT_NO_EXPORT void setAllowedPresenceStatuses(const PresenceSpecList &statuses);
00095 TP_QT_NO_EXPORT void setAvatarRequirements(const AvatarSpec &avatarRequirements);
00096 TP_QT_NO_EXPORT void setAddressableVCardFields(const QStringList &vcardFields);
00097 TP_QT_NO_EXPORT void setAddressableUriSchemes(const QStringList &uriSchemes);
00098
00099 struct Private;
00100 friend struct Private;
00101 QSharedDataPointer<Private> mPriv;
00102 };
00103
00104 typedef QList<ProtocolInfo> ProtocolInfoList;
00105
00106 }
00107
00108 Q_DECLARE_METATYPE(Tp::ProtocolInfo);
00109 Q_DECLARE_METATYPE(Tp::ProtocolInfoList);
00110
00111 #endif