2
* Copyright (C) 2012,2013 Canonical, Ltd.
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.
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.
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/>.
16
* Authors: Michael Terry <michael.terry@canonical.com>
19
/* This class is a really tiny filter around QLightDM::Greeter. There are some
20
operations that we want to edit a bit for the benefit of Qml. Specifically,
21
we want to chop colons off of any password prompts. But there may be more
22
such edits in the future, and by inserting ourselves here, we have more
25
#ifndef UNITY_GREETER_H
26
#define UNITY_GREETER_H
28
#include <QLightDM/Greeter>
29
#include <QtCore/QObject>
33
class Greeter : public QObject
37
Q_PROPERTY(bool authenticated READ isAuthenticated)
38
Q_PROPERTY(QString authenticationUser READ authenticationUser)
39
Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
42
explicit Greeter(QObject* parent=0);
44
bool isAuthenticated() const;
45
QString authenticationUser() const;
46
bool promptless() const;
49
void authenticate(const QString &username=QString());
50
void respond(const QString &response);
51
bool startSessionSync(const QString &session=QString());
54
void showMessage(QString text, bool isError);
55
void showPrompt(QString text, bool isSecret);
56
void authenticationComplete();
57
void promptlessChanged();
60
GreeterPrivate * const d_ptr;
62
Q_DECLARE_PRIVATE(Greeter)
65
void showMessageFilter(QString text, QLightDM::Greeter::MessageType type);
66
void showPromptFilter(QString text, QLightDM::Greeter::PromptType type);
67
void authenticationCompleteFilter();