kspread
KSpread::Canvas Class Reference
The scrollable area showing the cells. More...
#include <Canvas.h>

Public Types | |
| enum | MouseActions { NoAction, Mark, ResizeCell, AutoFill, ResizeSelection } |
Public Slots | |
| void | setDocumentOffset (const QPoint &offset) |
| void | setDocumentSize (const QSizeF &size) |
Signals | |
| void | documentSizeChanged (const QSize &) |
Public Member Functions | |
| Canvas (View *view) | |
| ~Canvas () | |
| Sheet * | activeSheet () const |
| virtual void | addCommand (QUndoCommand *command) |
| virtual const QWidget * | canvasWidget () const |
| virtual QWidget * | canvasWidget () |
| Doc * | doc () const |
| virtual void | gridSize (qreal *horizontal, qreal *vertical) const |
| QPointF | offset () const |
| void | scrollToCell (const QPoint &location) const |
| KSpread::Selection * | selection () const |
| virtual KoShapeManager * | shapeManager () const |
| virtual bool | snapToGrid () const |
| virtual KoToolProxy * | toolProxy () const |
| virtual KoUnit | unit () const |
| virtual void | updateCanvas (const QRectF &rc) |
| virtual void | updateInputMethodInfo () |
| void | validateSelection () |
| View * | view () const |
| virtual const KoViewConverter * | viewConverter () const |
| QRect | visibleCells () const |
| double | xOffset () const |
| double | yOffset () const |
Protected Member Functions | |
| virtual void | dragEnterEvent (QDragEnterEvent *) |
| virtual void | dragLeaveEvent (QDragLeaveEvent *) |
| virtual void | dragMoveEvent (QDragMoveEvent *) |
| virtual void | dropEvent (QDropEvent *) |
| virtual void | focusInEvent (QFocusEvent *) |
| virtual void | focusOutEvent (QFocusEvent *) |
| bool | highlightRangeSizeGripAt (double x, double y) |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| virtual void | keyPressEvent (QKeyEvent *_ev) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *) |
| virtual void | mouseMoveEvent (QMouseEvent *_ev) |
| virtual void | mousePressEvent (QMouseEvent *_ev) |
| virtual void | mouseReleaseEvent (QMouseEvent *_ev) |
| virtual void | paintEvent (QPaintEvent *_ev) |
| virtual void | tabletEvent (QTabletEvent *e) |
Detailed Description
The scrollable area showing the cells.
Especially most of the user interface logic is implemented here. That means that this class knows what to do when a key is pressed or if the mouse button was clicked.
Definition at line 83 of file Canvas.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
| Canvas::Canvas | ( | View * | view | ) | [explicit] |
Definition at line 128 of file Canvas.cpp.
| Canvas::~Canvas | ( | ) |
Definition at line 161 of file Canvas.cpp.
Member Function Documentation
| Sheet * Canvas::activeSheet | ( | ) | const |
- Returns:
- a pointer to the active sheet
Definition at line 298 of file Canvas.cpp.
| void Canvas::addCommand | ( | QUndoCommand * | command | ) | [virtual] |
reimplemented method from KoCanvasBase
Definition at line 190 of file Canvas.cpp.
| virtual const QWidget* KSpread::Canvas::canvasWidget | ( | ) | const [inline, virtual] |
| virtual QWidget* KSpread::Canvas::canvasWidget | ( | ) | [inline, virtual] |
reimplemented method from KoCanvasBase
| Doc * Canvas::doc | ( | ) | const |
Definition at line 174 of file Canvas.cpp.
| void KSpread::Canvas::documentSizeChanged | ( | const QSize & | ) | [signal] |
| void Canvas::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 722 of file Canvas.cpp.
| void Canvas::dragLeaveEvent | ( | QDragLeaveEvent * | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 828 of file Canvas.cpp.
| void Canvas::dragMoveEvent | ( | QDragMoveEvent * | event | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 732 of file Canvas.cpp.
| void Canvas::dropEvent | ( | QDropEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 832 of file Canvas.cpp.
| void Canvas::focusInEvent | ( | QFocusEvent * | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 708 of file Canvas.cpp.
| void Canvas::focusOutEvent | ( | QFocusEvent * | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 716 of file Canvas.cpp.
| void Canvas::gridSize | ( | qreal * | horizontal, | |
| qreal * | vertical | |||
| ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 179 of file Canvas.cpp.
| bool Canvas::highlightRangeSizeGripAt | ( | double | x, | |
| double | y | |||
| ) | [protected] |
Checks to see if there is a size grip for a highlight range at a given position.
Note that both X and Y coordinates are UNZOOMED. To translate from a zoomed coordinate (eg. position of a mouse event) to an unzoomed coordinate, use Doc::unzoomItX and Doc::unzoomItY. The document object can be accessed via view()->doc()
- Parameters:
-
x Unzoomed x coordinate to check y Unzoomed y coordinate to check
- Returns:
trueif there is a size grip at the specified position,falseotherwise.
Definition at line 611 of file Canvas.cpp.
| void Canvas::inputMethodEvent | ( | QInputMethodEvent * | event | ) | [protected, virtual] |
reimplemented method from superclass
Reimplemented from QWidget.
Definition at line 605 of file Canvas.cpp.
| QVariant Canvas::inputMethodQuery | ( | Qt::InputMethodQuery | query | ) | const [protected, virtual] |
reimplemented method from superclass
Definition at line 599 of file Canvas.cpp.
| void Canvas::keyPressEvent | ( | QKeyEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 587 of file Canvas.cpp.
| void Canvas::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 581 of file Canvas.cpp.
| void Canvas::mouseMoveEvent | ( | QMouseEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 575 of file Canvas.cpp.
| void Canvas::mousePressEvent | ( | QMouseEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 551 of file Canvas.cpp.
| void Canvas::mouseReleaseEvent | ( | QMouseEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 569 of file Canvas.cpp.
| QPointF Canvas::offset | ( | ) | const |
Definition at line 222 of file Canvas.cpp.
| void Canvas::paintEvent | ( | QPaintEvent * | _ev | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 667 of file Canvas.cpp.
| void Canvas::scrollToCell | ( | const QPoint & | location | ) | const |
Makes sure a cell is visible onscreen by scrolling up/down and left/right.
- Parameters:
-
location the cell coordinates to scroll to
Definition at line 402 of file Canvas.cpp.
| Selection * Canvas::selection | ( | ) | const |
- Returns:
- the usual selection of cells
Definition at line 273 of file Canvas.cpp.
| void Canvas::setDocumentOffset | ( | const QPoint & | offset | ) | [slot] |
Definition at line 426 of file Canvas.cpp.
| void Canvas::setDocumentSize | ( | const QSizeF & | size | ) | [slot] |
Definition at line 435 of file Canvas.cpp.
| KoShapeManager * Canvas::shapeManager | ( | ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 195 of file Canvas.cpp.
| bool Canvas::snapToGrid | ( | ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 185 of file Canvas.cpp.
| void Canvas::tabletEvent | ( | QTabletEvent * | e | ) | [protected, virtual] |
reimplemented method from superclass
Reimplemented from QWidget.
Definition at line 593 of file Canvas.cpp.
| KoToolProxy * Canvas::toolProxy | ( | ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 217 of file Canvas.cpp.
| KoUnit Canvas::unit | ( | ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 212 of file Canvas.cpp.
| void Canvas::updateCanvas | ( | const QRectF & | rc | ) | [virtual] |
reimplemented method from KoCanvasBase
Definition at line 200 of file Canvas.cpp.
| void Canvas::updateInputMethodInfo | ( | ) | [virtual] |
reimplemented method from KoCanvasBase
Definition at line 1071 of file Canvas.cpp.
| void Canvas::validateSelection | ( | ) |
Validates the selected cell.
Definition at line 303 of file Canvas.cpp.
| View * Canvas::view | ( | ) | const |
Definition at line 169 of file Canvas.cpp.
| const KoViewConverter * Canvas::viewConverter | ( | ) | const [virtual] |
reimplemented method from KoCanvasBase
Definition at line 207 of file Canvas.cpp.
| QRect Canvas::visibleCells | ( | ) | const |
- Returns:
- a rect indicating which cell range is currently visible onscreen
Definition at line 949 of file Canvas.cpp.
| double Canvas::xOffset | ( | ) | const |
- Returns:
- the width of the columns before the current screen
Definition at line 227 of file Canvas.cpp.
| double Canvas::yOffset | ( | ) | const |
- Returns:
- the height of the rows before the current screen
Definition at line 232 of file Canvas.cpp.
The documentation for this class was generated from the following files:
