2 * Copyright (C) 2015-2016 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.3
24 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
25 property alias launcherOffset: coverPage.launcherOffset
26 property alias currentIndex: loginList.currentIndex
27 property int delayMinutes // TODO
28 property alias backgroundTopMargin: coverPage.backgroundTopMargin
29 property alias background: coverPage.background
31 property alias alphanumeric: loginList.alphanumeric
32 property alias userModel: loginList.model
33 property alias infographicModel: coverPage.infographicModel
35 readonly property bool fullyShown: coverPage.showProgress === 1
36 readonly property bool required: coverPage.required
37 readonly property bool animating: coverPage.showAnimation.running || coverPage.hideAnimation.running
39 // so that it can be replaced in tests with a mock object
40 property var inputMethod: Qt.inputMethod
42 signal selected(int index)
43 signal responded(string response)
45 signal emergencyCall() // unused
47 function showMessage(html) {
48 loginList.showMessage(html);
51 function showPrompt(text, isSecret, isDefaultPrompt) {
52 loginList.showPrompt(text, isSecret, isDefaultPrompt);
55 function showLastChance() {
63 function notifyAuthenticationSucceeded(showFakePassword) {
67 function notifyAuthenticationFailed() {
68 loginList.showError();
71 function showErrorMessage(msg) {
72 coverPage.showErrorMessage(msg);
79 function tryToUnlock(toTheRight) {
82 loginList.tryToUnlock();
85 var coverChanged = coverPage.shown;
87 coverPage.hideRight();
98 opacity: coverPage.showProgress * 0.8
103 objectName: "coverPage"
104 height: parent.height
106 draggable: !root.locked && !root.waiting
109 height: 0.75 * parent.height
110 anchors.leftMargin: loginList.x + loginList.width
113 onTease: root.tease()
115 onShowProgressChanged: {
116 if (showProgress === 0 && !root.locked) {
123 objectName: "loginList"
127 leftMargin: Math.min(parent.width * 0.16, units.gu(20))
131 height: inputMethod && inputMethod.visible ? parent.height - inputMethod.keyboardRectangle.height
133 Behavior on height { UbuntuNumberAnimation {} }
136 waiting: root.waiting
138 onSelected: root.selected(index)
139 onResponded: root.responded(response)