~macslow/unity8/fix-1475678

« back to all changes in this revision

Viewing changes to tests/mocks/LightDM/Greeter.cpp

  • Committer: Michał Sawicz
  • Date: 2013-06-05 22:03:08 UTC
  • Revision ID: michal.sawicz@canonical.com-20130605220308-yny8fv3futtr04fg
Inital unity8 commit.

Previous history can be found at https://code.launchpad.net/~unity-team/unity/phablet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
18
 
 
19
#include "Greeter.h"
 
20
#include "GreeterPrivate.h"
 
21
#include <QtCore/QCoreApplication>
 
22
 
 
23
namespace QLightDM
 
24
{
 
25
 
 
26
Greeter::Greeter(QObject *parent)
 
27
  : QObject(parent),
 
28
    d_ptr(new GreeterPrivate(this))
 
29
{
 
30
}
 
31
 
 
32
Greeter::~Greeter()
 
33
{
 
34
}
 
35
 
 
36
QString Greeter::authenticationUser() const
 
37
{
 
38
    Q_D(const Greeter);
 
39
    return d->authenticationUser;
 
40
}
 
41
 
 
42
bool Greeter::hasGuestAccountHint() const
 
43
{
 
44
    return true;
 
45
}
 
46
 
 
47
QString Greeter::getHint(const QString &name) const
 
48
{
 
49
    Q_UNUSED(name)
 
50
    return "";
 
51
}
 
52
 
 
53
QString Greeter::defaultSessionHint() const
 
54
{
 
55
    return "ubuntu";
 
56
}
 
57
 
 
58
bool Greeter::hideUsersHint() const
 
59
{
 
60
    return false;
 
61
}
 
62
 
 
63
bool Greeter::showManualLoginHint() const
 
64
{
 
65
    return true;
 
66
}
 
67
 
 
68
bool Greeter::showRemoteLoginHint() const
 
69
{
 
70
    return true;
 
71
}
 
72
 
 
73
bool Greeter::lockHint () const
 
74
{
 
75
    return false;
 
76
}
 
77
 
 
78
QString Greeter::selectUserHint() const
 
79
{
 
80
    return "";
 
81
}
 
82
 
 
83
bool Greeter::selectGuestHint() const
 
84
{
 
85
    return false;
 
86
}
 
87
 
 
88
QString Greeter::autologinUserHint() const
 
89
{
 
90
    return "";
 
91
}
 
92
 
 
93
bool Greeter::autologinGuestHint() const
 
94
{
 
95
    return false;
 
96
}
 
97
 
 
98
int Greeter::autologinTimeoutHint() const
 
99
{
 
100
    return 0;
 
101
}
 
102
 
 
103
bool Greeter::inAuthentication() const
 
104
{
 
105
    return false;
 
106
}
 
107
 
 
108
QString Greeter::hostname() const
 
109
{
 
110
    return "hostname1";
 
111
}
 
112
 
 
113
bool Greeter::isAuthenticated() const
 
114
{
 
115
    Q_D(const Greeter);
 
116
    return d->authenticated;
 
117
}
 
118
 
 
119
bool Greeter::connectSync()
 
120
{
 
121
    return true;
 
122
}
 
123
 
 
124
void Greeter::authenticate(const QString &username)
 
125
{
 
126
    Q_D(Greeter);
 
127
 
 
128
    d->authenticated = false;
 
129
    d->authenticationUser = username;
 
130
    d->twoFactorDone = false;
 
131
    d->handleAuthenticate();
 
132
}
 
133
 
 
134
void Greeter::authenticateAsGuest()
 
135
{}
 
136
 
 
137
void Greeter::authenticateAutologin()
 
138
{}
 
139
 
 
140
void Greeter::authenticateRemote(const QString &session, const QString &username)
 
141
{
 
142
    Q_UNUSED(session)
 
143
    Q_UNUSED(username)
 
144
}
 
145
 
 
146
void Greeter::cancelAuthentication()
 
147
{}
 
148
 
 
149
void Greeter::setLanguage (const QString &language)
 
150
{
 
151
    Q_UNUSED(language)
 
152
}
 
153
 
 
154
bool Greeter::startSessionSync(const QString &session)
 
155
{
 
156
    Q_UNUSED(session)
 
157
    return true;
 
158
}
 
159
 
 
160
void Greeter::respond(const QString &response)
 
161
{
 
162
    Q_D(Greeter);
 
163
 
 
164
    d->handleRespond(response);
 
165
}
 
166
 
 
167
}