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

0001 /*
0002  *  SPDX-FileCopyrightText: 2023 Srirupa Datta <srirupa.sps@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef WDGTAGPREVIEW_H
0008 #define WDGTAGPREVIEW_H
0009 
0010 #include "KisTagSelectionWidget.h"
0011 #include "KoID.h"
0012 #include <KisTag.h>
0013 #include <KoResourceBundle.h>
0014 
0015 #include <QWidget>
0016 
0017 class KisTag;
0018 class KisWdgTagSelectionControllerBundleTags;
0019 
0020 namespace Ui {
0021 class WdgTagPreview;
0022 }
0023 
0024 class WdgTagPreview : public QWidget
0025 {
0026     Q_OBJECT
0027 
0028 
0029 Q_SIGNALS:
0030     void tagsAdded(KisTagSP tagSP);
0031     void tagsRemoved(KisTagSP tagSP);
0032 
0033 public:
0034     explicit WdgTagPreview(QString resourceType, KoResourceBundleSP bundle = nullptr, QWidget *parent = nullptr);
0035     ~WdgTagPreview();
0036 
0037 public Q_SLOTS:
0038     void onTagAdded(KoID custom);
0039     void onTagRemoved(KoID custom);
0040 
0041 private:
0042     Ui::WdgTagPreview *m_ui;
0043 
0044     QString m_resourceType;
0045     KisWdgTagSelectionControllerBundleTags *m_tagsController;
0046     KisTagSelectionWidget* m_wdgResourcesTags;
0047     QLayout* m_layout {nullptr};
0048     KoResourceBundleSP m_bundle;
0049 };
0050 
0051 #endif // WDGTAGPREVIEW_H