Scribus
Open source desktop publishing at your fingertips
canvasgesture_table.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_TABLE_H
10 #define CANVASGESTURE_TABLE_H
11 
12 #include <QList>
13 #include <QPoint>
14 
15 #include "canvasgesture.h"
16 #include "canvasmode.h"
17 
18 class PageItem_Table;
19 class QPainter;
20 class ScribusView;
21 
30 class SCRIBUS_API TableGesture : public CanvasGesture
31 {
32  Q_OBJECT
33 
34 public:
35  virtual ~TableGesture() {}
36 
37 protected:
38  explicit TableGesture(CanvasMode* parent) : CanvasGesture(parent->view()) {};
39  explicit TableGesture(ScribusView* view) : CanvasGesture(view) {};
40 
42  PageItem_Table* table() const { return m_table; }
43 
45  void setTable(PageItem_Table* table) { m_table = table; }
46 
52  QPointF globalToTableGrid(const QPoint point, bool snap = true);
53 
62  void paintTableOutline(const QList<double>& rowHeights, const QList<double>& rowPositions,
63  const QList<double>& columnWidths, const QList<double>& columnPositions, QPainter* p);
64 
68  void paintCellSelection(QPainter* p);
69 
70 private:
72  PageItem_Table* m_table;
73 };
74 
75 #endif // CANVASGESTURE_TABLE_H
PageItem_Table * table() const
Returns the currently edited table.
Definition: canvasgesture_table.h:42
Definition: canvasmode.h:72
Definition: canvasgesture.h:47
void setTable(PageItem_Table *table)
Sets the currently edited table to table.
Definition: canvasgesture_table.h:45
Definition: canvasgesture_table.h:30
Definition: scribusview.h:87
Definition: pageitem_table.h:49