QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RAction Class Reference

Abstract base class for all action classes. More...

#include <RAction.h>

Inheritance diagram for RAction:
RActionAdapter RScriptAction DefaultNavigation EAction RNavigationAction Block BlockExamples CommandLineExamples Cross DefaultAction Dimension Draw DrawBasedOnThreeCircles DrawExamples Edit File Help Information IOExamples LanguagePreferences Layer LayerExamples LineBoxJoint LineDove LineRadicalAxis ListenerExamples MathExamples Misc Modify ModifyExamples MyScripts PointPole QtExamples Reset ScMirrored Select SelectByHandle Snap SnapXManual SnapYManual SystemExamples TextPreferences ToolBarPreferences View Widgets Window

List of all members.

Public Types

enum  ClickMode { PickCoordinate, PickEntity, PickingDisabled }
 Current mouse click mode. More...

Public Member Functions

virtual void beginEvent ()=0
 Called as soon as the action is created (menu chosen, toolbutton activated, etc).
virtual void commandEvent (RCommandEvent &event)=0
 Called when a command is entered in the command line.
virtual void commandEventPreview (RCommandEvent &event)=0
 Called when a command is being edited in the command line.
virtual void coordinateEvent (RCoordinateEvent &event)=0
 Called for every coordinate event.
virtual void coordinateEventPreview (RCoordinateEvent &event)=0
 Called if the action is in PickCoordinate mode and the mouse is moved around.
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.
virtual void finishEvent ()=0
 Called just before the action is deleted.
RAction::ClickMode getClickMode ()
RDocumentgetDocument ()
RDocumentInterfacegetDocumentInterface ()
QList< RGraphicsScene * > getGraphicsScenes ()
virtual RGuiActiongetGuiAction ()
RActiongetOverrideBase ()
RStoragegetStorage ()
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.
virtual void mouseMoveEvent (RMouseEvent &event)=0
 Called on mouse move events.
virtual void mousePressEvent (RMouseEvent &event)=0
 Called on mouse press events.
virtual void mouseReleaseEvent (RMouseEvent &event)=0
 Called on mouse release events.
virtual void panGestureEvent (QPanGesture &gesture)=0
 Called on pan gesture events.
virtual void pinchGestureEvent (QPinchGesture &gesture)=0
 Called on pinch gesture events.
virtual void propertyChangeEvent (RPropertyEvent &event)=0
 Called when the value of a property is modified while this action is active.
 RAction (RGuiAction *guiAction=NULL)
 Copyright (c) 2011-2013 by Andrew Mustun.
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).
void setClickMode (RAction::ClickMode m)
 Sets the current click mode.
void setDocumentInterface (RDocumentInterface *di)
virtual void setGraphicsView (RGraphicsView *view)=0
 Called if this action is set as a navigation action of a graphics view.
void setGuiAction (RGuiAction *guiAction)
void setNoState ()
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.
virtual void suspendEvent ()=0
 Called with the action is Suspended, for example when another action becomes active or the mouse cursor leaves the view.
virtual void swipeGestureEvent (QSwipeGesture &gesture)=0
 Called on swipe gesture events.
virtual void tabletEvent (RTabletEvent &event)=0
 Called on tablet events.
void terminate ()
 Terminates the action.
virtual void wheelEvent (RWheelEvent &event)=0
 Called on mouse wheel events.
virtual ~RAction ()

Protected Attributes

RAction::ClickMode clickMode
RDocumentInterfacedocumentInterface
RGuiActionguiAction
bool noState
 Indicates whether this action is stateless (i.e.
bool override
RActionoverrideBase
bool terminated
QString uniqueGroup

Detailed Description

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.

Scriptable:
This class is wrapped for script environments.

Member Enumeration Documentation

Current mouse click mode.

Enumerator:
PickCoordinate 

Mouse click will pick a coordinate and trigger coordinateEvent.

This is the default mode.

PickEntity 

Mouse click will pick an entity and trigger entityPickEvent.

PickingDisabled 

Mouse click will not trigger any events except for mousePressEvent and mouseReleaseEvent.


Constructor & Destructor Documentation

RAction::RAction ( RGuiAction guiAction = NULL)

Copyright (c) 2011-2013 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.

RAction::~RAction ( )
virtual

Member Function Documentation

virtual void RAction::beginEvent ( )
pure virtual

Called as soon as the action is created (menu chosen, toolbutton activated, etc).

Implemented in EAction, PropertyEditor, Print, PrintPreview, AbstractPreferences, ScMirrored, RActionAdapter, Select, DefaultNavigation, Stretch, Information, NewFile, Dimension, Projection, SnapIntersectionManual, WindowZoom, DrawPolyline, InfoAngle, BreakOut, SnapDistanceManual, CommandLine, InfoArea, SelectContour, SelectIntersectedEntities, DimDiametric, DimRadial, Image, LibraryBrowser, About, InfoDistanceEP, DefaultAction, Line2PEx, Rotate2, Scale, SelectLayerByEntity, ClipboardOperation, BitmapExport, InfoPosition, Bevel, Modify, Rotate, PanZoom, Leader, CheckForUpdates, InfoDistancePP, Mirror, DeselectAll, InvertSelection, SelectAll, LockRelativeZero, SnapCoordinatePolar, SnapDistance, SnapMiddleManual, SnapXManual, SnapYManual, ToggleStatusBar, CreateBlock, CreateLibraryItem, DeselectBlockReferences, EditBlock, EditMainDrawing, HideAllBlocks, RemoveBlock, SelectBlockReferences, ShowAllBlocks, ToggleBlockVisibility, Text, DrawingPreferences, Esc, RecentFiles, SvgImport, BrowseAddOns, BrowseUserManual, FAQ, Forum, ReportBug, ReportTranslationError, ShowReadme, Website, DeselectLayer, SelectLayer, ShowActiveLayer, ToggleLayerVisibility, ExThreePoints, MolImport, MenusAndToolBars, MyAction, PersistentWidgets, Explode, ToBack, ToFront, RestrictHorizontal, RestrictOff, RestrictOrthogonal, RestrictVertical, SnapAuto, SnapCenter, SnapEnd, SnapFree, SnapGrid, SnapIntersection, SnapMiddle, SnapOnEntity, SnapPerpendicular, SnapReference, AutoZoom, CommandLineFocus, OptionsToolBarFocus, PreviousView, ZoomIn, ZoomOut, ZoomToSelection, CloseAll, NextWindow, PreviousWindow, Hatch, LineRectangleSize, Polyline, EditText, LinetypeMode, InsertBlockItem, Arc2PR, Circle2TR, Paste, Translate, IsometricProjection, Snap, InsertBlock, Arc, Arc2PA, Circle, DimAngular, Ellipse, Line, Point, Spline, ArcTangential, Circle2PR, Line2P, LineAngle, LineOrthogonalTangent, LineParallel, LineTangent2, SplineControlPoints, LineBoxJoint, ModifyCorner, Trim, BlockList, EllipseInscribedQuad, Divide, Lengthen, Circle3T, DrawBasedOnThreeCircles, LineParallelThrough, LineTangent1, LineRadicalAxis, PointPole, EditFromReference, Circle2TP, CircleT2P, LineBisector, LineFreehand, LineRelativeAngle, SelectRectangle, Arc3P, Circle2P, Circle3P, CircleCR, LineRectangle, ExAddBlock, LineDove, IsometricGridTop, ToggleGrid, BlockInsert, InsertScriptItem, ArcCPA, EllipseArcCPPA, LinePolygonCP, LinePolygonPP, ExFixBlockNames, ExDrawBoundingBox, ExDrawColors, ExMathSpiral, SelectByHandle, CircleCP, Delete, Save, ExImportPoints, Cross, Reverse, TrimBoth, LayerList, AddBlock, DimAligned, DimOrdinate, DimRegen, DimRotated, LineHorizontal, LineVertical, Point1P, Redo, Undo, OpenFile, SetRelativeZero, SnapCoordinate, CloseFile, PdfExport, AddLayer, HideAllLayers, ShowAllLayers, ExDumpPolyline, ExTransactionListener, ExResizeWindow, ExDirListing, BlockListExport, Reset, RenameBlock, SaveAs, EditLayer, RemoveLayer, ExText, ExLayerWhiteToBlack, ExChangeArcDirection, ExChangeFontToArial, ExMainWindow, and DraftMode.

virtual void RAction::commandEvent ( RCommandEvent event)
pure virtual

Called when a command is entered in the command line.

Implemented in RActionAdapter.

virtual void RAction::commandEventPreview ( RCommandEvent event)
pure virtual

Called when a command is being edited in the command line.

Implemented in RActionAdapter.

virtual void RAction::coordinateEvent ( RCoordinateEvent event)
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.

virtual void RAction::coordinateEventPreview ( RCoordinateEvent event)
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.

virtual void RAction::entityPickEvent ( REntityPickEvent event)
pure virtual

Implemented in RActionAdapter.

virtual void RAction::entityPickEventPreview ( REntityPickEvent event)
pure virtual

Implemented in RActionAdapter.

RAction::ClickMode RAction::getClickMode ( )
inline
Returns:
The current click mode of this action as previously requested by the action.
RDocument * RAction::getDocument ( )
Returns:
Pointer to the graphics document or NULL if no document is open.
RDocumentInterface * RAction::getDocumentInterface ( )
Returns:
Reference to the document interface that owns this action or NULL for actions that run on an application level (e.g. file - new).

Reimplemented in EAction.

QList< RGraphicsScene * > RAction::getGraphicsScenes ( )
Returns:
List of pointers to the graphics scenes which are attached to the document interface in which this action is active.
RGuiAction * RAction::getGuiAction ( )
virtual
Returns:
The GUI action which can be used to trigger this action or NULL.
RAction * RAction::getOverrideBase ( )
RStorage * RAction::getStorage ( )
Returns:
Pointer to the storage or NULL if no document is open.
QString RAction::getUniqueGroup ( )
bool RAction::hasNoState ( )
bool RAction::isOverride ( )
bool RAction::isTerminated ( )
Returns:
True if the action is terminated and can be deleted, false otherwise.
virtual void RAction::keyPressEvent ( QKeyEvent &  event)
pure virtual

Implemented in RActionAdapter.

virtual void RAction::keyReleaseEvent ( QKeyEvent &  event)
pure virtual

Implemented in RActionAdapter.

virtual void RAction::mouseDoubleClickEvent ( RMouseEvent event)
pure virtual

Called on mouse double click events.

Implemented in RActionAdapter.

virtual void RAction::mouseMoveEvent ( RMouseEvent event)
pure virtual

Called on mouse move events.

Implemented in RActionAdapter, and RNavigationAction.

virtual void RAction::mousePressEvent ( RMouseEvent event)
pure virtual

Called on mouse press events.

Implemented in RActionAdapter, and RNavigationAction.

virtual void RAction::mouseReleaseEvent ( RMouseEvent event)
pure virtual

Called on mouse release events.

Implemented in RActionAdapter, and RNavigationAction.

virtual void RAction::panGestureEvent ( QPanGesture &  gesture)
pure virtual

Called on pan gesture events.

Implemented in RActionAdapter.

virtual void RAction::pinchGestureEvent ( QPinchGesture &  gesture)
pure virtual

Called on pinch gesture events.

Implemented in RActionAdapter.

virtual void RAction::propertyChangeEvent ( RPropertyEvent event)
pure virtual

Called when the value of a property is modified while this action is active.

Implemented in RActionAdapter.

virtual void RAction::resumeEvent ( )
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)
inline

Sets the current click mode.

See also:
ClickMode
void RAction::setDocumentInterface ( RDocumentInterface di)
inline
virtual void RAction::setGraphicsView ( RGraphicsView view)
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 ( )
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.

virtual void RAction::suspendEvent ( )
pure virtual

Called with the action is Suspended, for example when another action becomes active or the mouse cursor leaves the view.

Implemented in EAction, PrintPreview, RActionAdapter, and DefaultAction.

virtual void RAction::swipeGestureEvent ( QSwipeGesture &  gesture)
pure virtual

Called on swipe gesture events.

Implemented in RActionAdapter.

virtual void RAction::tabletEvent ( RTabletEvent event)
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.

virtual void RAction::wheelEvent ( RWheelEvent event)
pure virtual

Called on mouse wheel events.

Implemented in RActionAdapter.


Member Data Documentation

RAction::ClickMode RAction::clickMode
protected
RDocumentInterface* RAction::documentInterface
protected
RGuiAction* RAction::guiAction
protected

Reimplemented in EAction.

bool RAction::noState
protected

Indicates whether this action is stateless (i.e.

terminates in beginEvent).

bool RAction::override
protected
RAction* RAction::overrideBase
protected
bool RAction::terminated
protected
QString RAction::uniqueGroup
protected

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