Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_selection_manager.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2004 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KIS_SELECTION_MANAGER_
7#define KIS_SELECTION_MANAGER_
8
9#include <QObject>
10#include <QList>
11#include <QPointer>
12
13#include <kis_image.h>
14#include "KisView.h"
15#include <KisSelectionTags.h>
16
17#include <kritaui_export.h>
18
20class KisAction;
21class QAction;
22class KisDocument;
23
24class KisViewManager;
25class KisClipboard;
27class KisView;
28
31
36class KRITAUI_EXPORT KisSelectionManager : public QObject
37{
38
39 Q_OBJECT
40 Q_PROPERTY(bool displaySelection READ displaySelection NOTIFY displaySelectionChanged);
41 Q_PROPERTY(bool havePixelsSelected READ havePixelsSelected NOTIFY currentSelectionChanged);
42public:
43
45 ~KisSelectionManager() override;
46
47 void setup(KisActionManager* actionManager);
48
49 void setView(QPointer<KisView>imageView);
50
51public:
56
57 bool showSelectionAsMask() const;
58
59public Q_SLOTS:
60
61 void updateGUI();
62 void selectionChanged();
63 void clipboardDataChanged();
64
65 void cut();
66 void copy();
67
68 void cutSharp();
69 void copySharp();
70
71 void copyMerged();
72 void paste();
73 void pasteNew();
74 void pasteAt();
75 void pasteInto();
76 void pasteAsReference();
77 void pasteShapeStyle();
78 void cutToNewLayer();
79 void selectAll();
80 void deselect();
81 void invert();
82 void clear();
83 void fillForegroundColor();
84 void fillBackgroundColor();
85 void fillPattern();
86 void fillForegroundColorOpacity();
87 void fillBackgroundColorOpacity();
88 void fillPatternOpacity();
89 void reselect();
90 void editSelection();
91 void convertToVectorSelection();
92 void convertToRasterSelection();
93 void convertShapesToVectorSelection();
94 void convertToShape();
95
96 void copySelectionToNewLayer();
97 void toggleDisplaySelection();
98
99 void shapeSelectionChanged();
100 void imageResizeToSelection();
101 void paintSelectedShapes();
102
103 void slotToggleSelectionDecoration();
104
105 void slotStrokeSelection();
106
107 void selectOpaqueOnNode(KisNodeSP node, SelectionAction action);
108
109Q_SIGNALS:
114
115public:
117 bool havePixelsInClipboard();
118 bool haveShapesSelected();
119 bool haveShapesInClipboard();
120
122 bool haveAnySelectionWithPixels();
123 bool haveShapeSelectionWithShapes();
124 bool haveRasterSelectionWithPixels();
125 bool canReselectDeactivatedSelection();
126
127private:
128 void fill(const KoColor& color, bool fillWithPattern, const QString& transactionText);
129 void updateStatusBar();
130
131 KisViewManager * m_view {0};
132 KisDocument * m_doc {0};
133 QPointer<KisView>m_imageView {0};
134 KisClipboard * m_clipboard {0};
135
137
138 KisAction *m_copy {0};
139 KisAction *m_copyMerged {0};
140 KisAction *m_cut {0};
141 KisAction *m_paste {0};
142 KisAction *m_pasteAt {0};
143 KisAction *m_pasteInto {0};
144 KisAction *m_pasteAsReference {0};
145 KisAction *m_pasteNew {0};
146 KisAction *m_pasteShapeStyle {0};
147 KisAction *m_cutToNewLayer {0};
148 KisAction *m_selectAll {0};
149 KisAction *m_deselect {0};
150 KisAction *m_clear {0};
151 KisAction *m_reselect {0};
152 KisAction *m_invert {0};
153 KisAction *m_copyToNewLayer {0};
154 KisAction *m_fillForegroundColor {0};
155 KisAction *m_fillBackgroundColor {0};
156 KisAction *m_fillPattern {0};
157 KisAction *m_fillForegroundColorOpacity {0};
158 KisAction *m_fillBackgroundColorOpacity {0};
159 KisAction *m_fillPatternOpacity {0};
160 KisAction *m_imageResizeToSelection {0};
161 KisAction *m_strokeShapes {0};
162 KisAction *m_toggleDisplaySelection {0};
163 KisAction *m_toggleSelectionOverlayMode {0};
164 KisAction *m_strokeSelected {0};
165
166
169
170};
171
172#endif // KIS_SELECTION_MANAGER_
SelectionAction
A KisActionManager class keeps track of KisActions. These actions are always associated with the GUI....
QPointer< KisSelectionDecoration > m_selectionDecoration
void currentSelectionChanged()
void fill(const KoColor &color, bool fillWithPattern, const QString &transactionText)
QList< QAction * > m_pluginActions
void displaySelectionChanged()