00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef IDENTITY_INFO_H
00029 #define IDENTITY_INFO_H
00030
00031 #include <QStringList>
00032 #include <QMetaType>
00033
00034 #include "libsignoncommon.h"
00035
00036 namespace SignOn {
00037
00042 typedef QString MethodName;
00043
00048 typedef QStringList MechanismsList;
00049
00057 class SIGNON_EXPORT IdentityInfo
00058 {
00059 friend class AuthServiceImpl;
00060 friend class IdentityImpl;
00061
00062 public:
00069 enum CredentialsType {
00070 Other = 0,
00071 Application = 1 << 0,
00072 Web = 1 << 1,
00073 Network = 1 << 2
00074 };
00075
00076 public:
00080 IdentityInfo();
00081
00085 IdentityInfo(const IdentityInfo &other);
00086
00090 IdentityInfo &operator=(const IdentityInfo &other);
00091
00098 IdentityInfo(const QString &caption, const QString &userName,
00099 const QMap<MethodName,MechanismsList> &methods);
00100
00104 ~IdentityInfo();
00105
00112 void setId(const quint32 id);
00113
00118 quint32 id() const;
00119
00134 void setSecret(const QString &secret, const bool storeSecret = true);
00135
00141 QString secret() const;
00142
00147 bool isStoringSecret() const;
00148
00153 void setStoreSecret(const bool storeSecret);
00154
00161 void setUserName(const QString &userName);
00162
00167 const QString userName() const;
00168
00173 void setCaption(const QString &caption);
00174
00179 const QString caption() const;
00180
00187 void setRealms(const QStringList &realms);
00188
00195 QStringList realms() const;
00196
00203 void setOwner(const QString &ownerToken);
00204
00214 QString owner() const;
00215
00223 void setAccessControlList(const QStringList &accessControlList);
00224
00234 QStringList accessControlList() const;
00235
00246 void setMethod(const MethodName &method,
00247 const MechanismsList &mechanismsList);
00248
00253 void removeMethod(const MethodName &method);
00254
00265 void setType(CredentialsType type);
00266
00271 CredentialsType type() const;
00272
00277 QList<MethodName> methods() const;
00278
00284 MechanismsList mechanisms(const MethodName &method) const;
00285
00295 void setRefCount(qint32 refCount);
00296
00301 qint32 refCount() const;
00302
00303 private:
00304 class IdentityInfoImpl *impl;
00305 };
00306
00307 }
00308
00309 Q_DECLARE_METATYPE(SignOn::IdentityInfo)
00310
00311 #endif