#include <KoInteractionStrategy.h>
Graphe d'héritage de KoInteractionStrategy:
Fonctions membres publiques | |
virtual | ~KoInteractionStrategy () |
Destructor. | |
virtual void | paint (QPainter &painter, KoViewConverter &converter) |
virtual void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers)=0 |
virtual KCommand * | createCommand ()=0 |
void | cancelInteraction () |
virtual void | finishInteraction (Qt::KeyboardModifiers modifiers)=0 |
Fonctions membres publiques statiques | |
static KoInteractionStrategy * | createStrategy (KoPointerEvent *event, KoInteractionTool *parentTool, KoCanvasBase *canvas) |
Fonctions membres protégées | |
KoInteractionStrategy (KoTool *parent, KoCanvasBase *canvas) | |
protected constructor. Use the createStrategy method() | |
void | applyGrid (QPointF &point) |
Attributs protégés | |
KoTool * | m_parent |
the KoTool instance that controls this strategy. | |
KoSelectionSet | m_selectedShapes |
the objects this strategy will act on. | |
KoCanvasBase * | m_canvas |
the canvas which contains getters for document-data |
KoInteractionStrategy is a Strategy for the KoInteractionTool and it defines the behavior in case the user clicks or drags the mouse. 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).
Définition à la ligne 47 du fichier KoInteractionStrategy.h.
virtual KoInteractionStrategy::~KoInteractionStrategy | ( | ) | [inline, virtual] |
KoInteractionStrategy::KoInteractionStrategy | ( | KoTool * | parent, | |
KoCanvasBase * | canvas | |||
) | [protected] |
protected constructor. Use the createStrategy method()
Définition à la ligne 47 du fichier KoInteractionStrategy.cpp.
virtual void KoInteractionStrategy::paint | ( | QPainter & | painter, | |
KoViewConverter & | converter | |||
) | [inline, virtual] |
Reimplement this if the action needs to draw a "blob" on the canvas; that is, a transient decoration like a rubber band.
Réimplémentée dans KoShapeMoveStrategy, KoShapeResizeStrategy, KoShapeRotateStrategy, KoShapeRubberSelectStrategy, et KoShapeShearStrategy.
Définition à la ligne 57 du fichier KoInteractionStrategy.h.
Référencé par KoPathTool::paint(), KoInteractionTool::paint(), et KoCreateShapesTool::paint().
Voici le graphe d'appel pour cette fonction :
virtual void KoInteractionStrategy::handleMouseMove | ( | const QPointF & | mouseLocation, | |
Qt::KeyboardModifiers | modifiers | |||
) | [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. |
Implémenté dans KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoShapeMoveStrategy, KoShapeResizeStrategy, KoShapeRotateStrategy, KoShapeRubberSelectStrategy, et KoShapeShearStrategy.
Référencé par KoPathTool::keyPressEvent(), KoInteractionTool::keyPressEvent(), KoPathTool::keyReleaseEvent(), KoInteractionTool::keyReleaseEvent(), KoPathTool::mouseMoveEvent(), et KoInteractionTool::mouseMoveEvent().
Voici le graphe d'appel pour cette fonction :
virtual KCommand* KoInteractionStrategy::createCommand | ( | ) | [pure virtual] |
For interactions that are undo-able this method should be implemented to return such a command. Implementations should return 0 otherwise.
Implémenté dans KoCreateShapeStrategy, KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoShapeMoveStrategy, KoShapeResizeStrategy, KoShapeRotateStrategy, KoShapeRubberSelectStrategy, et KoShapeShearStrategy.
Référencé par cancelInteraction(), KoPathTool::mouseReleaseEvent(), et KoInteractionTool::mouseReleaseEvent().
Voici le graphe d'appel pour cette fonction :
void KoInteractionStrategy::cancelInteraction | ( | ) |
This method will undo frames based interactions by calling createCommand() and unexecuting that.
Définition à la ligne 39 du fichier KoInteractionStrategy.cpp.
Références createCommand().
Référencé par KoPathTool::keyPressEvent(), et KoInteractionTool::keyReleaseEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
virtual void KoInteractionStrategy::finishInteraction | ( | Qt::KeyboardModifiers | modifiers | ) | [pure virtual] |
Override to make final changes to the data on the end of an interaction.
Implémenté dans KoCreateShapeStrategy, KoParameterChangeStrategy, KoPathControlPointMoveStrategy, KoPathPointMoveStrategy, KoPathPointRubberSelectStrategy, KoShapeMoveStrategy, KoShapeResizeStrategy, KoShapeRotateStrategy, KoShapeRubberSelectStrategy, et KoShapeShearStrategy.
Référencé par KoPathTool::mouseReleaseEvent(), et KoInteractionTool::mouseReleaseEvent().
Voici le graphe d'appel pour cette fonction :
KoInteractionStrategy * KoInteractionStrategy::createStrategy | ( | KoPointerEvent * | event, | |
KoInteractionTool * | parentTool, | |||
KoCanvasBase * | canvas | |||
) | [static] |
This instanciates a new strategy object and decides which one created based on the params.
Définition à la ligne 54 du fichier KoInteractionStrategy.cpp.
Références KoFlake::BottomMiddleHandle, KoSelection::boundingRect(), KoPointerEvent::buttons(), KoSelection::deselect(), KoSelection::deselectAll(), KoInteractionTool::handleAt(), KoShape::isLocked(), KoSelection::isSelected(), KoShape::isVisible(), KoFlake::LeftMiddleHandle, KoPointerEvent::modifiers(), KoFlake::NextUnselected, KoFlake::NoHandle, KoPointerEvent::point, KoInteractionTool::repaintDecorations(), KoFlake::RightMiddleHandle, KoSelection::select(), KoSelection::selectedShapes(), KoShapeManager::selection(), KoShapeManager::shapeAt(), KoCanvasBase::shapeManager(), KoFlake::ShapeOnTop, et KoFlake::TopMiddleHandle.
Référencé par KoInteractionTool::mousePressEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
void KoInteractionStrategy::applyGrid | ( | QPointF & | point | ) | [protected] |
Apply the grid settings to the argument point.
point | this point will be changed to end up on the grid. |
Définition à la ligne 116 du fichier KoInteractionStrategy.cpp.
Références KoCanvasBase::gridSize(), et m_canvas.
Référencé par KoShapeResizeStrategy::handleMouseMove(), et KoShapeMoveStrategy::handleMouseMove().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
KoTool* KoInteractionStrategy::m_parent [protected] |
the KoTool instance that controls this strategy.
Définition à la ligne 98 du fichier KoInteractionStrategy.h.
Référencé par KoCreateShapeStrategy::createCommand(), et KoShapeRubberSelectStrategy::finishInteraction().
the objects this strategy will act on.
Définition à la ligne 99 du fichier KoInteractionStrategy.h.
Référencé par KoShapeShearStrategy::createCommand(), KoShapeRotateStrategy::createCommand(), KoShapeResizeStrategy::createCommand(), KoShapeMoveStrategy::createCommand(), KoShapeShearStrategy::handleMouseMove(), KoShapeRotateStrategy::handleMouseMove(), KoShapeResizeStrategy::handleMouseMove(), KoShapeMoveStrategy::handleMouseMove(), KoShapeMoveStrategy::KoShapeMoveStrategy(), KoShapeResizeStrategy::KoShapeResizeStrategy(), KoShapeRotateStrategy::KoShapeRotateStrategy(), et KoShapeShearStrategy::KoShapeShearStrategy().
KoCanvasBase* KoInteractionStrategy::m_canvas [protected] |
the canvas which contains getters for document-data
Définition à la ligne 100 du fichier KoInteractionStrategy.h.
Référencé par applyGrid(), KoCreateShapeStrategy::createCommand(), KoShapeRubberSelectStrategy::finishInteraction(), KoPathPointRubberSelectStrategy::finishInteraction(), KoCreateShapeStrategy::finishInteraction(), KoShapeShearStrategy::handleMouseMove(), KoShapeRubberSelectStrategy::handleMouseMove(), KoShapeRotateStrategy::handleMouseMove(), KoShapeResizeStrategy::handleMouseMove(), KoShapeMoveStrategy::handleMouseMove(), KoShapeShearStrategy::paint(), KoShapeRotateStrategy::paint(), KoShapeResizeStrategy::paint(), et KoShapeMoveStrategy::paint().