File indexing completed on 2024-06-23 04:28:09

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Victor Wåhlström <victor.wahlstrom@initiali.se>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KIS_TOOL_PAN_H_
0008 #define KIS_TOOL_PAN_H_
0009 
0010 #include <kis_tool.h>
0011 #include <KoToolFactoryBase.h>
0012 
0013 class KisToolPan : public KisTool
0014 {
0015     Q_OBJECT
0016 public:
0017     KisToolPan(KoCanvasBase *canvas);
0018     ~KisToolPan() override;
0019 
0020     void beginPrimaryAction(KoPointerEvent *event) override;
0021     void continuePrimaryAction(KoPointerEvent *event) override;
0022     void endPrimaryAction(KoPointerEvent *event) override;
0023 
0024     void keyPressEvent(QKeyEvent *event) override;
0025 
0026     void paint(QPainter &painter, const KoViewConverter &converter) override;
0027 
0028     bool wantsAutoScroll() const override;
0029 
0030 private:
0031     QPoint m_lastPosition;
0032 };
0033 
0034 
0035 class KisToolPanFactory : public KoToolFactoryBase
0036 {
0037 public:
0038     KisToolPanFactory();
0039     ~KisToolPanFactory() override;
0040 
0041     KoToolBase *createTool(KoCanvasBase *canvas) override;
0042 };
0043 
0044 #endif // KIS_TOOL_PAN_H_