]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - liblightdm-qt/QLightDM/greeter.h
Add greeter-show-remote-login hint
[sojka/lightdm.git] / liblightdm-qt / QLightDM / greeter.h
1 /*
2  * Copyright (C) 2010-2011 David Edmundson.
3  * Copyright (C) 2010-2011 Robert Ancell
4  * Author: David Edmundson <kde@davidedmundson.co.uk>
5  *
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
10  * license.
11  */
12
13 #ifndef QLIGHTDM_GREETER_H
14 #define QLIGHTDM_GREETER_H
15
16 #include <QtCore/QObject>
17 #include <QtCore/QVariant>
18
19
20 namespace QLightDM
21 {
22     class GreeterPrivate;
23
24 class Q_DECL_EXPORT Greeter : public QObject
25 {
26     Q_OBJECT
27     
28     Q_PROPERTY(bool authenticated READ isAuthenticated ); //NOTFIY authenticationComplete
29     Q_PROPERTY(QString authenticationUser READ authenticationUser );  
30     Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT);
31     Q_PROPERTY(QString selectUser READ selectUserHint CONSTANT);
32     Q_PROPERTY(bool selectGuest READ selectGuestHint CONSTANT);
33
34     Q_PROPERTY(QString hostname READ hostname CONSTANT);
35     Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT);
36     Q_PROPERTY(bool locked READ lockHint CONSTANT);
37     
38     Q_PROPERTY(QString hostname READ hostname CONSTANT);
39
40 public:
41     enum PromptType {
42         PromptTypeQuestion,
43         PromptTypeSecret
44     };
45
46     enum MessageType {
47         MessageTypeInfo,
48         MessageTypeError
49     };
50
51     explicit Greeter(QObject* parent=0);
52     virtual ~Greeter();
53
54     QString getHint(const QString &name) const;   
55     QString defaultSessionHint() const;
56     bool hideUsersHint() const;
57     bool showManualLoginHint() const;
58     bool showRemoteLoginHint() const;
59     bool lockHint () const;
60     bool hasGuestAccountHint() const;
61     QString selectUserHint() const;
62     bool selectGuestHint() const;
63     QString autologinUserHint() const;
64     bool autologinGuestHint() const;
65     int autologinTimeoutHint() const;
66
67     bool inAuthentication() const;
68     bool isAuthenticated() const;
69     QString authenticationUser() const;
70     QString hostname() const;
71
72 public slots:
73     bool connectSync();
74     void authenticate(const QString &username=QString());
75     void authenticateAsGuest();
76     void authenticateRemote(const QString &session=QString(), const QString &username=QString());
77     void respond(const QString &response);
78     void cancelAuthentication();
79     void setLanguage (const QString &language);
80     bool startSessionSync(const QString &session=QString());
81
82 signals:
83     void showMessage(QString text, QLightDM::Greeter::MessageType type);
84     void showPrompt(QString text, QLightDM::Greeter::PromptType type);
85     void authenticationComplete();
86     void autologinTimerExpired();
87
88 private:
89     GreeterPrivate *d_ptr;
90     Q_DECLARE_PRIVATE(Greeter)
91
92 };
93 };
94
95 #endif // QLIGHTDM_GREETER_H