00001
00023 #ifndef _TelepathyQt_protocol_parameter_h_HEADER_GUARD_
00024 #define _TelepathyQt_protocol_parameter_h_HEADER_GUARD_
00025
00026 #ifndef IN_TP_QT_HEADER
00027 #error IN_TP_QT_HEADER
00028 #endif
00029
00030 #include <TelepathyQt/Constants>
00031 #include <TelepathyQt/Global>
00032
00033 #include <QDBusSignature>
00034 #include <QSharedDataPointer>
00035 #include <QString>
00036 #include <QVariant>
00037
00038 namespace Tp
00039 {
00040
00041 class TP_QT_EXPORT ProtocolParameter
00042 {
00043 public:
00044 ProtocolParameter();
00045 ProtocolParameter(const ProtocolParameter &other);
00046 ~ProtocolParameter();
00047
00048 bool isValid() const { return mPriv.constData() != 0; }
00049
00050 ProtocolParameter &operator=(const ProtocolParameter &other);
00051 bool operator==(const ProtocolParameter &other) const;
00052 bool operator==(const QString &name) const;
00053 bool operator<(const ProtocolParameter &other) const;
00054
00055 QString name() const;
00056 QDBusSignature dbusSignature() const;
00057 QVariant::Type type() const;
00058 QVariant defaultValue() const;
00059
00060 bool isRequired() const;
00061 bool isSecret() const;
00062 bool isRequiredForRegistration() const;
00063
00064 private:
00065 friend class ConnectionManager;
00066 friend class ProtocolInfo;
00067
00068 TP_QT_NO_EXPORT ProtocolParameter(const QString &name,
00069 const QDBusSignature &dbusSignature,
00070 QVariant defaultValue,
00071 ConnMgrParamFlag flags);
00072
00073 struct Private;
00074 friend struct Private;
00075 QSharedDataPointer<Private> mPriv;
00076 };
00077
00078 typedef QList<ProtocolParameter> ProtocolParameterList;
00079
00080 uint qHash(const ProtocolParameter ¶meter);
00081
00082 }
00083
00084 Q_DECLARE_METATYPE(Tp::ProtocolParameter);
00085 Q_DECLARE_METATYPE(Tp::ProtocolParameterList);
00086
00087 #endif