00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "debug.h"
00025 #include "identityimpl.h"
00026 #include "identity.h"
00027
00028 namespace SignOn {
00029
00030 Identity::Identity(const quint32 id, QObject *parent):
00031 QObject(parent)
00032 {
00033 initDebug();
00034
00035 qRegisterMetaType<Error>("SignOn::Error");
00036 qRegisterMetaType<Error>("Error");
00037
00038 if (qMetaTypeId<Error>() < QMetaType::User)
00039 BLAME() << "Identity::Identity() - "
00040 "SignOn::Error meta type not registered.";
00041
00042 impl = new IdentityImpl(this, id);
00043 }
00044
00045 Identity *Identity::newIdentity(const IdentityInfo &info, QObject *parent)
00046 {
00047 Identity *identity = new Identity(SSO_NEW_IDENTITY, parent);
00048 identity->impl->copyInfo(info);
00049 return identity;
00050 }
00051
00052 Identity *Identity::existingIdentity(const quint32 id, QObject *parent)
00053 {
00054 if (id == 0)
00055 return NULL;
00056 return new Identity(id, parent);
00057 }
00058
00059 Identity::~Identity()
00060 {
00061 }
00062
00063 quint32 Identity::id() const
00064 {
00065 return impl->id();
00066 }
00067
00068 void Identity::queryAvailableMethods()
00069 {
00070 impl->queryAvailableMethods();
00071 }
00072
00073 AuthSessionP Identity::createSession(const QString &methodName)
00074 {
00075 if (methodName.isEmpty())
00076 return NULL;
00077
00078 return AuthSessionP(impl->createSession(methodName, this));
00079 }
00080
00081 void Identity::destroySession(const AuthSessionP &session)
00082 {
00083 if (session.isNull())
00084 return;
00085
00086 impl->destroySession(session.data());
00087 }
00088
00089 void Identity::requestCredentialsUpdate(const QString &message)
00090 {
00091 impl->requestCredentialsUpdate(message);
00092 }
00093
00094 void Identity::storeCredentials(const IdentityInfo &info)
00095 {
00096 impl->storeCredentials(info);
00097 }
00098
00099 void Identity::remove()
00100 {
00101 impl->remove();
00102 }
00103
00104 void Identity::addReference(const QString &reference)
00105 {
00106 impl->addReference(reference);
00107 }
00108
00109 void Identity::removeReference(const QString &reference)
00110 {
00111 impl->removeReference(reference);
00112 }
00113
00114 void Identity::queryInfo()
00115 {
00116 impl->queryInfo();
00117 }
00118
00119 void Identity::verifyUser(const QString &message)
00120 {
00121 impl->verifyUser(message);
00122 }
00123
00124 void Identity::verifyUser(const QVariantMap ¶ms)
00125 {
00126 impl->verifyUser(params);
00127 }
00128
00129 void Identity::verifySecret(const QString &secret)
00130 {
00131 impl->verifySecret(secret);
00132 }
00133
00134 void Identity::signOut()
00135 {
00136 impl->signOut();
00137 }
00138
00139 }