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
20 //#include "ldmlayout.h"
28 class Q_DECL_EXPORT Greeter : public QObject
32 explicit Greeter(QObject* parent=0);
35 Q_PROPERTY(bool canSuspend READ canSuspend);
36 Q_PROPERTY(bool canHibernate READ canHibernate);
37 Q_PROPERTY(bool canShutdown READ canShutdown);
38 Q_PROPERTY(bool canRestart READ canRestart);
40 Q_PROPERTY(QString hostname READ hostname);
42 /** The hostname of the machine */
43 QString hostname() const;
44 QString theme() const;
46 QVariant getProperty(const QString &name) const;
48 QString timedLoginUser() const;
49 int timedLoginDelay() const;
51 QList<QLightDM::Language> languages() const;
52 QString defaultLanguage() const;
54 //QList<LdmLayout> layouts() const;
55 QString layout() const;
57 QLightDM::Config *config() const;
59 QString defaultSession() const;
60 bool guestAccountSupported() const;
63 bool inAuthentication() const;
64 bool isAuthenticated() const;
65 QString authenticationUser() const;
67 void connectToServer();
68 void cancelTimedLogin();
69 void login(const QString &username);
71 void provideSecret(const QString &secret);
72 void cancelAuthentication();
73 void startSession(const QString &session=QString(), const QString &language=QString());
75 bool canSuspend() const;
76 bool canHibernate() const;
77 bool canShutdown() const;
78 bool canRestart() const;
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);
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 // LDMGREETER_H