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 QLIGTHDM_GREETER_H
14 #define QLIGTHDM_GREETER_H
16 #include <QtCore/QObject>
17 #include <QtCore/QVariant>
27 class Q_DECL_EXPORT Greeter : public QObject
31 explicit Greeter(QObject* parent=0);
34 Q_PROPERTY(bool canSuspend READ canSuspend);
35 Q_PROPERTY(bool canHibernate READ canHibernate);
36 Q_PROPERTY(bool canShutdown READ canShutdown);
37 Q_PROPERTY(bool canRestart READ canRestart);
39 Q_PROPERTY(QString hostname READ hostname CONSTANT);
41 /** The hostname of the machine */
42 QString hostname() const;
44 QString timedLoginUser() const;
45 int timedLoginDelay() const;
47 QList<QLightDM::Language> languages() const;
48 QString defaultLanguage() const;
50 //QList<LdmLayout> layouts() const;
51 QString layout() const;
53 QString getHint(QString name) const;
54 QString defaultSessionHint() const;
55 bool hideUsersHint() const;
56 bool hasGuestAccountHint() const;
57 QString selectUserHint() const;
58 bool selectGuestHint() const;
59 QString autologinUserHint() const;
60 bool autologinGuestHint() const;
61 int autologinTimeoutHint() const;
63 bool inAuthentication() const;
64 bool isAuthenticated() const;
65 QString authenticationUser() const;
67 bool canSuspend() const;
68 bool canHibernate() const;
69 bool canShutdown() const;
70 bool canRestart() const;
78 void connectToServer();
79 void login(const QString &username);
81 void respond(const QString &response);
82 void cancelAuthentication();
83 void startSession(const QString &session=QString());
87 void showPrompt(QString prompt);
88 void showMessage(QString message);
89 void showError(QString message);
90 void authenticationComplete(bool isAuthenticated);
92 void timedLogin(QString username);
100 void writeInt(int value);
101 void writeString(QString value);
102 void writeHeader(int id, int length);
104 int getPacketLength();
105 int readInt(int *offset);
106 QString readString(int *offset);
111 #endif // QLIGHDM_GREETER_H