on 1663e5c help sign in
unity8/tests/mocks/LightDM/Greeter.cpp
167 lines 2.8 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
19#include "Greeter.h"
20#include "GreeterPrivate.h"
21#include <QtCore/QCoreApplication>
23namespace QLightDM
26Greeter::Greeter(QObject *parent)
27 : QObject(parent),
28 d_ptr(new GreeterPrivate(this))
32Greeter::~Greeter()
36QString Greeter::authenticationUser() const
38 Q_D(const Greeter);
39 return d->authenticationUser;
42bool Greeter::hasGuestAccountHint() const
44 return true;
47QString Greeter::getHint(const QString &name) const
49 Q_UNUSED(name)
50 return "";
53QString Greeter::defaultSessionHint() const
55 return "ubuntu";
58bool Greeter::hideUsersHint() const
60 return false;
63bool Greeter::showManualLoginHint() const
65 return true;
68bool Greeter::showRemoteLoginHint() const
70 return true;
73bool Greeter::lockHint () const
75 return false;
78QString Greeter::selectUserHint() const
80 return "";
83bool Greeter::selectGuestHint() const
85 return false;
88QString Greeter::autologinUserHint() const
90 return "";
93bool Greeter::autologinGuestHint() const
95 return false;
98int Greeter::autologinTimeoutHint() const
100 return 0;
103bool Greeter::inAuthentication() const
105 return false;
108QString Greeter::hostname() const
110 return "hostname1";
113bool Greeter::isAuthenticated() const
115 Q_D(const Greeter);
116 return d->authenticated;
119bool Greeter::connectSync()
121 return true;
124void Greeter::authenticate(const QString &username)
126 Q_D(Greeter);
128 d->authenticated = false;
129 d->authenticationUser = username;
130 d->twoFactorDone = false;
131 d->handleAuthenticate();
134void Greeter::authenticateAsGuest()
135{}
137void Greeter::authenticateAutologin()
138{}
140void Greeter::authenticateRemote(const QString &session, const QString &username)
142 Q_UNUSED(session)
143 Q_UNUSED(username)
146void Greeter::cancelAuthentication()
147{}
149void Greeter::setLanguage (const QString &language)
151 Q_UNUSED(language)
154bool Greeter::startSessionSync(const QString &session)
156 Q_UNUSED(session)
157 return true;
160void Greeter::respond(const QString &response)
162 Q_D(Greeter);
164 d->handleRespond(response);