]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - libldmgreeter-qt/ldmgreeter.h
6929ec89de5b6bcdbb8b9f8dd77577eaf6fdb5f2
[sojka/lightdm.git] / libldmgreeter-qt / ldmgreeter.h
1 #ifndef LDMGREETER_H
2 #define LDMGREETER_H
3
4 #include <QWidget>
5
6 class PowerManagementInterface;
7 class DisplayInterface;
8 class UserManagerInterface;
9
10 class LdmGreeterPrivate;
11 class LdmUser;
12 class LdmSession;
13 class LdmAuthRequest;
14 class QDBusPendingCallWatcher;
15
16 //TODO
17 // all accessors need to be marked const.
18 // need to pass by reference where applicable.
19 // fix FIXME about authentication.
20 // decide async start - provide ready() signal(like Tp-Qt4)?
21 // quit is a rubbish name for a signal, it sounds too much like a slot.
22 // maybe modify defaultLayout to return the layout?(same for sesion) - or the modelIndex?
23 // document all the public methods.
24
25 class Q_DECL_EXPORT LdmGreeter : public QWidget
26 {
27     Q_OBJECT
28 public:
29     explicit LdmGreeter();
30     ~LdmGreeter();
31
32     /** The hostname of the machine*/
33     QString hostname();
34     QString defaultLanguage();
35     QString defaultLayout();
36     QString defaultSession();
37     QString defaultUsername();
38
39     QList<LdmUser> users();
40
41     QList<LdmSession> sessions();
42
43     //FIXME this is inconsistent - need to decide whether lib remembers username, or client needs to keep passing it.
44     void startAuthentication(QString username);
45     void provideSecret(QString secret);
46     void login(QString username, QString session, QString language);
47
48     //FIXME should probably mess about with Q_PROPERTY
49     bool canSuspend();
50     void suspend();
51     bool canHibernate();
52     void hibernate();
53     bool canShutdown();
54     void shutdown();
55     bool canRestart();
56     void restart();
57
58     //FIXME replace these signals with pure virtual
59     //virtual blah() = 0;
60
61 signals:
62     void showPrompt(QString prompt);
63     void showMessage(QString message);
64     void showError(QString message);
65     void authenticationComplete(bool success);
66     void timedLogin(QString username);
67     void quit();
68
69 public slots:
70
71 private slots:
72     void onAuthFinished(QDBusPendingCallWatcher*);
73
74 private:
75     LdmGreeterPrivate* d;
76 };
77
78 #endif // GREETER_H