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
00110 quint32 id() const;
00111
00126 void setSecret(const QString &secret, const bool storeSecret = true);
00127
00132 bool isStoringSecret() const;
00133
00138 void setStoreSecret(const bool storeSecret);
00139
00146 void setUserName(const QString &userName);
00147
00152 const QString userName() const;
00153
00158 void setCaption(const QString &caption);
00159
00164 const QString caption() const;
00165
00172 void setRealms(const QStringList &realms);
00173
00180 QStringList realms() const;
00181
00188 void setOwner(const QString &ownerToken);
00189
00199 QString owner() const;
00200
00208 void setAccessControlList(const QStringList &accessControlList);
00209
00219 QStringList accessControlList() const;
00220
00229 void setMethod(const MethodName &method, const MechanismsList &mechanismsList);
00230
00235 void removeMethod(const MethodName &method);
00236
00246 void setType(CredentialsType type);
00247
00252 CredentialsType type() const;
00253
00258 QList<MethodName> methods() const;
00259
00265 MechanismsList mechanisms(const MethodName &method) const;
00266
00275 void setRefCount(qint32 refCount);
00276
00281 qint32 refCount() const;
00282
00283 private:
00284 void setId(const quint32 id);
00285 const QString secret() const;
00286
00287 private:
00288 class IdentityInfoImpl *impl;
00289 };
00290
00291 }
00292
00293 Q_DECLARE_METATYPE(SignOn::IdentityInfo)
00294
00295 #endif