#include <KoInteractionTool.h>
Graphe d'héritage de KoInteractionTool:
Connecteurs publics | |
void | activate (bool temporary=false) |
Signaux | |
void | sigActivateTool (const QString &id) |
void | sigActivateTemporary (const QString &id) |
void | sigDone () |
Fonctions membres publiques | |
KoInteractionTool (KoCanvasBase *canvas) | |
virtual | ~KoInteractionTool () |
virtual bool | wantsAutoScroll () |
virtual void | paint (QPainter &painter, KoViewConverter &converter) |
void | repaintDecorations () |
KoFlake::SelectionHandle | handleAt (const QPointF &point, bool *innerHandleMeaning=0) |
virtual void | mousePressEvent (KoPointerEvent *event) |
virtual void | mouseMoveEvent (KoPointerEvent *event) |
virtual void | mouseReleaseEvent (KoPointerEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
Attributs protégés | |
KoInteractionStrategy * | m_currentStrategy |
the strategy that is 'in progress' | |
Fonctions membres privées | |
void | recalcSelectionBox () |
void | updateCursor () |
KoInteractionTool (const KoInteractionTool &) | |
KoInteractionTool & | operator= (const KoInteractionTool &) |
QRectF | handlesSize () |
KoSelection * | selection () |
Attributs privés | |
KoFlake::SelectionHandle | m_lastHandle |
bool | m_mouseWasInsideHandles |
QPointF | m_selectionBox [8] |
QPolygonF | m_selectionOutline |
QPointF | m_lastPoint |
KoShapeMoveCommand * | m_moveCommand |
QTime | m_lastUsedMoveCommand |
QCursor | m_sizeCursors [8] |
QCursor | m_rotateCursors [8] |
QCursor | m_shearCursors [8] |
double | m_angle |
Note that the implementation of those different strategies are delegated to the InteractionStrategy class and its subclasses.
Définition à la ligne 48 du fichier KoInteractionTool.h.
KoInteractionTool::KoInteractionTool | ( | KoCanvasBase * | canvas | ) |
Constructor for basic interaction tool where user actions are translated and handled by interaction strategies of type KoInteractionStrategy.
canvas | the canvas this tool will be working for. |
Définition à la ligne 45 du fichier KoInteractionTool.cpp.
Références m_rotateCursors, m_shearCursors, et m_sizeCursors.
KoInteractionTool::~KoInteractionTool | ( | ) | [virtual] |
Définition à la ligne 92 du fichier KoInteractionTool.cpp.
Références m_currentStrategy, et m_moveCommand.
KoInteractionTool::KoInteractionTool | ( | const KoInteractionTool & | ) | [private] |
bool KoInteractionTool::wantsAutoScroll | ( | ) | [virtual] |
Return if dragging (moving with the mouse down) to the edge of a canvas should scroll the canvas (default is true).
Réimplémentée à partir de KoTool.
Définition à la ligne 98 du fichier KoInteractionTool.cpp.
void KoInteractionTool::paint | ( | QPainter & | painter, | |
KoViewConverter & | converter | |||
) | [virtual] |
Called by the canvas to paint any decorations that the tool deems needed. The painter has the top left of the canvas as its origin.
painter | used for painting the shape | |
converter | to convert between internal and view coordinates. |
Implémente KoTool.
Réimplémentée dans KoCreateShapesTool.
Définition à la ligne 188 du fichier KoInteractionTool.cpp.
Références m_currentStrategy, m_lastHandle, m_mouseWasInsideHandles, KoFlake::NoHandle, SelectionDecorator::paint(), KoInteractionStrategy::paint(), selection(), et SelectionDecorator::setSelection().
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::repaintDecorations | ( | ) | [virtual] |
request a repaint of the decorations to be made. This triggers an update call on the canvas, but does not paint directly.
Réimplémentée à partir de KoTool.
Définition à la ligne 328 du fichier KoInteractionTool.cpp.
Références handlesSize(), KoTool::m_canvas, selection(), et KoCanvasBase::updateCanvas().
Référencé par activate(), KoInteractionStrategy::createStrategy(), mouseMoveEvent(), MoveTool::mousePressEvent(), et mouseReleaseEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
KoFlake::SelectionHandle KoInteractionTool::handleAt | ( | const QPointF & | point, | |
bool * | innerHandleMeaning = 0 | |||
) |
Returns which selection handle is at params point (or NoHandle if none).
point | the location (in pt) where we should look for a handle | |
innerHandleMeaning | this boolean is altered to true if the point is inside the selection rectangle and false if it is just outside. The value of innerHandleMeaning is undefined if the handle location is NoHandle |
Définition à la ligne 337 du fichier KoInteractionTool.cpp.
Références KoFlake::BottomLeftHandle, KoFlake::BottomMiddleHandle, KoFlake::BottomRightHandle, KoViewConverter::documentToView(), HANDLE_DISTANCE, KoFlake::LeftMiddleHandle, KoTool::m_canvas, m_selectionBox, m_selectionOutline, KoFlake::NoHandle, recalcSelectionBox(), KoFlake::RightMiddleHandle, selection(), KoFlake::TopLeftHandle, KoFlake::TopMiddleHandle, KoFlake::TopRightHandle, et KoCanvasBase::viewConverter().
Référencé par KoInteractionStrategy::createStrategy(), et mouseMoveEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::activate | ( | bool | temporary = false |
) | [virtual, slot] |
This method is called when this tool instance is activated. For any main window there is only one tool active at a time, which then gets all user input. Switching between tools will call deactivate on one and activate on the new tool allowing the tool to flush items (like a selection) when it is not in use.
There is one case where two tools are activated at the same. This is the case where one tool delegates work to another temporarily. For example, while shift is being held down. The second tool will get activated with temporary=true and it should emit sigDone() when the state that activated it is ended.
One of the important tasks of activate is to call useCursor()
temporary | if true, this tool is only temporarily actived and should emit sigDone when it is done. |
Réimplémentée à partir de KoTool.
Définition à la ligne 408 du fichier KoInteractionTool.cpp.
Références m_lastHandle, m_mouseWasInsideHandles, KoFlake::NoHandle, repaintDecorations(), et KoTool::useCursor().
void KoInteractionTool::mousePressEvent | ( | KoPointerEvent * | event | ) | [virtual] |
Called when (one of) the mouse or stylus buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
event | state and reason of this mouse or stylus press |
Implémente KoTool.
Réimplémentée dans MoveTool.
Définition à la ligne 199 du fichier KoInteractionTool.cpp.
Références KoInteractionStrategy::createStrategy(), KoTool::m_canvas, m_currentStrategy, m_moveCommand, et updateCursor().
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::mouseMoveEvent | ( | KoPointerEvent * | event | ) | [virtual] |
Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
event | state and reason of this mouse or stylus move |
Implémente KoTool.
Réimplémentée dans MoveTool.
Définition à la ligne 206 du fichier KoInteractionTool.cpp.
Références handleAt(), KoInteractionStrategy::handleMouseMove(), handlesSize(), KoPointerEvent::ignore(), m_currentStrategy, m_lastHandle, m_lastPoint, m_mouseWasInsideHandles, KoPointerEvent::modifiers(), KoFlake::NoHandle, KoPointerEvent::point, repaintDecorations(), selection(), et updateCursor().
Référencé par MoveTool::mouseMoveEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::mouseReleaseEvent | ( | KoPointerEvent * | event | ) | [virtual] |
Called when (one of) the mouse or stylus buttons is released. Implementors should call event->ignore() if they do not actually use the event.
event | state and reason of this mouse or stylus release |
Implémente KoTool.
Réimplémentée dans KoCreateShapesTool.
Définition à la ligne 242 du fichier KoInteractionTool.cpp.
Références KoCanvasBase::addCommand(), KoInteractionStrategy::createCommand(), KoInteractionStrategy::finishInteraction(), KoPointerEvent::ignore(), KoTool::m_canvas, m_currentStrategy, KoPointerEvent::modifiers(), repaintDecorations(), et updateCursor().
Référencé par KoCreateShapesTool::mouseReleaseEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::keyPressEvent | ( | QKeyEvent * | event | ) | [virtual] |
Called when a key is pressed. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
event | state and reason of this key press |
Réimplémentée à partir de KoTool.
Définition à la ligne 259 du fichier KoInteractionTool.cpp.
Références KoCanvasBase::addCommand(), KoShapeMoveCommand::execute(), KoInteractionStrategy::handleMouseMove(), KoShape::isLocked(), KoTool::m_canvas, m_currentStrategy, m_lastPoint, m_lastUsedMoveCommand, m_moveCommand, selection(), KoShapeMoveCommand::setNewPositions(), et KoFlake::StrippedSelection.
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::keyReleaseEvent | ( | QKeyEvent * | event | ) | [virtual] |
Called when a key is released Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
event | state and reason of this key release |
Réimplémentée à partir de KoTool.
Définition à la ligne 312 du fichier KoInteractionTool.cpp.
Références KoInteractionStrategy::cancelInteraction(), KoInteractionStrategy::handleMouseMove(), m_currentStrategy, et m_lastPoint.
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::sigActivateTool | ( | const QString & | id | ) | [signal] |
void KoInteractionTool::sigActivateTemporary | ( | const QString & | id | ) | [signal] |
Emitted when this tool wants itself to temporarily be replaced by another tool. For instance, a paint tool could desire to be temporarily replaced by a pan tool which could be temporarily replaced by a colorpicker.
id | the identification of the desired tool |
Réimplémentée à partir de KoTool.
void KoInteractionTool::sigDone | ( | ) | [signal] |
Emitted when the tool has been temporarily activated and wants to notify the world that it's done.
Réimplémentée à partir de KoTool.
void KoInteractionTool::recalcSelectionBox | ( | ) | [private] |
Définition à la ligne 381 du fichier KoInteractionTool.cpp.
Références KoFlake::BottomLeftHandle, KoFlake::BottomMiddleHandle, KoFlake::BottomRightHandle, KoSelection::firstSelectedShape(), KoFlake::LeftMiddleHandle, m_angle, m_selectionBox, m_selectionOutline, KoFlake::RightMiddleHandle, KoShape::rotation(), selection(), testguiform::size, KoFlake::TopLeftHandle, KoFlake::TopMiddleHandle, KoFlake::TopRightHandle, et KoShape::transformationMatrix().
Référencé par handleAt().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
void KoInteractionTool::updateCursor | ( | ) | [private] |
Définition à la ligne 103 du fichier KoInteractionTool.cpp.
Références KoFlake::BottomLeftHandle, KoFlake::BottomMiddleHandle, KoFlake::BottomRightHandle, KoSelection::firstSelectedShape(), Py::int, KoShape::isLocked(), KoFlake::LeftMiddleHandle, m_angle, m_lastHandle, m_mouseWasInsideHandles, m_rotateCursors, m_shearCursors, m_sizeCursors, KoFlake::NoHandle, KoFlake::RightMiddleHandle, KoShape::rotation(), selection(), KoFlake::StrippedSelection, KoFlake::TopLeftHandle, KoFlake::TopMiddleHandle, KoFlake::TopRightHandle, et KoTool::useCursor().
Référencé par mouseMoveEvent(), mousePressEvent(), et mouseReleaseEvent().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
KoInteractionTool& KoInteractionTool::operator= | ( | const KoInteractionTool & | ) | [private] |
QRectF KoInteractionTool::handlesSize | ( | ) | [private] |
Définition à la ligne 234 du fichier KoInteractionTool.cpp.
Références KoSelection::boundingRect(), HANDLE_DISTANCE, KoTool::m_canvas, selection(), KoCanvasBase::viewConverter(), et KoViewConverter::viewToDocument().
Référencé par mouseMoveEvent(), et repaintDecorations().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
KoSelection * KoInteractionTool::selection | ( | ) | [private] |
Définition à la ligne 333 du fichier KoInteractionTool.cpp.
Références KoTool::m_canvas, KoShapeManager::selection(), et KoCanvasBase::shapeManager().
Référencé par handleAt(), handlesSize(), keyPressEvent(), mouseMoveEvent(), paint(), recalcSelectionBox(), repaintDecorations(), et updateCursor().
Voici le graphe d'appel pour cette fonction :
Voici le graphe d'appel pour cette fonction :
the strategy that is 'in progress'
Définition à la ligne 95 du fichier KoInteractionTool.h.
Référencé par keyPressEvent(), keyReleaseEvent(), mouseMoveEvent(), MoveTool::mousePressEvent(), mousePressEvent(), mouseReleaseEvent(), paint(), KoCreateShapesTool::paint(), et ~KoInteractionTool().
Définition à la ligne 108 du fichier KoInteractionTool.h.
Référencé par activate(), mouseMoveEvent(), paint(), et updateCursor().
bool KoInteractionTool::m_mouseWasInsideHandles [private] |
Définition à la ligne 109 du fichier KoInteractionTool.h.
Référencé par activate(), mouseMoveEvent(), paint(), et updateCursor().
QPointF KoInteractionTool::m_selectionBox[8] [private] |
Définition à la ligne 110 du fichier KoInteractionTool.h.
Référencé par handleAt(), et recalcSelectionBox().
QPolygonF KoInteractionTool::m_selectionOutline [private] |
Définition à la ligne 111 du fichier KoInteractionTool.h.
Référencé par handleAt(), et recalcSelectionBox().
QPointF KoInteractionTool::m_lastPoint [private] |
Définition à la ligne 112 du fichier KoInteractionTool.h.
Référencé par keyPressEvent(), keyReleaseEvent(), et mouseMoveEvent().
Définition à la ligne 113 du fichier KoInteractionTool.h.
Référencé par keyPressEvent(), mousePressEvent(), et ~KoInteractionTool().
QTime KoInteractionTool::m_lastUsedMoveCommand [private] |
QCursor KoInteractionTool::m_sizeCursors[8] [private] |
Définition à la ligne 117 du fichier KoInteractionTool.h.
Référencé par KoInteractionTool(), et updateCursor().
QCursor KoInteractionTool::m_rotateCursors[8] [private] |
Définition à la ligne 118 du fichier KoInteractionTool.h.
Référencé par KoInteractionTool(), et updateCursor().
QCursor KoInteractionTool::m_shearCursors[8] [private] |
Définition à la ligne 119 du fichier KoInteractionTool.h.
Référencé par KoInteractionTool(), et updateCursor().
double KoInteractionTool::m_angle [private] |
Définition à la ligne 120 du fichier KoInteractionTool.h.
Référencé par recalcSelectionBox(), et updateCursor().