~josharenson/unity8/fix-greeter-password-focus

« back to all changes in this revision

Viewing changes to tests/mocks/AccountsService/AccountsService.h

  • Committer: Josh Arenson
  • Date: 2016-03-25 19:54:02 UTC
  • mfrom: (1979.1.9 session-chooser-gui)
  • Revision ID: joshua.arenson@canonical.com-20160325195402-867v3w2zvmjj0kq3
merge prereq

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2013 Canonical, Ltd.
 
2
 * Copyright (C) 2013, 2015 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
12
12
 *
13
13
 * You should have received a copy of the GNU General Public License
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Authors: Gerry Boland <gerry.boland@canonical.com>
17
 
 *          Michael Terry <michael.terry@canonical.com>
18
15
 */
19
16
 
20
17
#ifndef UNITY_MOCK_ACCOUNTSSERVICE_H
22
19
 
23
20
#include <QObject>
24
21
#include <QString>
 
22
#include <QStringList>
25
23
#include <QVariant>
26
24
 
27
25
class AccountsService: public QObject
36
34
                READ demoEdges
37
35
                WRITE setDemoEdges
38
36
                NOTIFY demoEdgesChanged)
 
37
    Q_PROPERTY (QStringList demoEdgesCompleted
 
38
                READ demoEdgesCompleted
 
39
                WRITE setDemoEdgesCompleted // only available in mock
 
40
                NOTIFY demoEdgesCompletedChanged)
39
41
    Q_PROPERTY (bool enableLauncherWhileLocked
40
42
                READ enableLauncherWhileLocked
41
43
                WRITE setEnableLauncherWhileLocked // only available in mock
70
72
    Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
71
73
               READ hereLicensePathValid
72
74
               NOTIFY hereLicensePathChanged)
 
75
    Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
 
76
    Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
 
77
    Q_PROPERTY(QStringList keymaps
 
78
               READ keymaps
 
79
               WRITE setKeymaps // only in mock
 
80
               NOTIFY keymapsChanged)
73
81
 
74
82
public:
75
83
    enum PasswordDisplayHint {
76
84
        Keyboard,
77
 
        Numeric,
 
85
        Numeric
78
86
    };
79
87
 
80
88
    explicit AccountsService(QObject *parent = 0);
83
91
    void setUser(const QString &user);
84
92
    bool demoEdges() const;
85
93
    void setDemoEdges(bool demoEdges);
 
94
    QStringList demoEdgesCompleted() const;
 
95
    void setDemoEdgesCompleted(const QStringList &demoEdges);
 
96
    Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
86
97
    bool enableLauncherWhileLocked() const;
87
98
    void setEnableLauncherWhileLocked(bool enableLauncherWhileLocked);
88
99
    bool enableIndicatorsWhileLocked() const;
99
110
    QString hereLicensePath() const;
100
111
    void setHereLicensePath(const QString &path);
101
112
    bool hereLicensePathValid() const;
 
113
    QString realName() const;
 
114
    void setRealName(const QString &realName);
 
115
    QString email() const;
 
116
    void setEmail(const QString &email);
 
117
    QStringList keymaps() const;
 
118
    void setKeymaps(const QStringList &keymaps);
102
119
 
103
120
Q_SIGNALS:
104
121
    void userChanged();
105
122
    void demoEdgesChanged();
 
123
    void demoEdgesCompletedChanged();
106
124
    void enableLauncherWhileLockedChanged();
107
125
    void enableIndicatorsWhileLockedChanged();
108
126
    void backgroundFileChanged();
111
129
    void failedLoginsChanged();
112
130
    void hereEnabledChanged();
113
131
    void hereLicensePathChanged();
 
132
    void realNameChanged();
 
133
    void emailChanged();
 
134
    void keymapsChanged();
114
135
 
115
136
private:
116
137
    bool m_enableLauncherWhileLocked;
120
141
    bool m_statsWelcomeScreen;
121
142
    uint m_failedLogins;
122
143
    bool m_demoEdges;
 
144
    QStringList m_demoEdgesCompleted;
123
145
    bool m_hereEnabled;
124
146
    QString m_hereLicensePath;
 
147
    QString m_realName;
 
148
    QStringList m_kbdMap;
 
149
    QString m_email;
125
150
};
126
151
 
127
152
#endif