File indexing completed on 2024-05-12 04:52:55
0001 /* 0002 SPDX-FileCopyrightText: 2018 Jean-Baptiste Mardelle <jb@kdenlive.org> 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 "ui_wipeval_ui.h" 0010 0011 #include <QWidget> 0012 0013 /** 0014 * @class SlideWidget 0015 * @brief Provides options to choose slide. 0016 * @author Jean-Baptiste Mardelle 0017 */ 0018 class SlideWidget : public AbstractParamWidget, public Ui::Wipeval_UI 0019 { 0020 Q_OBJECT 0021 public: 0022 enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 }; 0023 struct wipeInfo 0024 { 0025 WIPE_DIRECTON start; 0026 WIPE_DIRECTON end; 0027 int startTransparency; 0028 int endTransparency; 0029 }; 0030 /** @brief Sets up the widget. 0031 */ 0032 explicit SlideWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent); 0033 0034 /** @brief Gets the chosen slide. */ 0035 QString getSlide() const; 0036 0037 private: 0038 wipeInfo getWipeInfo(QString value); 0039 const QString getWipeString(wipeInfo info); 0040 0041 public Q_SLOTS: 0042 /** @brief Toggle the comments on or off 0043 */ 0044 void slotShowComment(bool show) override; 0045 0046 /** @brief refresh the properties to reflect changes in the model 0047 */ 0048 void slotRefresh() override; 0049 0050 /** @brief Updates the different color choosing options to have all selected @param color. */ 0051 void updateValue(); 0052 0053 Q_SIGNALS: 0054 /** @brief Emitted whenever a different color was chosen. */ 0055 void modified(const QString &); 0056 };