/*!
 * 
 * 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 TreatmentAdjustmentBase.qml
 * \author (last) Peter Lucia
 * \date (last) 25-Jun-2020
 * \author (original) Behrouz NematiPour
 * \date (original) 22-Mar-2020
 * 
 */

// Qt
import QtQuick 2.12

// Project

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

/*!
 * \brief   TreatmentAdjustmentBase.qml is the base screen
 *          For all adjustment screens in treatment
 */
ModalDialog { id: _root
    contentItem.objectName: "TreatmentAdjustmentBase"  //SquishQt testability

    property string titleText: ""

    property bool   closeVisible: true
    property bool confirmVisible: true
    property bool    backVisible: false
    property bool  pausedVisible: false

    signal   closeClicked()
    signal confirmClicked()
    signal    backClicked()

    onVisibleChanged: {
        notification.text = ""
    }

    header:
    Rectangle { id : _headerRect
        ConfirmButton { id : _confirmButton
            visible: _root.confirmVisible
            anchors.left: parent.left
            onClicked : confirmClicked()
        }
        BackButton { id : _backButton
            visible: _root.backVisible
            anchors.left: parent.left
            onClicked : backClicked()
        }

        TitleText { id : _titleText
            text: titleText
            font.pixelSize: Fonts.fontPixelButton
            color: Colors.textMain
            height: Variables.mainMenuHeight
            anchors {
                top: parent.top
                horizontalCenter: parent.horizontalCenter
                margins: 35
            }
        }

        CloseButton { id : _closeButton
            visible: _root.closeVisible
            anchors.right: parent.right
            onClicked : closeClicked()
        }
    }

    NotificationBarSmall { id: _pausedNotification
        visible : pausedVisible && !notification.visible
        text    : qsTr("Ultrafiltration is paused.")
        imageSource: "qrc:/images/iPauseGray"
    }
}
