2
* This file is part of online-accounts-ui
4
* Copyright (C) 2011-2014 Canonical Ltd.
6
* Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8
* This program is free software: you can redistribute it and/or modify it
9
* under the terms of the GNU General Public License version 3, as published
10
* by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranties of
14
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
* PURPOSE. See the GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License along
18
* with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include "signonui-request-mock.h"
25
#include <SignOn/uisessiondata.h>
26
#include <SignOn/uisessiondata_priv.h>
28
using namespace SignOnUi;
30
RequestPrivate::RequestPrivate(Request *request):
35
const QVariantMap ¶meters = request->parameters();
36
if (parameters.contains(SSOUI_KEY_CLIENT_DATA)) {
37
m_clientData = parameters[SSOUI_KEY_CLIENT_DATA].toMap();
41
RequestPrivate::~RequestPrivate()
45
Request::Request(int id,
46
const QString &clientProfile,
47
const QVariantMap ¶meters,
49
OnlineAccountsUi::Request(SIGNONUI_INTERFACE, id, clientProfile,
51
d_ptr(new RequestPrivate(this))
59
QString Request::ssoId(const QVariantMap ¶meters)
61
return parameters[SSOUI_KEY_REQUESTID].toString();
64
QString Request::ssoId() const
66
return Request::ssoId(parameters());
69
void Request::setWindow(QWindow *window)
71
OnlineAccountsUi::Request::setWindow(window);
74
uint Request::identity() const
76
return parameters().value(SSOUI_KEY_IDENTITY).toUInt();
79
QString Request::method() const
81
return parameters().value(SSOUI_KEY_METHOD).toString();
84
QString Request::mechanism() const
86
return parameters().value(SSOUI_KEY_MECHANISM).toString();
89
const QVariantMap &Request::clientData() const
92
return d->m_clientData;
95
void Request::setHandler(RequestHandler *handler)
98
d->m_handler = handler;
101
RequestHandler *Request::handler() const
107
void Request::setCanceled()
110
result[SSOUI_KEY_ERROR] = SignOn::QUERY_ERROR_CANCELED;