/*! * * Copyright (c) 2022-2024 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) 10-Oct-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 "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; // ********** DYNAMIC PROPERTIES: The properties which need to be updated by each confirm message received. ********** // READONLY( bool , needConfirm , false) // The property adjustment_Triggered has to be always true // and to always trigger the change event to work as a notifier for GUI TRIGGER ( bool , adjustment , 0) 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 setPowerOffCommand (); void setPowerOffId (); VIEW_DEC_CLASS (VConfirm ) // AUTOGEN ISSUE //VIEW_DEC_SLOT (PowerOffData ) VIEW_DEC_SLOT (SettingsData ) public slots: void doConfirm(bool vConfirm); signals: }; }