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;
64 bool inAuthentication() const;
65 bool isAuthenticated() const;
66 QString authenticationUser() const;
68 bool canSuspend() const;
69 bool canHibernate() const;
70 bool canShutdown() const;
71 bool canRestart() const;
79 void connectToServer();
80 void cancelTimedLogin();
81 void login(const QString &username);
83 void provideSecret(const QString &secret);
84 void cancelAuthentication();
85 void startSession(const QString &session=QString());
89 void showPrompt(QString prompt);
90 void showMessage(QString message);
91 void showError(QString message);
92 void authenticationComplete(bool isAuthenticated);
93 void timedLogin(QString username);
101 void writeInt(int value);
102 void writeString(QString value);
103 void writeHeader(int id, int length);
105 int getPacketLength();
106 int readInt(int *offset);
107 QString readString(int *offset);
112 #endif // LDMGREETER_H