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>
18 #include "QLightDM/User"
19 #include "QLightDM/Language"
37 class Q_DECL_EXPORT Greeter : public QObject
41 explicit Greeter(QObject* parent=0);
44 Q_PROPERTY(bool canSuspend READ canSuspend);
45 Q_PROPERTY(bool canHibernate READ canHibernate);
46 Q_PROPERTY(bool canShutdown READ canShutdown);
47 Q_PROPERTY(bool canRestart READ canRestart);
49 Q_PROPERTY(QString hostname READ hostname CONSTANT);
51 /** The hostname of the machine */
52 QString hostname() const;
54 QString timedLoginUser() const;
55 int timedLoginDelay() const;
57 QList<QLightDM::Language> languages() const;
58 QString defaultLanguage() const;
60 QString layout() const;
62 QString getHint(QString name) const;
63 QString defaultSessionHint() const;
64 bool hideUsersHint() const;
65 bool hasGuestAccountHint() const;
66 QString selectUserHint() const;
67 bool selectGuestHint() const;
68 QString autologinUserHint() const;
69 bool autologinGuestHint() const;
70 int autologinTimeoutHint() const;
72 bool inAuthentication() const;
73 bool isAuthenticated() const;
74 QString authenticationUser() const;
76 bool canSuspend() const;
77 bool canHibernate() const;
78 bool canShutdown() const;
79 bool canRestart() const;
87 void connectToServer();
88 void authenticate(const QString &username=QString());
89 void authenticateAsGuest();
90 void respond(const QString &response);
91 void cancelAuthentication();
92 void startSession(const QString &session=QString());
96 void showPrompt(QString prompt, PromptType type);
97 void showMessage(QString message, MessageType type);
98 void authenticationComplete();
100 void autologinTimerExpired();
108 void writeInt(int value);
109 void writeString(QString value);
110 void writeHeader(int id, int length);
112 int getPacketLength();
113 int readInt(int *offset);
114 QString readString(int *offset);
118 #endif // QLIGHTDM_GREETER_H