~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-yakkety-landing-092

« back to all changes in this revision

Viewing changes to tests/qmltests/mocks/Biometryd/plugin.cpp

  • Committer: Bileto Bot
  • Date: 2016-06-20 14:01:03 UTC
  • mfrom: (103.6.69 fingerprint)
  • Revision ID: ci-train-bot@canonical.com-20160620140103-q57lulbze89e6yyd
jonas-drange
* Add components for Fingerprint management.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#include "plugin.h"
 
18
 
 
19
#include "MockDevice.h"
 
20
#include "MockFingerprintReader.h"
 
21
#include "MockObserver.h"
 
22
#include "MockOperation.h"
 
23
#include "MockService.h"
 
24
#include "MockTemplateStore.h"
 
25
#include "MockUser.h"
 
26
 
 
27
#include <QtQml>
 
28
 
 
29
void BackendPlugin::registerTypes(const char *uri)
 
30
{
 
31
    Q_ASSERT(uri == QLatin1String("Biometryd"));
 
32
 
 
33
    qmlRegisterType<MockObserver>(uri, 0, 0, "Observer");
 
34
    qmlRegisterType<MockUser>(uri, 0, 0, "User");
 
35
 
 
36
    qmlRegisterUncreatableType<MockDevice>(uri, 0, 0, "Device", "Rely on Biometryd.instance");
 
37
 
 
38
    qmlRegisterUncreatableType<MockOperation>(uri, 0, 0, "Operation", "Rely on Biometryd.instance");
 
39
    qmlRegisterUncreatableType<MockSizeQuery>(uri, 0, 0, "SizeQuery", "Rely on Biometryd.instance");
 
40
    qmlRegisterUncreatableType<MockEnrollment>(uri, 0, 0, "Enrollment", "Rely on Biometryd.instance");
 
41
    qmlRegisterUncreatableType<MockClearance>(uri, 0, 0, "Clearance", "Rely on Biometryd.instance");
 
42
    qmlRegisterUncreatableType<MockTemplateStore>(uri, 0, 0, "TemplateStore", "Rely on Biometryd.instance");
 
43
    qmlRegisterUncreatableType<MockRemoval>(uri, 0, 0, "Removal", "Rely on Biometryd.instance");
 
44
    qmlRegisterUncreatableType<MockList>(uri, 0, 0, "List", "Rely on Biometryd.instance");
 
45
 
 
46
    qmlRegisterSingletonType<MockService>(
 
47
        uri, 0, 0, "Biometryd",
 
48
        [](QQmlEngine*, QJSEngine*) -> QObject*
 
49
        {
 
50
            return new MockService;
 
51
        }
 
52
    );
 
53
    qmlRegisterSingletonType<MockFingerprintReader>(
 
54
        uri, 0, 0, "FingerprintReader",
 
55
        [](QQmlEngine*, QJSEngine*) -> QObject*
 
56
        {
 
57
            return new MockFingerprintReader;
 
58
        }
 
59
    );
 
60
}