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>
21 //#include "ldmlayout.h"
29 class Q_DECL_EXPORT Greeter : public QObject
33 explicit Greeter(QObject* parent=0);
36 Q_PROPERTY(bool canSuspend READ canSuspend);
37 Q_PROPERTY(bool canHibernate READ canHibernate);
38 Q_PROPERTY(bool canShutdown READ canShutdown);
39 Q_PROPERTY(bool canRestart READ canRestart);
41 Q_PROPERTY(QString hostname READ hostname CONSTANT);
43 /** The hostname of the machine */
44 QString hostname() const;
45 QString theme() const;
47 Q_INVOKABLE QVariant getProperty(const QString &name) const;
49 QString timedLoginUser() const;
50 int timedLoginDelay() const;
52 QList<QLightDM::Language> languages() const;
53 QString defaultLanguage() const;
55 //QList<LdmLayout> layouts() const;
56 QString layout() const;
58 QLightDM::Config *config() const;
60 QString defaultSession() const;
61 bool guestAccountSupported() 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 cancelTimedLogin();
80 void login(const QString &username);
82 void respond(const QString &response);
83 void cancelAuthentication();
84 void startSession(const QString &session=QString());
88 void showPrompt(QString prompt);
89 void showMessage(QString message);
90 void showError(QString message);
91 void authenticationComplete(bool isAuthenticated);
92 void timedLogin(QString username);
93 void selectUser(QString username);
102 void writeInt(int value);
103 void writeString(QString value);
104 void writeHeader(int id, int length);
106 int getPacketLength();
107 int readInt(int *offset);
108 QString readString(int *offset);
113 #endif // LDMGREETER_H