2 * Copyright (C) 2010-2011 David Edmundson.
3 * Copyright (C) 2010-2011 Robert Ancell
4 * Author: David Edmundson <kde@davidedmundson.co.uk>
6 * This library is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by the Free
8 * Software Foundation; either version 2 or version 3 of the License.
9 * See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
12 #ifndef QLIGHTDM_GREETER_H
13 #define QLIGHTDM_GREETER_H
15 #include <QtCore/QObject>
16 #include <QtCore/QVariant>
23 class Q_DECL_EXPORT Greeter : public QObject
27 Q_PROPERTY(bool authenticated READ isAuthenticated ) //NOTFIY authenticationComplete
28 Q_PROPERTY(QString authenticationUser READ authenticationUser )
29 Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT)
30 Q_PROPERTY(QString selectUser READ selectUserHint CONSTANT)
31 Q_PROPERTY(bool selectGuest READ selectGuestHint CONSTANT)
33 Q_PROPERTY(QString hostname READ hostname CONSTANT)
34 Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT)
35 Q_PROPERTY(bool locked READ lockHint CONSTANT)
37 Q_PROPERTY(QString hostname READ hostname CONSTANT)
39 Q_ENUMS(PromptType MessageType)
52 explicit Greeter(QObject* parent=0);
55 QString getHint(const QString &name) const;
56 QString defaultSessionHint() const;
57 bool hideUsersHint() const;
58 bool showManualLoginHint() const;
59 bool showRemoteLoginHint() const;
60 bool lockHint () const;
61 bool hasGuestAccountHint() const;
62 QString selectUserHint() const;
63 bool selectGuestHint() const;
64 QString autologinUserHint() const;
65 bool autologinGuestHint() const;
66 int autologinTimeoutHint() const;
68 bool inAuthentication() const;
69 bool isAuthenticated() const;
70 QString authenticationUser() const;
71 QString hostname() const;
75 void authenticate(const QString &username=QString());
76 void authenticateAsGuest();
77 void authenticateAutologin();
78 void authenticateRemote(const QString &session=QString(), const QString &username=QString());
79 void respond(const QString &response);
80 void cancelAuthentication();
81 void setLanguage (const QString &language);
82 bool startSessionSync(const QString &session=QString());
85 void showMessage(QString text, QLightDM::Greeter::MessageType type);
86 void showPrompt(QString text, QLightDM::Greeter::PromptType type);
87 void authenticationComplete();
88 void autologinTimerExpired();
91 GreeterPrivate *d_ptr;
92 Q_DECLARE_PRIVATE(Greeter)
97 #endif // QLIGHTDM_GREETER_H