00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef AUTHSERVICE_H
00029 #define AUTHSERVICE_H
00030
00031 #include <QObject>
00032 #include <QStringList>
00033 #include <QMap>
00034
00035 #include "libsignoncommon.h"
00036 #include "identityinfo.h"
00037 #include "signonerror.h"
00038
00039 namespace SignOn {
00040
00049 class SIGNON_EXPORT AuthService : public QObject
00050 {
00051 Q_OBJECT
00052 Q_DISABLE_COPY(AuthService)
00053
00054 friend class AuthServiceImpl;
00055
00056 public:
00062 enum ServiceError {
00063 UnknownError = 1,
00064 InternalServerError = 2,
00065 InternalCommunicationError = 3,
00066 PermissionDeniedError = 4,
00067 AuthServiceErr = 100,
00068 MethodNotKnownError,
00069 NotAvailableError,
00070 InvalidQueryError
00071 };
00072
00078 typedef enum {
00079 AuthMethod = 0,
00080 Username,
00081 Realm,
00082 Caption
00083 } IdentityFilterCriteria;
00084
00092 class IdentityRegExp
00093 {
00094 public:
00099 IdentityRegExp(const QString &pattern);
00100
00105 IdentityRegExp(const IdentityRegExp &src);
00106
00111 bool isValid() const;
00112
00117 QString pattern() const;
00118
00119 private:
00120 QString m_pattern;
00121 };
00122
00123 public:
00128 typedef QMap<IdentityFilterCriteria, IdentityRegExp> IdentityFilter;
00129
00134 AuthService(QObject *parent = 0);
00135
00139 ~AuthService();
00140
00150 void queryMethods();
00151
00165 void queryMechanisms(const QString &method);
00166
00183 void queryIdentities(const IdentityFilter &filter = IdentityFilter());
00184
00196 void clear();
00197
00198 Q_SIGNALS:
00199
00210 void error(const SignOn::Error &err);
00211
00218 void methodsAvailable(const QStringList &methods);
00219
00227 void mechanismsAvailable(const QString &method, const QStringList &mechanisms);
00228
00235 void identities(const QList<SignOn::IdentityInfo> &identityList);
00236
00241 void cleared();
00242
00243 private:
00244 class AuthServiceImpl *impl;
00245 };
00246
00247 }
00248
00249 #endif // AUTHSERVICE_H