File indexing completed on 2024-05-12 04:52:51

0001 /*
0002     SPDX-FileCopyrightText: 2019 Jean-Baptiste Mardelle
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #pragma once
0007 
0008 #include "abstractparamwidget.hpp"
0009 #include <QWidget>
0010 
0011 class QPushButton;
0012 class QProgressBar;
0013 
0014 /** @brief This class represents a parameter that requires
0015            the user to choose tick a checkbox
0016  */
0017 class ButtonParamWidget : public AbstractParamWidget
0018 {
0019     Q_OBJECT
0020 public:
0021     /** @brief Constructor for the widgetComment
0022         @param name String containing the name of the parameter
0023         @param comment Optional string containing the comment associated to the parameter
0024         @param checked Boolean indicating whether the checkbox should initially be checked
0025         @param parent Parent widget
0026     */
0027     ButtonParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent);
0028 
0029     /** @brief Returns the current value of the parameter
0030      */
0031     bool getValue();
0032 
0033 public Q_SLOTS:
0034     /** @brief Toggle the comments on or off
0035      */
0036     void slotShowComment(bool show) override;
0037 
0038     /** @brief refresh the properties to reflect changes in the model
0039      */
0040     void slotRefresh() override;
0041 
0042 private:
0043     QPushButton *m_button;
0044     QProgressBar *m_progress;
0045     QString m_keyParam;
0046     QString m_buttonName;
0047     QString m_alternatebuttonName;
0048     QString m_conditionalText;
0049     bool m_displayConditional;
0050     bool m_animated;
0051 };