/*! * * Copyright (c) 2022-2022 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 VConfirm.h * \author (last) Behrouz NematiPour * \date (last) 30-Sep-2022 * \author (original) Behrouz NematiPour * \date (original) 30-Sep-2022 * */ #pragma once #include // Project #include "main.h" // Doxygen : do not remove #include "VAdjustmentResponseBase.h" #include "MDuetConfirmHDi.h" #include "MAdjustPowerOff.h" #include "MSettings.h" namespace View { /*! * \brief The VConfirm class * \details View for Model's Data representation. * * \sa Model::MHDPostSingleResult * \sa Model::MHDPostFinalResult * */ class VConfirm : public VAdjustmentResponseBase { Q_OBJECT // // friends // friend class ::tst_views; struct ConfirmData { QString title = ""; QString message = ""; QString confirm = ""; QString cancel = ""; }; QMap _confirms; // disabled coco begin validated: // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI // has been manually tested that it works perfectly fine TRIGGER ( bool , adjustment , 0) // disabled coco end PROPERTY(quint32 , id , 0) PROPERTY(quint32 , command , 0) TRIGGER( quint8 , poweroff , 0) PROPERTY(bool , isPowerOff , 0) PROPERTY(bool , isTimeout , 0) PROPERTY(bool , isReject , 0) PROPERTY(bool , isAccept , 0) TRIGGER (bool , visible , 0) IDBASED (QString , title ,tr("Confirm" ), confirms, id) IDBASED (QString , message ,tr("Are you sure?" ), confirms, id) IDBASED (QString , confirm ,tr("CONFIRM" ), confirms, id) IDBASED (QString , cancel ,tr("CANCEL" ), confirms, id) void setConfirmCommand (const DuetConfirmHDiData &vData); void setConfirmId (const DuetConfirmHDiData &vData); void setPowerOffCommand (); void setPowerOffId (); VIEW_DEC_CLASS (VConfirm ) VIEW_DEC_SLOT (DuetConfirmHDiData ) VIEW_DEC_SLOT (PowerOffData ) VIEW_DEC_SLOT (SettingsData ) public slots: void doConfirm(bool vConfirm); signals: /*! * \brief didAdjustment * \details the notification signal to send the user's Confirmation * \param vData - data model includes request information */ void didAdjustment(const DuetConfirmUIrData &vData); }; }