2 * Copyright (C) 2015 Canonical, Ltd.
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.
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.
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/>.
18 import Ubuntu.Components 1.1
23 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
24 property alias launcherOffset: coverPage.launcherOffset
25 property alias currentIndex: loginList.currentIndex
26 property int delayMinutes // TODO
27 property alias backgroundTopMargin: coverPage.backgroundTopMargin
28 property alias background: coverPage.background
30 property bool alphanumeric // unused
31 property alias userModel: loginList.model
32 property alias infographicModel: coverPage.infographicModel
33 readonly property bool fullyShown: coverPage.showProgress === 1
34 readonly property bool required: coverPage.required
36 // so that it can be replaced in tests with a mock object
37 property var inputMethod: Qt.inputMethod
39 signal selected(int index)
40 signal responded(string response)
42 signal emergencyCall() // unused
44 function showMessage(html) {
45 loginList.showMessage(html);
48 function showPrompt(text, isSecret, isDefaultPrompt) {
49 loginList.showPrompt(text, isSecret, isDefaultPrompt);
52 function showLastChance() {
60 function notifyAuthenticationSucceeded() {
64 function notifyAuthenticationFailed() {
65 loginList.showError();
72 function tryToUnlock(toTheRight) {
75 loginList.tryToUnlock();
78 var coverChanged = coverPage.shown;
80 coverPage.hideRight();
91 opacity: coverPage.showProgress * 0.8
96 objectName: "coverPage"
99 draggable: !root.locked
102 height: 0.75 * parent.height
103 anchors.leftMargin: loginList.x + loginList.width
106 onTease: root.tease()
108 onShowProgressChanged: {
109 if (showProgress === 0 && !root.locked) {
116 objectName: "loginList"
120 leftMargin: Math.min(parent.width * 0.16, units.gu(20))
124 height: inputMethod && inputMethod.visible ? parent.height - inputMethod.keyboardRectangle.height
126 Behavior on height { UbuntuNumberAnimation {} }
130 onSelected: root.selected(index)
131 onResponded: root.responded(response)