File indexing completed on 2024-12-22 04:13:12

0001 /*
0002  *  SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net>
0003  *  SPDX-FileCopyrightText: 2011 Boudewijn Rempot <boud@valdyas.org>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef _KIS_META_DATA_MERGE_STRATEGY_CHOOSER_WIDGET_H_
0009 #define _KIS_META_DATA_MERGE_STRATEGY_CHOOSER_WIDGET_H_
0010 
0011 #include <QWidget>
0012 
0013 namespace KisMetaData
0014 {
0015 class MergeStrategy;
0016 }
0017 
0018 /**
0019  * This widget allows to select a meta data merge strategy.
0020  */
0021 class KisMetaDataMergeStrategyChooserWidget : public QWidget
0022 {
0023     Q_OBJECT
0024 public:
0025     /**
0026      * Creates a widget to select a merge strategy.
0027      */
0028     KisMetaDataMergeStrategyChooserWidget(QWidget* parent);
0029     ~KisMetaDataMergeStrategyChooserWidget() override;
0030 
0031     const KisMetaData::MergeStrategy* currentStrategy();
0032 
0033     /**
0034      * Show a dialog which embed that widget, and have an Ok and Cancel button.
0035      * @return 0 if no merge strategy was selected, or the selected merge strategy
0036      */
0037     static const KisMetaData::MergeStrategy* showDialog(QWidget* parent);
0038 
0039 private Q_SLOTS:
0040 
0041     void setCurrentDescription(int index);
0042 
0043 private:
0044 
0045     const KisMetaData::MergeStrategy* mergeStrategy(int index);
0046 
0047     struct Private;
0048     Private* const d;
0049 };
0050 
0051 #endif