Krita Source Code Documentation
Loading...
Searching...
No Matches
KoInteractionTool.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2
3 SPDX-FileCopyrightText: 2006 Thorsten Zachmann <zachmann@kde.org>
4 SPDX-FileCopyrightText: 2006-2007, 2010 Thomas Zander <zander@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KOINTERACTIONTOOL_H
10#define KOINTERACTIONTOOL_H
11
12#include "KoToolBase.h"
13#include "kritaflake_export.h"
14
18
19#define KoInteractionTool_ID "InteractionTool"
20
43class KRITAFLAKE_EXPORT KoInteractionTool : public KoToolBase
44{
45 Q_OBJECT
46public:
52 explicit KoInteractionTool(KoCanvasBase *canvas);
53 ~KoInteractionTool() override;
54
55public:
56 void paint(QPainter &painter, const KoViewConverter &converter) override;
57
58 void mousePressEvent(KoPointerEvent *event) override;
59 void mouseMoveEvent(KoPointerEvent *event) override;
60 void mouseReleaseEvent(KoPointerEvent *event) override;
61
62 void keyPressEvent(QKeyEvent *event) override;
63 void keyReleaseEvent(QKeyEvent *event) override;
64
65protected:
68
69 KoInteractionStrategy *currentStrategy();
71 void cancelCurrentStrategy();
72
77 KoInteractionStrategy *createStrategyBase(KoPointerEvent *event);
79
80 void addInteractionFactory(KoInteractionStrategyFactory *factory);
81 void removeInteractionFactory(const QString &id);
82 bool hasInteractionFactory(const QString &id);
83
84 bool tryUseCustomCursor();
85
86private:
89
90 Q_DECLARE_PRIVATE(KoInteractionTool)
91};
92
93#endif /* KOINTERACTIONTOOL_H */
virtual KoInteractionStrategy * createStrategy(KoPointerEvent *event)=0
KoInteractionTool(const KoInteractionTool &)
KoInteractionTool & operator=(const KoInteractionTool &)
virtual void keyReleaseEvent(QKeyEvent *event)
virtual void mousePressEvent(KoPointerEvent *event)=0
virtual void mouseMoveEvent(KoPointerEvent *event)=0
virtual void mouseReleaseEvent(KoPointerEvent *event)=0
virtual void keyPressEvent(QKeyEvent *event)
virtual void paint(QPainter &painter, const KoViewConverter &converter)=0