QCAD
Open Source 2D CAD
|
Abstract base class for all action classes. More...
#include <RAction.h>
Public Types | |
enum | ClickMode { PickCoordinate, PickCoordinateNoSnap, PickEntity, PickingDisabled } |
Current mouse click mode. More... | |
Public Member Functions | |
virtual void | applyOperation ()=0 |
virtual void | beginEvent ()=0 |
Called as soon as the action is created (menu chosen, toolbutton activated, etc). More... | |
virtual void | commandEvent (RCommandEvent &event)=0 |
Called when a command is entered in the command line. More... | |
virtual void | commandEventPreview (RCommandEvent &event)=0 |
Called when a command is being edited in the command line. More... | |
virtual void | coordinateEvent (RCoordinateEvent &event)=0 |
Called for every coordinate event. More... | |
virtual void | coordinateEventPreview (RCoordinateEvent &event)=0 |
Called if the action is in PickCoordinate mode and the mouse is moved around. More... | |
virtual void | enterEvent ()=0 |
Called when user presses enter (e.g. More... | |
virtual void | entityPickEvent (REntityPickEvent &event)=0 |
virtual void | entityPickEventPreview (REntityPickEvent &event)=0 |
virtual void | escapeEvent ()=0 |
Escape events are triggered if the user clicks the right mouse button or hits the Escape key. More... | |
virtual void | finishEvent ()=0 |
Called just before the action is deleted. More... | |
RAction::ClickMode | getClickMode () |
RDocument * | getDocument () |
RDocumentInterface * | getDocumentInterface () |
QList< RGraphicsScene * > | getGraphicsScenes () |
virtual RGuiAction * | getGuiAction () |
RAction * | getOverrideBase () |
RStorage * | getStorage () |
QString | getUniqueGroup () |
bool | hasNoState () |
bool | isOverride () |
bool | isTerminated () |
virtual void | keyPressEvent (QKeyEvent &event)=0 |
virtual void | keyReleaseEvent (QKeyEvent &event)=0 |
virtual void | mouseDoubleClickEvent (RMouseEvent &event)=0 |
Called on mouse double click events. More... | |
virtual void | mouseMoveEvent (RMouseEvent &event)=0 |
Called on mouse move events. More... | |
virtual void | mousePressEvent (RMouseEvent &event)=0 |
Called on mouse press events. More... | |
virtual void | mouseReleaseEvent (RMouseEvent &event)=0 |
Called on mouse release events. More... | |
virtual void | panGestureEvent (QPanGesture &gesture)=0 |
Called on pan gesture events. More... | |
virtual void | pinchGestureEvent (QPinchGesture &gesture)=0 |
Called on pinch gesture events. More... | |
virtual void | propertyChangeEvent (RPropertyEvent &event)=0 |
Called when the value of a property is modified while this action is active. More... | |
RAction (RGuiAction *guiAction=NULL) | |
Copyright (c) 2011-2018 by Andrew Mustun. More... | |
virtual void | resumeEvent ()=0 |
Resumes the action (for example when another action became active and then terminated or if the mouse cursor enters the view). More... | |
void | setClickMode (RAction::ClickMode m) |
Sets the current click mode. More... | |
void | setDocumentInterface (RDocumentInterface *di) |
virtual void | setGraphicsView (RGraphicsView *view)=0 |
Called if this action is set as a navigation action of a graphics view. More... | |
void | setGuiAction (RGuiAction *guiAction) |
void | setNoState (bool on=true) |
void | setOverride () |
void | setOverrideBase (RAction *base) |
void | setUniqueGroup (const QString &ug) |
RVector | snap (RMouseEvent &event) |
Uses the currently active snap function to snap to the closest object or grid point. More... | |
virtual void | suspendEvent ()=0 |
Called when the action is suspended, for example when another action becomes active or the mouse cursor leaves the view. More... | |
virtual void | swipeGestureEvent (QSwipeGesture &gesture)=0 |
Called on swipe gesture events. More... | |
virtual void | tabletEvent (RTabletEvent &event)=0 |
Called on tablet events. More... | |
void | terminate () |
Terminates the action. More... | |
virtual void | updatePreview ()=0 |
virtual void | wheelEvent (RWheelEvent &event)=0 |
Called on mouse wheel events. More... | |
virtual void | zoomChangeEvent (RGraphicsView &view)=0 |
Called when the zoom factor or offset changed in the given view. More... | |
virtual | ~RAction () |
Protected Attributes | |
RAction::ClickMode | clickMode |
RDocumentInterface * | documentInterface |
RGuiAction * | guiAction |
bool | noState |
Indicates whether this action is stateless (i.e. More... | |
bool | override |
RAction * | overrideBase |
bool | terminated |
QString | uniqueGroup |
Abstract base class for all action classes.
Action classes handle user interaction with a document. A menu, toolbar button or command usually triggers an action.
enum RAction::ClickMode |
Current mouse click mode.
Enumerator | |
---|---|
PickCoordinate | Mouse click will pick a coordinate and trigger coordinateEvent. This is the default mode. |
PickCoordinateNoSnap | |
PickEntity | Mouse click will pick an entity and trigger entityPickEvent. |
PickingDisabled | Mouse click will not trigger any events except for mousePressEvent and mouseReleaseEvent. |
RAction::RAction | ( | RGuiAction * | guiAction = NULL | ) |
Copyright (c) 2011-2018 by Andrew Mustun.
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
|
virtual |
|
pure virtual |
Implemented in DrawPolyline, Leader, EAction, RActionAdapter, ClipboardOperation, Reverse, and Delete.
|
pure virtual |
Called as soon as the action is created (menu chosen, toolbutton activated, etc).
Implemented in EAction, Print, PropertyEditor, BlockList, AbstractPreferences, Dimension, RActionAdapter, LayerList, Projection, Stretch, InsertBlockItem, Information, InfoArcCircleArea, DefaultNavigation, Leader, ExRegisterFileExporter, ScMirrored, BreakOutManual, BreakOut, Nesting, DimRadial, Line, File, FlexPainter, Select, SnapCoordinate, DevDebug, Counter, CommandLine, Bevel, IsometricGridTop, Explode, FlipHorizontal, Scale, PanZoom, LibraryBrowser, CreateLibraryItem, DrawBasedOnRectanglePP, Image, ClipboardOperation, PolylineBreakSymbol, RestrictAngleLength, SnapDistance, ArcTPR, DimDiametric, DrawBasedOnRectangleSize, Shape, Layer, WindowZoom, CheckForUpdates, ToFront, Block, DefaultAction, LineOrthogonalTangent, DrawingPreferences, Esc, BitmapExport, RecentFiles, SvgImport, BrowseUserManual, FAQ, Forum, ReportBug, ReportTranslationError, ShowReadme, Website, MolImport, MenusAndToolBars, MyAction, PersistentWidgets, ToBack, FlipVertical, Modify, CommandLineFocus, DisplayDistanceAngle, OptionsToolBarFocus, ToolMatrixFocus, AutoZoom, PreviousView, ZoomIn, ZoomOut, ZoomToSelection, CloseAll, NextWindow, PreviousWindow, Arc2PR, DimAngular, DrawBasedOnThreeCircles, HatchFromSelection, Line2P, LineTangent2, LineDove, DrawPolyline, InfoPolylineArea, LineBoxJoint, Translate, SelectContour, SnapIntersectionManual, AntialiasingMode, DraftMode, Arc2PA, Arc2PH, Circle3T, Hatch, ExRegisterFileImporter, LineRadicalAxis, EditText, Offset, Rotate, Trim, Arc, Circle, Point, Polyline, Spline, Text, Edit, About, InfoDistanceEE, Misc, TextAlong, EditHatch, Rotate2, Snap, View, Zoom, Circle2P, Ellipse, EllipseInscribedQuad, Lengthen, Circle3P, Divide, SelectIntersectedEntities, SnapMiddleManual, SnapXManual, EditFromReference, Arc2PL, ArcTangential, Circle2PR, EllipseArcCPPA, LineRelativeAngle, ShapeRectanglePP, ImportFile, EditLayer, ExAddBlock, ExMandelbrot, Mirror, BlockInsert, LineAngle, LineFreehand, ShapePolygonCP, ShapePolygonPP, NewFile, InfoAngle, InfoDistanceEP, ExDrawColors, ExMathSpiral, EcmaScriptShell, PointPole, ArcCPA, Circle2TR, CircleCP, Point1P, ShapePolygonAFPP, InfoArea, InfoDistancePP, InfoPosition, ExXmlImport, BreakOutGap, OffsetThrough, SelectLayerByEntity, SnapDistanceManual, SnapYManual, CreateBlock, InsertBlock, InsertScriptItem, Arc3P, Circle2TP, DimAligned, LineTangent1, ShapePolygonAFCP, AddLayer, SelectLayer, ExLineDove, ExTransactionListener, BlockFixNames, DrawBoundingBox, SelectByColor, SnapCoordinatePolar, ToggleGrid, AddBlock, RenameBlock, LineVertical, SplineControlPoints, ConvertUnit, Delete, Duplicate, Paste, DeselectLayer, HideAllLayers, LockAllLayers, ShowAllLayers, ToggleLayerLock, ToggleLayerVisibility, UnlockAllLayers, ExThreePoints, ExDumpPolyline, ExXmlExport, ExDirListing, ExResizeWindow, Cross, ImportPoints, SelectByHandle, IsometricProjection, DeselectAll, SelectAll, SelectRectangle, LockRelativeZero, SetRelativeZero, DeselectBlockReferences, EditBlock, EditMainDrawing, HideAllBlocks, RemoveBlock, SelectBlockReferences, ShowAllBlocks, ToggleBlockVisibility, CircleT2P, DimOrdinate, DimRegen, DimRotated, LineBisector, LineHorizontal, Redo, Undo, OpenFile, Save, RemoveLayer, ShowActiveLayer, ExDrawFonts, ExText, ExAddLayer, ExLayerCustomProperty, ExMainWindow, ExProcess, ExWidget, BlockListAttributes, BlockListExport, RunScript, ModifyCorner, Reverse, TrimBoth, NestingQuantity, InvertSelection, RestrictHorizontal, RestrictOff, RestrictOrthogonal, RestrictVertical, SnapAuto, SnapCenter, SnapEnd, SnapFree, SnapGrid, SnapIntersection, SnapMiddle, SnapOnEntity, SnapPerpendicular, SnapReference, SnapSelectionCenter, SnapTangential, PrintCurrentView, ExDeleteObject, Reset, CloseFile, PdfExport, SaveAs, ChangeFontToArial, FlushBackLog, ReloadLinetypes, SplineToLine, ScPrepare, StatusBar, LinetypeMode, Batch2Pdf, ExMinimal, and ExMinimal2.
|
pure virtual |
Called when a command is entered in the command line.
Implemented in RActionAdapter.
|
pure virtual |
Called when a command is being edited in the command line.
Implemented in RActionAdapter.
|
pure virtual |
Called for every coordinate event.
Coordinate events can be the result of a mouse click or an entered coordinate from the command line. These events are fired after mouse click events in mode "PickCoordinate".
Implemented in RActionAdapter.
|
pure virtual |
Called if the action is in PickCoordinate
mode and the mouse is moved around.
Typically, some sort of preview is shown to the user to indicate what would happen if that coordinate would be picked.
Implemented in RActionAdapter.
|
pure virtual |
Called when user presses enter (e.g.
to show action dialog with options).
Implemented in EAction, RActionAdapter, and Nesting.
|
pure virtual |
Implemented in RActionAdapter.
|
pure virtual |
Implemented in RActionAdapter.
|
pure virtual |
Escape events are triggered if the user clicks the right mouse button or hits the Escape key.
The action is expected to go one step back, to the last state or terminate itself.
Implemented in DefaultAction, EAction, Projection, DrawPolyline, RActionAdapter, Stretch, Rotate, BreakOut, Mirror, DrawBasedOnThreeCircles, ModifyCorner, Leader, BreakOutManual, Offset, DimDiametric, DimRadial, Translate, Circle2PR, Trim, DrawBasedOnRectanglePP, Arc2PL, Line2P, Rotate2, ArcTPR, CircleT2P, LineTangent1, ShapePolygonCP, LineRadicalAxis, Scale, SelectIntersectedEntities, Arc2PA, DimAngular, LineRelativeAngle, ExLineDove, Divide, Arc3P, ArcTangential, Circle3T, ShapePolygonAFPP, InfoPosition, Nesting, SelectRectangle, Arc2PH, LineTangent2, ShapePolygonPP, InfoArea, EditFromReference, Circle2P, EllipseArcCPPA, ShapePolygonAFCP, SplineControlPoints, InfoDistancePP, OffsetThrough, Circle2TP, Circle3P, EllipseInscribedQuad, LineFreehand, PointPole, PolylineBreakSymbol, Lengthen, LineBisector, LineDove, Arc2PR, Circle2TR, DimAligned, DimOrdinate, DimRotated, LineOrthogonalTangent, ArcCPA, CircleCP, LineBoxJoint, and BreakOutGap.
|
pure virtual |
Called just before the action is deleted.
Implemented in PanZoom, WindowZoom, EAction, PropertyEditor, BlockList, RActionAdapter, DefaultNavigation, LayerList, InsertBlockItem, DrawBasedOnRectangleSize, CommandLine, Image, LibraryBrowser, IsometricGridTop, Transform, Snap, ImportFile, AntialiasingMode, DraftMode, LineBisector, EcmaScriptShell, InsertScriptItem, SnapIntersectionManual, ToggleGrid, LockRelativeZero, PrintCurrentView, and LinetypeMode.
|
inline |
RDocument * RAction::getDocument | ( | ) |
RDocumentInterface * RAction::getDocumentInterface | ( | ) |
QList< RGraphicsScene * > RAction::getGraphicsScenes | ( | ) |
|
virtual |
RAction * RAction::getOverrideBase | ( | ) |
RStorage * RAction::getStorage | ( | ) |
QString RAction::getUniqueGroup | ( | ) |
bool RAction::hasNoState | ( | ) |
bool RAction::isOverride | ( | ) |
bool RAction::isTerminated | ( | ) |
|
pure virtual |
Implemented in RActionAdapter.
|
pure virtual |
Implemented in RActionAdapter.
|
pure virtual |
Called on mouse double click events.
Implemented in RActionAdapter.
|
pure virtual |
Called on mouse move events.
Implemented in RNavigationAction, and RActionAdapter.
|
pure virtual |
Called on mouse press events.
Implemented in RNavigationAction, and RActionAdapter.
|
pure virtual |
Called on mouse release events.
Implemented in RNavigationAction, and RActionAdapter.
|
pure virtual |
Called on pan gesture events.
Implemented in RActionAdapter.
|
pure virtual |
Called on pinch gesture events.
Implemented in RActionAdapter.
|
pure virtual |
Called when the value of a property is modified while this action is active.
Implemented in RActionAdapter.
|
pure virtual |
Resumes the action (for example when another action became active and then terminated or if the mouse cursor enters the view).
Implemented in EAction, RActionAdapter, Information, DefaultAction, and CloseFile.
void RAction::setClickMode | ( | RAction::ClickMode | m | ) |
Sets the current click mode.
|
inline |
|
pure virtual |
Called if this action is set as a navigation action of a graphics view.
Implemented in RActionAdapter.
void RAction::setGuiAction | ( | RGuiAction * | guiAction | ) |
void RAction::setNoState | ( | bool | on = true | ) |
void RAction::setOverride | ( | ) |
void RAction::setOverrideBase | ( | RAction * | base | ) |
void RAction::setUniqueGroup | ( | const QString & | ug | ) |
RVector RAction::snap | ( | RMouseEvent & | event | ) |
Uses the currently active snap function to snap to the closest object or grid point.
|
pure virtual |
Called when the action is suspended, for example when another action becomes active or the mouse cursor leaves the view.
Implemented in EAction, RActionAdapter, and DefaultAction.
|
pure virtual |
Called on swipe gesture events.
Implemented in RActionAdapter.
|
pure virtual |
Called on tablet events.
Implemented in RActionAdapter.
void RAction::terminate | ( | ) |
Terminates the action.
The action object will be deleted after calling this method.
|
pure virtual |
Implemented in EAction, DrawBasedOnRectangleSize, and RActionAdapter.
|
pure virtual |
Called on mouse wheel events.
Implemented in RActionAdapter.
|
pure virtual |
Called when the zoom factor or offset changed in the given view.
Implemented in RActionAdapter.
|
protected |
|
protected |
|
protected |
|
protected |
Indicates whether this action is stateless (i.e.
terminates in beginEvent).
|
protected |
|
protected |
|
protected |
|
protected |