~lukas-kde/unity8/dashboard

« back to all changes in this revision

Viewing changes to plugins/LightDM/Greeter.h

  • Committer: Lukáš Tinkl
  • Date: 2017-01-26 12:13:17 UTC
  • mfrom: (2749.1.49 unity8)
  • Revision ID: lukas.tinkl@canonical.com-20170126121317-qms39s9pikclidbe
merge trunk, fix conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2012,2013,2015 Canonical, Ltd.
 
2
 * Copyright (C) 2012-2016 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
21
21
   such edits in the future, and by inserting ourselves here, we have more
22
22
   control. */
23
23
 
24
 
#ifndef UNITY_GREETER_H
25
 
#define UNITY_GREETER_H
 
24
#pragma once
26
25
 
27
26
#include <QLightDM/Greeter>
28
27
#include <QtCore/QObject>
29
28
 
30
29
class GreeterPrivate;
 
30
class PromptsModel;
31
31
 
32
32
class Greeter : public QObject
33
33
{
37
37
    Q_PROPERTY(bool authenticated READ isAuthenticated NOTIFY isAuthenticatedChanged)
38
38
    Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
39
39
    Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT)
40
 
    Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
41
40
    Q_PROPERTY(QString selectUser READ selectUser CONSTANT)
42
41
 
43
42
public:
44
 
    explicit Greeter(QObject* parent=0);
 
43
    static Greeter *instance();
 
44
    virtual ~Greeter();
45
45
 
46
46
    bool isActive() const;
47
47
    bool isAuthenticated() const;
48
48
    QString authenticationUser() const;
49
49
    QString defaultSessionHint() const;
50
 
    bool promptless() const;
51
50
    QString selectUser() const;
 
51
    bool hasGuestAccount() const;
 
52
    bool showManualLoginHint() const;
 
53
    bool hideUsersHint() const;
 
54
 
 
55
    PromptsModel *promptsModel();
52
56
 
53
57
public Q_SLOTS:
54
58
    void authenticate(const QString &username=QString());
57
61
    void setIsActive(bool isActive);
58
62
 
59
63
Q_SIGNALS:
60
 
    void showMessage(const QString &text, bool isError);
61
 
    void showPrompt(const QString &text, bool isSecret, bool isDefaultPrompt);
62
 
    void authenticationComplete();
63
 
    void authenticationUserChanged(const QString &user);
 
64
    void authenticationUserChanged();
64
65
    void isActiveChanged();
65
66
    void isAuthenticatedChanged();
66
 
    void promptlessChanged();
67
67
    void showGreeter();
68
68
    void hideGreeter();
 
69
    void loginError(bool automatic);
 
70
    void loginSuccess(bool automatic);
 
71
    void authenticationStarted(); // useful for testing
69
72
 
70
73
    // This signal is emitted by external agents like indicators, and the UI
71
74
    // should switch to this user if possible.
72
75
    void requestAuthenticationUser(const QString &user);
73
76
 
74
77
protected:
 
78
    explicit Greeter(QObject* parent=0);
 
79
 
75
80
    GreeterPrivate * const d_ptr;
76
81
 
77
82
    Q_DECLARE_PRIVATE(Greeter)
80
85
    void showMessageFilter(const QString &text, QLightDM::Greeter::MessageType type);
81
86
    void showPromptFilter(const QString &text, QLightDM::Greeter::PromptType type);
82
87
    void authenticationCompleteFilter();
 
88
    void checkAuthenticationUser();
83
89
};
84
 
 
85
 
#endif