Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_selection_tool_helper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007 Sven Langkamp <sven.langkamp@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KIS_SELECTION_TOOL_HELPER_H
7#define KIS_SELECTION_TOOL_HELPER_H
8
9#include <kritaui_export.h>
10#include <QMenu>
11#include <QPointer>
12
13#include "kundo2magicstring.h"
14#include "kis_layer.h"
15#include "kis_selection.h"
16#include "kis_canvas2.h"
18
19class KoShape;
20
24class KRITAUI_EXPORT KisSelectionToolHelper
25{
26public:
27
30
31 void selectPixelSelection(KisProcessingApplicator& applicator, KisPixelSelectionSP selection, SelectionAction action);
32 void selectPixelSelection(KisPixelSelectionSP selection, SelectionAction action);
33
34 void addSelectionShape(KoShape* shape, SelectionAction action = SELECTION_DEFAULT);
35 void addSelectionShapes(QList<KoShape*> shapes, SelectionAction action = SELECTION_DEFAULT);
36
37 bool canShortcutToDeselect(const QRect &rect, SelectionAction action);
38 bool canShortcutToNoop(const QRect &rect, SelectionAction action);
39
40 bool tryDeselectCurrentSelection(const QRectF selectionViewRect, SelectionAction action);
41 static QMenu* getSelectionContextMenu(KisCanvas2* canvas);
42
43 SelectionMode tryOverrideSelectionMode(KisSelectionSP activeSelection, SelectionMode currentMode, SelectionAction currentAction) const;
44
45
46private:
51};
52
53
54#endif
SelectionMode
SelectionAction
@ SELECTION_DEFAULT
QPointer< KisCanvas2 > m_canvas