1 /* 2 For general Scribus (>=1.3.2) copyright and licensing information please refer 3 to the COPYING file provided with the program. Following this notice may exist 4 a copyright and/or license notice that predates the release of Scribus 1.3.2 5 for which a new license (GPL+exception) is in place. 6 */ 7 /*************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 16 #ifndef CANVASMODE_OBJIMPORT_H 17 #define CANVASMODE_OBJIMPORT_H 18 19 #include <QEvent> 20 #include <QMimeData> 21 #include <QMouseEvent> 22 #include <QObject> 23 #include <QPainter> 24 25 #include "canvasmode.h" 26 #include "fpointarray.h" 27 28 class QMimeData; 29 30 class PageItem; 31 class ScribusMainWindow; 32 class ScribusView; 33 class TransactionSettings; 34 35 // This class encapsulate the old code for mouse interaction from scribusview.cpp 36 37 class CanvasMode_ObjImport : public CanvasMode 38 { 39 Q_OBJECT 40 41 public: 42 explicit CanvasMode_ObjImport(ScribusView* view); 43 ~CanvasMode_ObjImport() override; 44 45 void setMimeData(QMimeData* mimeData); 46 void setTransactionSettings(TransactionSettings* settings); 47 48 void enterEvent(QEvent *) override; 49 void leaveEvent(QEvent *) override; 50 51 void activate(bool) override; 52 void deactivate(bool) override; 53 void keyPressEvent(QKeyEvent *e) override; 54 void keyReleaseEvent(QKeyEvent *e) override; 55 void mouseDoubleClickEvent(QMouseEvent *m) override; 56 void mouseReleaseEvent(QMouseEvent *m) override; 57 void mouseMoveEvent(QMouseEvent *m) override; 58 void mousePressEvent(QMouseEvent *m) override; 59 void drawControls(QPainter* p) override; 60 61 // protected: 62 // void setResizeCursor(int); 63 64 private: 65 QMimeData* m_mimeData {nullptr}; 66 TransactionSettings* m_trSettings {nullptr}; 67 double m_Mxp {-1.0}; 68 double m_Myp {-1.0}; 69 }; 70 71 72 #endif 73