File indexing completed on 2024-06-09 04:26:42
0001 /* 0002 * SPDX-FileCopyrightText: 2018 Anna Medonosova <anna.medonosova@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 0008 #ifndef KISGAMUTMASKCHOOSER_H 0009 #define KISGAMUTMASKCHOOSER_H 0010 0011 #include <QWidget> 0012 0013 class KisResourceItemChooser; 0014 #include <KoResource.h> 0015 #include <resources/KoGamutMask.h> 0016 0017 class KisGamutMaskDelegate; 0018 0019 class KisGamutMaskChooser : public QWidget 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit KisGamutMaskChooser(QWidget *parent = nullptr); 0024 ~KisGamutMaskChooser() override; 0025 0026 enum ViewMode { 0027 THUMBNAIL, // Shows thumbnails 0028 DETAIL // Shows thumbnails with text next to it 0029 }; 0030 0031 void setCurrentResource(KoResourceSP resource); 0032 0033 protected: 0034 void resizeEvent(QResizeEvent* event) override; 0035 0036 Q_SIGNALS: 0037 void sigGamutMaskSelected(KoGamutMaskSP mask); 0038 0039 private Q_SLOTS: 0040 void resourceSelected(KoResourceSP resource); 0041 void slotSetModeThumbnail(); 0042 void slotSetModeDetail(); 0043 0044 private: 0045 void setViewMode(ViewMode mode); 0046 void updateViewSettings(); 0047 KisResourceItemChooser* m_itemChooser; 0048 KisGamutMaskDelegate* m_delegate; 0049 ViewMode m_mode; 0050 }; 0051 0052 #endif // KISGAMUTMASKCHOOSER_H