My Project
authservice.cpp
1/*
2 * This file is part of signon
3 *
4 * Copyright (C) 2009-2010 Nokia Corporation.
5 * Copyright (C) 2011-2016 Canonical Ltd.
6 *
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 */
23#include "authservice.h"
24#include "authserviceimpl.h"
25#include "debug.h"
26
27namespace SignOn {
28
29AuthService::AuthService(QObject *parent): QObject(parent),
30 impl(new AuthServiceImpl(this))
31{
32 initDebug();
33
34 qRegisterMetaType<Error>("SignOn::Error");
35 qRegisterMetaType<Error>("Error");
36
37 if (qMetaTypeId<Error>() < QMetaType::User)
38 BLAME() << "AuthService::AuthService() - "
39 "SignOn::Error meta type not registered.";
40}
41
45
47{
48 impl->queryMethods();
49}
50
51void AuthService::queryMechanisms(const QString &method)
52{
53 impl->queryMechanisms(method);
54}
55
57{
58 impl->queryIdentities(filter);
59}
60
62{
63 impl->clear();
64}
65
66} //namespace SignOn
QMap< IdentityFilterCriteria, IdentityRegExp > IdentityFilter
Map to hold different filtering options.
void queryMethods()
Requests the information on available authentication methods.
void clear()
Clears credentials database.
~AuthService()
Destructor.
AuthService(QObject *parent=0)
Basic constructor.
void queryIdentities(const IdentityFilter &filter=IdentityFilter())
Requests information on identities which are stored.
void queryMechanisms(const QString &method)
Requests the information on mechanisms which are available for certain authentication type.