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

0001 /*
0002  *  SPDX-FileCopyrightText: 2005 Boudewijn Rempt <boud@valdyas.org>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_SELECTION_OPTIONS_H__
0008 #define __KIS_SELECTION_OPTIONS_H__
0009 
0010 #include "kritaui_export.h"
0011 
0012 #include <KisOptionCollectionWidget.h>
0013 #include <KisSelectionTags.h>
0014 
0015 class QKeySequence;
0016 
0017 class KRITAUI_EXPORT KisSelectionOptions : public KisOptionCollectionWidget
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     enum ReferenceLayers { CurrentLayer, AllLayers, ColorLabeledLayers };
0023 
0024     KisSelectionOptions(QWidget *parent = nullptr);
0025     ~KisSelectionOptions() override;
0026 
0027     SelectionMode mode() const;
0028     SelectionAction action() const;
0029     bool antiAliasSelection() const;
0030     int growSelection() const;
0031     bool stopGrowingAtDarkestPixel() const;
0032     int featherSelection() const;
0033     ReferenceLayers referenceLayers() const;
0034     QList<int> selectedColorLabels() const;
0035 
0036     void setMode(SelectionMode newMode);
0037     void setAction(SelectionAction newAction);
0038     void setAntiAliasSelection(bool newAntiAliasSelection);
0039     void setGrowSelection(int newGrowSelection);
0040     void setStopGrowingAtDarkestPixel(bool newStopGrowingAtDarkestPixel);
0041     void setFeatherSelection(int newFeatherSelection);
0042     void setReferenceLayers(ReferenceLayers newReferenceLayers);
0043     void setSelectedColorLabels(const QList<int> &newSelectedColorLabels);
0044 
0045     void setModeSectionVisible(bool visible);
0046     void setActionSectionVisible(bool visible);
0047     void setAdjustmentsSectionVisible(bool visible);
0048     void setStopGrowingAtDarkestPixelButtonVisible(bool visible);
0049     void setReferenceSectionVisible(bool visible);
0050 
0051     void updateActionButtonToolTip(SelectionAction action,
0052                                    const QKeySequence &shortcut);
0053 
0054 Q_SIGNALS:
0055     void modeChanged(SelectionMode mode);
0056     void actionChanged(SelectionAction action);
0057     void antiAliasSelectionChanged(bool antiAliasSelection);
0058     void growSelectionChanged(int growSelection);
0059     void stopGrowingAtDarkestPixelChanged(bool stopGrowingAtDarkestPixel);
0060     void featherSelectionChanged(int featherSelection);
0061     void referenceLayersChanged(ReferenceLayers referenceLayers);
0062     void selectedColorLabelsChanged();
0063 
0064 private:
0065     class Private;
0066     QScopedPointer<Private> m_d;
0067 };
0068 
0069 #endif
0070