1/********************************************************************
2 This file is part of the KDE project.
3
4Copyright (C) 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program.  If not, see <http://www.gnu.org/licenses/>.
18*********************************************************************/
19
20import QtQuick 2.5
21import QtQuick.Controls 1.1
22import org.kde.plasma.core 2.0 as PlasmaCore
23import org.kde.plasma.private.sessions 2.0
24import "../components"
25
26Item {
27    id: root
28    property bool viewVisible: false
29    property bool debug: false
30    property string notification
31    property int interfaceVersion: org_kde_plasma_screenlocker_greeter_interfaceVersion ? org_kde_plasma_screenlocker_greeter_interfaceVersion : 0
32    signal clearPassword()
33
34    LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
35    LayoutMirroring.childrenInherit: true
36
37    Loader {
38        id: mainLoader
39        anchors.fill: parent
40        opacity: 0
41        onItemChanged: opacity = 1
42
43        focus: true
44
45        Behavior on opacity {
46            OpacityAnimator {
47                duration: units.longDuration
48                easing.type: Easing.InCubic
49            }
50        }
51    }
52    Connections {
53        id:loaderConnection
54        target: org_kde_plasma_screenlocker_greeter_view
55        onFrameSwapped: {
56            mainLoader.source = "LockScreenUi.qml";
57            loaderConnection.target = null;
58        }
59    }
60    Component.onCompleted: {
61        if (root.interfaceVersion < 2) {
62            mainLoader.source = "LockScreenUi.qml";
63        }
64    }
65}
66