Scribus
Open source desktop publishing at your fingertips
canvasgesture_tableresize.h
1 /*
2 Copyright (C) 2011 Elvis Stansvik <elvstone@gmail.com>
3 
4 For general Scribus (>=1.3.2) copyright and licensing information please refer
5 to the COPYING file provided with the program. Following this notice may exist
6 a copyright and/or license notice that predates the release of Scribus 1.3.2
7 for which a new license (GPL+exception) is in place.
8 */
9 #ifndef CANVASGESTURE_TABLERESIZE_H
10 #define CANVASGESTURE_TABLERESIZE_H
11 
12 #include <QList>
13 
14 #include "canvasgesture_table.h"
15 
16 class CanvasMode;
17 class PageItem_Table;
18 class QMouseEvent;
19 class QKeyEvent;
20 class QPainter;
21 
29 class SCRIBUS_API TableResize : public TableGesture
30 {
31  Q_OBJECT
32 
33 public:
34  explicit TableResize(CanvasMode* parent) : TableGesture(parent),
35  m_minHeight(0.0), m_minWidth(0.0) {}
36  virtual ~TableResize() {}
37 
38  virtual void activate(bool fromGesture) {};
39  virtual void deactivate(bool forGesture) {}
40  virtual void keyPressEvent(QKeyEvent* event);
41  virtual void mouseReleaseEvent(QMouseEvent* event);
42  virtual void mouseMoveEvent(QMouseEvent* event);
43  virtual bool handleKeyEvents() { return true; }
44  virtual void drawControls(QPainter* p);
45 
47  void setup(PageItem_Table* table);
48 
49 private:
51  QList<double> m_rowHeights;
53  QList<double> m_rowPositions;
55  QList<double> m_columnWidths;
57  QList<double> m_columnPositions;
59  double m_minHeight;
61  double m_minWidth;
62 };
63 
64 #endif // CANVASGESTURE_TABLERESIZE_H
Definition: canvasgesture_tableresize.h:29
virtual void drawControls(QPainter *p)
Definition: canvasmode.h:121
Definition: canvasmode.h:72
virtual void activate(bool fromGesture)
Definition: canvasgesture_tableresize.h:38
Definition: canvasgesture_table.h:30
Definition: pageitem_table.h:49
virtual void deactivate(bool forGesture)
Definition: canvasgesture_tableresize.h:39