|
Krita Source Code Documentation
|
#include <KoInteractionStrategy.h>
Inheritance diagram for KoInteractionStrategy:Public Member Functions | |
| virtual void | cancelInteraction () |
| virtual KUndo2Command * | createCommand ()=0 |
| virtual void | finishInteraction (Qt::KeyboardModifiers modifiers)=0 |
| virtual void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers)=0 |
| KoInteractionStrategy (KoToolBase *parent) | |
| constructor | |
| virtual void | paint (QPainter &painter, const KoViewConverter &converter) |
| KoToolBase * | tool () const |
| virtual | ~KoInteractionStrategy () |
| Destructor. | |
Protected Member Functions | |
| uint | decorationThickness () const |
| uint | grabSensitivity () const |
| Convenience function to get the global grab sensitivity. | |
| uint | handleRadius () const |
| Convenience function to get the global handle radius. | |
| KoInteractionStrategy (KoInteractionStrategyPrivate &) | |
| constructor | |
Protected Attributes | |
| KoInteractionStrategyPrivate * | d_ptr |
Abstract interface to define what actions a KoInteractionTool can do based on the Strategy design pattern. e.g, move, select, transform.
KoInteractionStrategy is a Strategy baseclass for the KoInteractionTool and it defines the behavior in case the user clicks or drags the input device. The strategy is created in the createPolicy() function which defines the resulting behavior and initiates a move or a resize, for example. The mouseMove events are forwarded to the handleMouseMove() method and the interaction is either finished with finishInteraction() or cancelInteraction() (never both).
Definition at line 37 of file KoInteractionStrategy.h.
|
explicit |
constructor
Definition at line 17 of file KoInteractionStrategy.cpp.
|
virtual |
|
protected |
|
virtual |
This method will undo frames based interactions by calling createCommand() and unexecuting that.
Reimplemented in KoPathPointRubberSelectStrategy, KoZoomStrategy, SelectionInteractionStrategy, SvgCreateTextStrategy, SvgInlineSizeChangeStrategy, SvgMoveTextStrategy, and SvgSelectTextStrategy.
Definition at line 22 of file KoInteractionStrategy.cpp.
References createCommand(), KUndo2Command::redo(), and KUndo2Command::undo().
|
pure virtual |
For interactions that are undo-able this method should be implemented to return such a command. Implementations should return 0 otherwise.
Implemented in KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoPathSegmentChangeStrategy, KoShapeRubberSelectStrategy, NopInteractionStrategy, ShapeGradientEditStrategy, ShapeMeshGradientEditStrategy, ShapeMoveStrategy, ShapeResizeStrategy, ShapeRotateStrategy, ShapeShearStrategy, SvgCreateTextStrategy, SvgInlineSizeChangeStrategy, SvgMoveTextStrategy, and SvgSelectTextStrategy.
|
protected |
Definition at line 57 of file KoInteractionStrategy.cpp.
References KoToolBase::canvas(), KoCanvasBase::resourceManager, and tool().
|
pure virtual |
Override to make final changes to the data on the end of an interaction.
Implemented in KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoPathPointRubberSelectStrategy, KoPathSegmentChangeStrategy, KoZoomStrategy, ShapeGradientEditStrategy, ShapeMeshGradientEditStrategy, ShapeMoveStrategy, ShapeResizeStrategy, ShapeRotateStrategy, ShapeShearStrategy, SvgCreateTextStrategy, SvgInlineSizeChangeStrategy, SvgMoveTextStrategy, SvgSelectTextStrategy, SelectionInteractionStrategy, and NopInteractionStrategy.
|
protected |
Convenience function to get the global grab sensitivity.
Definition at line 62 of file KoInteractionStrategy.cpp.
References KoToolBase::canvas(), KoCanvasBase::shapeController, and tool().
|
pure virtual |
Extending classes should implement this method to update the selectedShapes based on the new mouse position.
| mouseLocation | the new location in pt |
| modifiers | OR-ed set of keys pressed. |
Implemented in NopInteractionStrategy, KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoPathSegmentChangeStrategy, KoShapeRubberSelectStrategy, ShapeGradientEditStrategy, ShapeMeshGradientEditStrategy, ShapeMoveStrategy, ShapeResizeStrategy, ShapeRotateStrategy, ShapeShearStrategy, SvgCreateTextStrategy, SvgInlineSizeChangeStrategy, SvgMoveTextStrategy, SvgSelectTextStrategy, and KoPathPointRubberSelectStrategy.
|
protected |
Convenience function to get the global handle radius.
Definition at line 52 of file KoInteractionStrategy.cpp.
References KoToolBase::canvas(), KoCanvasBase::resourceManager, and tool().
|
virtual |
Reimplement this if the action needs to draw a "blob" on the canvas; that is, a transient decoration like a rubber band.
Reimplemented in KoShapeRubberSelectStrategy, NopInteractionStrategy, SelectionInteractionStrategy, ShapeGradientEditStrategy, ShapeMoveStrategy, ShapeResizeStrategy, ShapeRotateStrategy, ShapeShearStrategy, and SvgCreateTextStrategy.
Definition at line 42 of file KoInteractionStrategy.cpp.
| KoToolBase * KoInteractionStrategy::tool | ( | ) | const |
Definition at line 46 of file KoInteractionStrategy.cpp.
|
protected |
Definition at line 80 of file KoInteractionStrategy.h.