/*!
 *
 * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    PreTreatmentConfirm.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      12-Jan-2021
 * \author  (original)  Peter Lucia
 * \date    (original)  03-Aug-2020
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12 // ScrollBar

// Project
//  Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/components/pretreatment"

/*!
 * \brief   Pre-Treatment confirm screen
 * \details which contains the user set values in a table to be confirmed by user.
 */
PreTreatmentBase { id: _root
    objectName: "_PreTreatmentConfirm"

    signal confirmClicked()

    header.stepName: Variables.preTreatmentStepLabelConfirm

    Flickable { id: _flickable
        objectName: "_PreTreatmentConfirmFlickable"
        anchors {
            top             : parent.top
            topMargin       : header.height
            bottom          : parent.bottom
            bottomMargin    : 75
            horizontalCenter: parent.horizontalCenter
        }
        width: parent.width
        contentWidth: parent.width
        contentHeight: _column.implicitHeight
        clip: true

        ScrollBar.vertical: ScrollBar { id: _scrollBar
            anchors.right: _flickable.right
            anchors.rightMargin: 3
            contentItem: Rectangle {
                color: Colors.backgroundRangeRect
                implicitWidth: 6
                radius: width / 2
                width: 3
            }
        }

        Column { id: _column
            spacing: Variables.treatmentSpacing
            anchors.horizontalCenter: parent.horizontalCenter;
            anchors.fill: parent;

            Text { id: _titleText
                anchors.horizontalCenter: parent.horizontalCenter;
                text: qsTr("Confirm Treatment")
                color: Colors.textMain
                font.pixelSize: Fonts.fontPixelTitle
            }
            // insert the treatment information table here
            ConfirmTreatmentTable {
                anchors.horizontalCenter: parent.horizontalCenter

            }

            TouchRect { id : _continueRect
                objectName: "_continueRect"
                anchors.horizontalCenter: parent.horizontalCenter
                text.text: qsTr("CONFIRM TREATMENT")
                button.onClicked: {
                    _root.confirmClicked()
                }
            }
        }
    }
}
