Scribus
Open source desktop publishing at your fingertips
|
#include <canvasmode.h>
Public Member Functions | |
virtual void | activate (bool fromGesture) |
virtual void | deactivate (bool forGesture) |
virtual void | enterEvent (QEvent *) |
virtual void | leaveEvent (QEvent *) |
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) |
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 () |
virtual CanvasMode * | delegate () |
ScribusView * | view () const |
Static Public Member Functions | |
static CanvasMode * | createForAppMode (ScribusView *view, int appMode) |
Protected Member Functions | |
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) |
Protected Attributes | |
ScribusView *const | m_view |
Canvas *const | m_canvas |
ScribusDoc *const | m_doc |
PanGesture * | m_panGesture |
UndoManager * | undoManager |
double | xSnap |
double | ySnap |
This class is a superclass for all mode handlers. By default, all events are ignored.
|
inlinevirtual |
Is called when this mode becomes active, either because it was selected by the user (fromgesture == false) or because a gesture completed and the canvas returns back to this mode (fromGesture == true)
Reimplemented in LineMove, RulerGesture, RectSelect, ResizeGesture, CanvasMode_EditArc, CanvasMode_EditMeshPatch, CanvasMode_EditPolygon, CanvasMode_EditSpiral, CanvasMode_EditWeldPoint, CanvasMode_EditMeshGradient, CanvasMode_FrameLinks, CanvasMode_Normal, CanvasMode_ObjImport, CanvasMode_Edit, CanvasMode_Magnifier, CanvasMode_Rotate, CreateMode, CanvasMode_EditGradient, MeasurementsMode, CanvasMode_Panning, CanvasMode_EditTable, BezierMode, CalligraphicMode, FreehandMode, CanvasMode_ImageImport, CellSelect, TableResize, CanvasMode_CopyProperties, CanvasMode_EyeDropper, ColumnResize, RowResize, CanvasMode_NodeEdit, and PanGesture.
|
protected |
If we have a doc and we are not changing the page or zoom level in the status bar
With no item selected we can:
With Tab, change active document windowActivated
Now if we have an item selected
|
inlinevirtual |
Is called when this mode becomes inactive, either because the canvas switches to another mode (forGesture == false) or because a gesture is activated (forGesture == true)
Reimplemented in LineMove, RulerGesture, RectSelect, ResizeGesture, CanvasMode_EditArc, CanvasMode_EditMeshPatch, CanvasMode_EditPolygon, CanvasMode_EditSpiral, CanvasMode_EditWeldPoint, CanvasMode_EditMeshGradient, CanvasMode_FrameLinks, CanvasMode_Normal, CanvasMode_ObjImport, CanvasMode_Edit, CanvasMode_Magnifier, CanvasMode_Rotate, CreateMode, CanvasMode_EditGradient, MeasurementsMode, CanvasMode_Panning, CanvasMode_EditTable, BezierMode, CalligraphicMode, FreehandMode, CanvasMode_ImageImport, CellSelect, TableResize, CanvasMode_CopyProperties, CanvasMode_EyeDropper, ColumnResize, RowResize, CanvasMode_NodeEdit, and PanGesture.
|
inlinevirtual |
main canvas modes dont have a delegate
Reimplemented in CanvasGesture.
|
inlinevirtual |
Draws the controls for this mode and the selection marker. If viewmode.drawSelectionWithControls is true, also draws the selection contents first.
Reimplemented in LineMove, RectSelect, RulerGesture, ResizeGesture, CanvasMode_EditMeshPatch, CanvasMode_EditWeldPoint, CanvasMode_EditMeshGradient, CanvasMode_Edit, CanvasMode_EditArc, CanvasMode_EditPolygon, CanvasMode_EditSpiral, CanvasMode_NodeEdit, CanvasMode_FrameLinks, CanvasMode_Normal, CanvasMode_ObjImport, CanvasMode_Magnifier, CreateMode, CanvasMode_EditGradient, CanvasMode_EditTable, CanvasMode_ImageImport, MeasurementsMode, BezierMode, CalligraphicMode, FreehandMode, CanvasMode_Panning, CellSelect, ColumnResize, RowResize, TableResize, CanvasMode_CopyProperties, CanvasMode_EyeDropper, CanvasMode_Rotate, and PanGesture.
void CanvasMode::drawOutline | ( | QPainter * | p, |
double | scalex = 1.0 , |
||
double | scaley = 1.0 , |
||
double | deltax = 0.0 , |
||
double | deltay = 0.0 |
||
) |
Draws an outline of selected items
void CanvasMode::drawSelection | ( | QPainter * | psx, |
bool | drawHandles | ||
) |
Draws the regular selection marker
void CanvasMode::drawSelectionHandles | ( | QPainter * | psx, |
QRectF | selectionRect, | ||
bool | background, | ||
bool | insideGroup = false , |
||
double | sx = 1.0 , |
||
double | sy = 1.0 |
||
) |
Draws the handles for the selection marker
void CanvasMode::drawSnapLine | ( | QPainter * | psx | ) |
Draws an outline of selected items
|
virtual |
Sets appropiate values for this canvas mode