Scribus
Open source desktop publishing at your fingertips
TableGesture Class Reference

#include <canvasgesture_table.h>

Inheritance diagram for TableGesture:
Collaboration diagram for TableGesture:

Protected Member Functions

 TableGesture (CanvasMode *parent)
 
 TableGesture (ScribusView *view)
 
PageItem_Tabletable () const
 Returns the currently edited table.
 
void setTable (PageItem_Table *table)
 Sets the currently edited table to table.
 
QPointF globalToTableGrid (const QPoint point, bool snap=true)
 
void paintTableOutline (const QList< double > &rowHeights, const QList< double > &rowPositions, const QList< double > &columnWidths, const QList< double > &columnPositions, QPainter *p)
 
void paintCellSelection (QPainter *p)
 
- Protected Member Functions inherited from CanvasGesture
 CanvasGesture (CanvasMode *parent)
 
 CanvasGesture (ScribusView *view)
 
- Protected Member Functions inherited from CanvasMode
 CanvasMode (ScribusView *view)
 
void setResizeCursor (int how, double rot=0.0)
 
bool commonMouseMove (QMouseEvent *m)
 
void commonDrawControls (QPainter *p, bool drawHandles)
 
void commonDrawTextCursor (QPainter *p, PageItem_TextFrame *textframe, const QPointF &offset)
 Draws the text cursor for textframe, offset by offset.
 
void commonkeyPressEvent_NormalNodeEdit (QKeyEvent *e)
 
void commonkeyReleaseEvent (QKeyEvent *e)
 

Additional Inherited Members

- Public Member Functions inherited from CanvasGesture
virtual void enterEvent (QEvent *e)
 
virtual void leaveEvent (QEvent *e)
 
virtual void dragEnterEvent (QDragEnterEvent *e)
 
virtual void dragMoveEvent (QDragMoveEvent *e)
 
virtual void dragLeaveEvent (QDragLeaveEvent *e)
 
virtual void dropEvent (QDropEvent *e)
 
virtual void mouseDoubleClickEvent (QMouseEvent *m)
 
virtual void mouseReleaseEvent (QMouseEvent *m)
 
virtual void mouseMoveEvent (QMouseEvent *m)
 
virtual void mousePressEvent (QMouseEvent *m)
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void keyReleaseEvent (QKeyEvent *e)
 
virtual void inputMethodEvent (QInputMethodEvent *e)
 
CanvasModedelegate ()
 
void setDelegate (CanvasMode *delegate)
 
- Public Member Functions inherited from CanvasMode
virtual void activate (bool fromGesture)
 
virtual void deactivate (bool forGesture)
 
virtual bool handleKeyEvents ()
 
virtual void updateViewMode (CanvasViewMode *viewmode)
 
virtual void drawControls (QPainter *p)
 
void drawSelectionHandles (QPainter *psx, QRectF selectionRect, bool background, bool insideGroup=false, double sx=1.0, double sy=1.0)
 
void drawSelection (QPainter *psx, bool drawHandles)
 
void drawSnapLine (QPainter *psx)
 
void drawOutline (QPainter *p, double scalex=1.0, double scaley=1.0, double deltax=0.0, double deltay=0.0)
 
QCursor modeCursor ()
 
void setModeCursor ()
 
ScribusViewview () const
 
- Static Public Member Functions inherited from CanvasMode
static CanvasModecreateForAppMode (ScribusView *view, int appMode)
 
- Protected Attributes inherited from CanvasGesture
CanvasModem_delegate
 
- Protected Attributes inherited from CanvasMode
ScribusView *const m_view
 
Canvas *const m_canvas
 
ScribusDoc *const m_doc
 
PanGesturem_panGesture
 
UndoManagerundoManager
 
double xSnap
 
double ySnap
 

Detailed Description

Base class for table editing canvas gestures.

TableGesture is a base class for the gestures for table editing gestures used by the table editing canvas mode. It simply holds the currently edited table and provides some functions common to the table editing gestures. Apart from that it leaves everything else up to the subclasses.

Member Function Documentation

QPointF TableGesture::globalToTableGrid ( const QPoint  point,
bool  snap = true 
)
protected

Returns a copy of point, which is in global coordinates, mapped to coordinates on the table grid of the currently edited table. If snap is true, point is first snapped to the page grid and guides, in that order.

void TableGesture::paintCellSelection ( QPainter *  p)
protected

Paints the selection of the currently edited table.

void TableGesture::paintTableOutline ( const QList< double > &  rowHeights,
const QList< double > &  rowPositions,
const QList< double > &  columnWidths,
const QList< double > &  columnPositions,
QPainter *  p 
)
protected

Paints the outline of the currently edited table.

Instead of using row and column geometries of the table, they are taken from the parameters rowHeights, rowPositions, columnWidths and columnPositions. The size of these vectors must match the dimensions of the currently edited table, or the result of this function is undefined.

cellAt() and cellRect() are fast, stroking is not. So we paint the left and top edges of the cells in two passes as this allows us to greatly minimize the number of strokes.


The documentation for this class was generated from the following files: