- Main Page
- Related Pages
- Classes
- Files

- File List

authservice.h
1 /*
2 * This file is part of signon
3 *
4 * Copyright (C) 2009-2010 Nokia Corporation.
5 *
6 * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
7 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
28 #ifndef AUTHSERVICE_H
29 #define AUTHSERVICE_H
30
31 #include <QObject>
32 #include <QStringList>
33 #include <QMap>
34
35 #include "libsignoncommon.h"
36 #include "identityinfo.h"
37 #include "signonerror.h"
38
39 namespace SignOn {
40
49 class SIGNON_EXPORT AuthService: public QObject
50 {
51 Q_OBJECT
52 Q_DISABLE_COPY(AuthService)
53
54 friend class AuthServiceImpl;
55
56 public:
62 enum ServiceError {
63 UnknownError = 1,
64 InternalServerError = 2,
65 InternalCommunicationError = 3,
66 PermissionDeniedError = 4,
67 AuthServiceErr = 100, /* Placeholder to rearrange enumeration */
68 MethodNotKnownError,
69 NotAvailableError,
70 InvalidQueryError
71 };
72
78 typedef enum {
79 AuthMethod = 0,
80 Username,
81 Realm,
82 Caption
83 } IdentityFilterCriteria;
84
92 class IdentityRegExp
93 {
94 public:
99 IdentityRegExp(const QString &pattern);
100
105 IdentityRegExp(const IdentityRegExp &src);
106
111 bool isValid() const;
112
117 QString pattern() const;
118
119 private:
120 QString m_pattern;
121 };
122
123 public:
128 typedef QMap<IdentityFilterCriteria, IdentityRegExp> IdentityFilter;
129
134 AuthService(QObject *parent = 0);
135
139 ~AuthService();
140
150 void queryMethods();
151
165 void queryMechanisms(const QString &method);
166
183 void queryIdentities(const IdentityFilter &filter = IdentityFilter());
184
196 void clear();
197
198 Q_SIGNALS:
199
210 void error(const SignOn::Error &err);
211
218 void methodsAvailable(const QStringList &methods);
219
227 void mechanismsAvailable(const QString &method, const QStringList &mechanisms);
228
235 void identities(const QList<SignOn::IdentityInfo> &identityList);
236
241 void cleared();
242
243 private:
244 class AuthServiceImpl *impl;
245 };
246
247 } // namespace SignOn
248
249 #endif // AUTHSERVICE_H
SignOn::AuthService::NotAvailableError
Definition: authservice.h:69
SignOn::AuthService
Represents signon for client application.
Definition: authservice.h:49
SignOn::AuthService::MethodNotKnownError
Definition: authservice.h:68
SignOn::AuthService::ServiceError
ServiceError
Codes for errors that may be reported by AuthService objects.
Definition: authservice.h:62
SignOn::AuthService::IdentityRegExp
The class represents a regular expression.
Definition: authservice.h:92
SignOn::Error
definition for Signon error handling.
Definition: signonerror.h:49
SignOn::AuthService::IdentityFilter
QMap< IdentityFilterCriteria, IdentityRegExp > IdentityFilter
Map to hold different filtering options.
Definition: authservice.h:128