Scribus
Open source desktop publishing at your fingertips
canvasmode_editweldpoint.h
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  canvasmode_editweldpoint.h - description
17  -------------------
18  begin : Sun Okt 23 2011
19  copyright : (C) 2011 by Franz Schmid
20  email : Franz.Schmid@altmuehlnet.de
21  ***************************************************************************/
22 
23 #ifndef CANVASMODE_EDITWELDPOINT_H
24 #define CANVASMODE_EDITWELDPOINT_H
25 
26 #include <QObject>
27 #include <QTime>
28 
29 #include "canvasmode.h"
30 #include "fpointarray.h"
31 #include "ui/weldedit.h"
32 
33 class PageItem;
34 class PageItem_TextFrame;
35 class ScribusMainWindow;
36 class ScribusView;
37 
38 
39 // This class encapsulate the old code for mouse interaction from scribusview.cpp
40 
42 {
43  Q_OBJECT
44 public:
45  explicit CanvasMode_EditWeldPoint(ScribusView* view);
46  virtual ~CanvasMode_EditWeldPoint() {}
47 
48  virtual void enterEvent(QEvent *);
49  virtual void leaveEvent(QEvent *);
50 
51  virtual void activate(bool);
52  virtual void deactivate(bool);
53  virtual void mouseDoubleClickEvent(QMouseEvent *m);
54  virtual void mouseReleaseEvent(QMouseEvent *m);
55  virtual void mouseMoveEvent(QMouseEvent *m);
56  virtual void mousePressEvent(QMouseEvent *m);
57  virtual void keyPressEvent(QKeyEvent *e);
58  virtual bool handleKeyEvents() { return true; }
59  virtual void drawControls(QPainter* p);
60  void drawControlsWeldPoint(QPainter* pp, PageItem* currItem);
61 
62 private:
63  void snapToEdgePoints(double &x, double &y);
64  QRectF getUpdateRect();
65 
66  inline bool GetItem(PageItem** pi);
67 
68  double Mxp, Myp;
69  int selectedPoint;
70  ScribusMainWindow* m_ScMW;
71  bool m_keyRepeat;
72  PageItem *currItem;
73  QList<PageItem*> weldToList;
74  WeldEditDialog* ModeDialog;
75  bool editWeldMode;
76 private slots:
77  void endEditing(bool active);
78  void endEditing();
79  void setWeldMode();
80  void setObjectMode();
81 };
82 
83 #endif
Definition: pageitem_textframe.h:45
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
virtual void deactivate(bool)
Definition: canvasmode_editweldpoint.cpp:154
Definition: canvasmode.h:72
virtual void activate(bool)
Definition: canvasmode_editweldpoint.cpp:126
Definition: weldedit.h:39
Definition: canvasmode_editweldpoint.h:41
Definition: pageitem.h:92
virtual void drawControls(QPainter *p)
Definition: canvasmode_editweldpoint.cpp:79
Definition: scribusview.h:87