Scribus
Open source desktop publishing at your fingertips
canvasmode_measurements.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 
17 
18 #ifndef CANVAS_MODE_MEASUREMENTS_H
19 #define CANVAS_MODE_MEASUREMENTS_H
20 
21 #include <QObject>
22 #include "canvasmode.h"
23 #include "fpoint.h"
24 
25 class Measurements;
26 class ScribusMainWindow;
27 class ScribusView;
28 
29 
34 {
35  Q_OBJECT
36 
37 public:
38  explicit MeasurementsMode(ScribusView* view);
39  virtual ~MeasurementsMode() {}
40 
41  virtual void enterEvent(QEvent *);
42  virtual void leaveEvent(QEvent *);
43 
44  virtual void activate(bool);
45  virtual void deactivate(bool);
46  virtual void mouseReleaseEvent(QMouseEvent *m);
47  virtual void mouseMoveEvent(QMouseEvent *m);
48  virtual void mousePressEvent(QMouseEvent *m);
49  virtual void drawControls(QPainter* p);
50 
51 public slots:
52  void setActive(bool);
53 
54 private:
55  void adjustPoint(QPoint point);
56  void showValues();
57  bool m_active;
58  QPoint m_start;
59  QPoint m_current;
60  FPoint m_startDoc;
61  FPoint m_currentDoc;
62  Measurements* m_palette;
63 };
64 
65 
66 #endif
Definition: measurements.h:14
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
A point with floating point precision.
Definition: fpoint.h:43
Definition: canvasmode_measurements.h:33
virtual void activate(bool)
Definition: canvasmode_measurements.cpp:57
Definition: canvasmode.h:72
virtual void drawControls(QPainter *p)
Definition: canvasmode_measurements.cpp:67
virtual void deactivate(bool)
Definition: canvasmode_measurements.cpp:62
Definition: scribusview.h:87