~paulliu/unity/phablet-fake-peoplepreviewdata

« back to all changes in this revision

Viewing changes to plugins/LightDM/lightdm-greeter.h

  • Committer: Tarmac
  • Author(s): Michael Terry, Michael Terry, Michael Zanetti
  • Date: 2013-05-14 12:16:08 UTC
  • mfrom: (445.2.78 phablet-greeter-lightdm2)
  • Revision ID: tarmac-20130514121608-r1z1k2uc9l6ss7b0
Add LightDM plugin that currently only has mock contents.

Approved by PS Jenkins bot, Michał Sawicz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 * Copyright (C) 2010-2011 David Edmundson.
 
4
 * Copyright (C) 2010-2011 Robert Ancell
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; version 3.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 *
 
18
 * Author: David Edmundson <kde@davidedmundson.co.uk>
 
19
 */
 
20
 
 
21
#ifndef LIGHTDM_GREETER_H
 
22
#define LIGHTDM_GREETER_H
 
23
 
 
24
#include <QtCore/QObject>
 
25
#include <QtCore/QVariant>
 
26
 
 
27
 
 
28
namespace QLightDM
 
29
{
 
30
    class GreeterPrivate;
 
31
 
 
32
class Q_DECL_EXPORT Greeter : public QObject
 
33
{
 
34
    Q_OBJECT
 
35
 
 
36
    Q_PROPERTY(bool authenticated READ isAuthenticated ) //NOTFIY authenticationComplete
 
37
    Q_PROPERTY(QString authenticationUser READ authenticationUser )
 
38
    Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT)
 
39
    Q_PROPERTY(QString selectUser READ selectUserHint CONSTANT)
 
40
    Q_PROPERTY(bool selectGuest READ selectGuestHint CONSTANT)
 
41
 
 
42
    Q_PROPERTY(QString hostname READ hostname CONSTANT)
 
43
    Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT)
 
44
    Q_PROPERTY(bool locked READ lockHint CONSTANT)
 
45
 
 
46
    Q_PROPERTY(QString hostname READ hostname CONSTANT)
 
47
 
 
48
    Q_ENUMS(PromptType MessageType)
 
49
 
 
50
public:
 
51
    enum PromptType {
 
52
        PromptTypeQuestion,
 
53
        PromptTypeSecret
 
54
    };
 
55
 
 
56
    enum MessageType {
 
57
        MessageTypeInfo,
 
58
        MessageTypeError
 
59
    };
 
60
 
 
61
    explicit Greeter(QObject* parent=0);
 
62
    virtual ~Greeter();
 
63
 
 
64
    QString getHint(const QString &name) const;
 
65
    QString defaultSessionHint() const;
 
66
    bool hideUsersHint() const;
 
67
    bool showManualLoginHint() const;
 
68
    bool showRemoteLoginHint() const;
 
69
    bool lockHint () const;
 
70
    bool hasGuestAccountHint() const;
 
71
    QString selectUserHint() const;
 
72
    bool selectGuestHint() const;
 
73
    QString autologinUserHint() const;
 
74
    bool autologinGuestHint() const;
 
75
    int autologinTimeoutHint() const;
 
76
 
 
77
    bool inAuthentication() const;
 
78
    bool isAuthenticated() const;
 
79
    QString authenticationUser() const;
 
80
    QString hostname() const;
 
81
 
 
82
public Q_SLOTS:
 
83
    bool connectSync();
 
84
    void authenticate(const QString &username=QString());
 
85
    void authenticateAsGuest();
 
86
    void authenticateAutologin();
 
87
    void authenticateRemote(const QString &session=QString(), const QString &username=QString());
 
88
    void respond(const QString &response);
 
89
    void cancelAuthentication();
 
90
    void setLanguage (const QString &language);
 
91
    bool startSessionSync(const QString &session=QString());
 
92
 
 
93
Q_SIGNALS:
 
94
    void showMessage(QString text, QLightDM::Greeter::MessageType type);
 
95
    void showPrompt(QString text, QLightDM::Greeter::PromptType type);
 
96
    void authenticationComplete();
 
97
    void autologinTimerExpired();
 
98
 
 
99
private:
 
100
    GreeterPrivate *d_ptr;
 
101
    Q_DECLARE_PRIVATE(Greeter)
 
102
};
 
103
}
 
104
 
 
105
#endif // LIGHTDM_GREETER_H