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 3 of the License, or (at your option) any
9 * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
13 #ifndef QLIGHTDM_GREETER_H
14 #define QLIGHTDM_GREETER_H
16 #include <QtCore/QObject>
17 #include <QtCore/QVariant>
24 class Q_DECL_EXPORT Greeter : public QObject
28 Q_PROPERTY(bool authenticated READ isAuthenticated ); //NOTFIY authenticationComplete
29 Q_PROPERTY(QString authenticationUser READ authenticationUser );
30 Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT);
31 Q_PROPERTY(QString selectUser READ selectUserHint CONSTANT);
32 Q_PROPERTY(bool selectGuest READ selectGuestHint CONSTANT);
34 Q_PROPERTY(QString hostname READ hostname CONSTANT);
35 Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT);
36 Q_PROPERTY(bool locked READ lockHint CONSTANT);
38 Q_PROPERTY(QString hostname READ hostname CONSTANT);
51 explicit Greeter(QObject* parent=0);
54 QString getHint(const QString &name) const;
55 QString defaultSessionHint() const;
56 bool hideUsersHint() const;
57 bool showManualLoginHint() const;
58 bool showRemoteLoginHint() const;
59 bool lockHint () const;
60 bool hasGuestAccountHint() const;
61 QString selectUserHint() const;
62 bool selectGuestHint() const;
63 QString autologinUserHint() const;
64 bool autologinGuestHint() const;
65 int autologinTimeoutHint() const;
67 bool inAuthentication() const;
68 bool isAuthenticated() const;
69 QString authenticationUser() const;
70 QString hostname() const;
74 void authenticate(const QString &username=QString());
75 void authenticateAsGuest();
76 void authenticateRemote(const QString &session=QString(), const QString &username=QString());
77 void respond(const QString &response);
78 void cancelAuthentication();
79 void setLanguage (const QString &language);
80 bool startSessionSync(const QString &session=QString());
83 void showMessage(QString text, QLightDM::Greeter::MessageType type);
84 void showPrompt(QString text, QLightDM::Greeter::PromptType type);
85 void authenticationComplete();
86 void autologinTimerExpired();
89 GreeterPrivate *d_ptr;
90 Q_DECLARE_PRIVATE(Greeter)
95 #endif // QLIGHTDM_GREETER_H