File: kis_selection_tool_config_widget_helper.h

package info (click to toggle)
krita 1%3A5.2.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 535,928 kB
  • sloc: cpp: 644,668; python: 15,986; ansic: 10,315; xml: 8,488; perl: 622; sh: 214; sql: 129; lisp: 110; makefile: 8
file content (73 lines) | stat: -rw-r--r-- 2,182 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 *  SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __KIS_SELECTION_TOOL_CONFIG_WIDGET_HELPER_H
#define __KIS_SELECTION_TOOL_CONFIG_WIDGET_HELPER_H

#include <QObject>
#include <QList>

#include "kis_canvas_resource_provider.h"
#include "kis_image.h"
#include "kis_selection.h"
#include "kritaui_export.h"
#include <kis_selection_options.h>

class KoCanvasResourceProvider;

class KRITAUI_EXPORT KisSelectionToolConfigWidgetHelper : public QObject
{
    Q_OBJECT
public:
    KisSelectionToolConfigWidgetHelper(const QString &windowTitle);

    void createOptionWidget(const QString &toolId);
    KisSelectionOptions* optionWidget() const;

    SelectionMode selectionMode() const;
    SelectionAction selectionAction() const;
    bool antiAliasSelection() const;
    int growSelection() const;
    bool stopGrowingAtDarkestPixel() const;
    int featherSelection() const;
    KisSelectionOptions::ReferenceLayers referenceLayers() const;
    QList<int> selectedColorLabels() const;

    int action() const { return selectionAction(); }

    void setConfigGroupForExactTool(QString toolId);

Q_SIGNALS:
    void selectionActionChanged(SelectionAction newAction);

public Q_SLOTS:
    void slotToolActivatedChanged(bool isActivated);

    void slotWidgetModeChanged(SelectionMode mode);
    void slotWidgetActionChanged(SelectionAction action);
    void slotWidgetAntiAliasChanged(bool value);
    void slotWidgetGrowChanged(int value);
    void slotWidgetStopGrowingAtDarkestPixelChanged(bool value);
    void slotWidgetFeatherChanged(int value);
    void slotReferenceLayersChanged(
        KisSelectionOptions::ReferenceLayers referenceLayers);
    void slotSelectedColorLabelsChanged();

    void slotReplaceModeRequested();
    void slotAddModeRequested();
    void slotSubtractModeRequested();
    void slotIntersectModeRequested();
    void slotSymmetricDifferenceModeRequested();

private:
    KisSelectionOptions* m_optionsWidget;
    QString m_windowTitle;
    QString m_configGroupForTool {""};

    void reloadExactToolConfig();
};

#endif /* __KIS_SELECTION_TOOL_CONFIG_WIDGET_HELPER_H */