Scribus
Open source desktop publishing at your fingertips
canvasgesture_rowresize.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_ROWRESIZE_H
10 #define CANVASGESTURE_ROWRESIZE_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 RowResize : public TableGesture
30 {
31  Q_OBJECT
32 
33 public:
34  explicit RowResize(CanvasMode* parent) : TableGesture(parent), m_row(0) {}
35  virtual ~RowResize() {}
36 
37  virtual void activate(bool fromGesture) {};
38  virtual void deactivate(bool forGesture) {}
39  virtual void keyPressEvent(QKeyEvent* event);
40  virtual void keyReleaseEvent(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, int row);
48 
49 private:
55  double resizeRowMoveFollowing(double height);
56 
62  double resizeRowResizeFollowing(double height);
63 
64 private:
66  int m_row;
68  QList<double> m_rowHeights;
70  QList<double> m_rowPositions;
71 };
72 
73 #endif // CANVASGESTURE_ROWRESIZE_H
virtual void activate(bool fromGesture)
Definition: canvasgesture_rowresize.h:37
virtual void drawControls(QPainter *p)
Definition: canvasmode.h:121
virtual void deactivate(bool forGesture)
Definition: canvasgesture_rowresize.h:38
Definition: canvasmode.h:72
Definition: canvasgesture_rowresize.h:29
Definition: canvasgesture_table.h:30
Definition: pageitem_table.h:49