#include <KWCanvas.h>
Interaction policy defines the behavior in case the user clicks or drags the mouse.
The InteractionPolicy is created in the createPolicy() function which defines the resulting behavior and initiates a frame-move or a frame-resize, for example. The canvas forwards mouseMove events to the handleMouseMove() method and the interaction is either finished with finishInteraction() or cancelInteraction() (never both).
Definition at line 379 of file KWCanvas.h.
◆ InteractionPolicy()
| InteractionPolicy::InteractionPolicy |
( |
KWCanvas * | parent, |
|
|
bool | doInit = true, |
|
|
bool | includeInlineFrames = false ) |
|
protected |
Constructor.
- Parameters
-
| parent | the parent canvas. |
| doInit | if true this will initialize the m_frames and m_indexFrame variables. |
| includeInlineFrames | if true the m_frames will include inline frames |
Definition at line 2042 of file KWCanvas.cpp.
◆ cancelInteraction()
| void InteractionPolicy::cancelInteraction |
( |
| ) |
|
◆ createCommand()
| virtual KCommand * InteractionPolicy::createCommand |
( |
| ) |
|
|
pure virtual |
◆ createPolicy()
| InteractionPolicy * InteractionPolicy::createPolicy |
( |
KWCanvas * | parent, |
|
|
MouseMeaning | meaning, |
|
|
KoPoint & | point, |
|
|
TQt::ButtonState | buttonState, |
|
|
TQt::ButtonState | keyState ) |
|
static |
This instanciates a new policy object and decides which policy is created based on the params.
- Parameters
-
| parent | the parent canvas for things like redraw commands. |
| meaning | the mouseMeaning of as it is at 'point' |
| point | the place where the mouseDown is registred. |
| buttonState | which button is used to click, like TQt::LeftButton |
| keyState | which keys are held down at the click, like TQt::ControlButton |
Definition at line 2064 of file KWCanvas.cpp.
◆ finishInteraction()
| virtual void InteractionPolicy::finishInteraction |
( |
| ) |
|
|
pure virtual |
◆ gotDragEvents()
| bool InteractionPolicy::gotDragEvents |
( |
| ) |
|
|
inline |
◆ hadDragEvents()
| void InteractionPolicy::hadDragEvents |
( |
| ) |
|
|
inline |
◆ handleMouseMove()
| virtual void InteractionPolicy::handleMouseMove |
( |
TQt::ButtonState | keyState, |
|
|
const KoPoint & | point ) |
|
pure virtual |
Extending classes should implement this method to alter the frames or other data based on the new mouse position.
- Parameters
-
| keyState | the orred-data of the Shift/Alt/Control buttons being held down during the mousemove. |
| point | the new point where the mouse if at. This is in the document (pt-based) coordinate system. |
Implemented in FrameMovePolicy, FrameResizePolicy, and FrameSelectPolicy.
◆ m_frames
| TQValueList<KWFrame*> InteractionPolicy::m_frames |
|
protected |
◆ m_indexFrame
| TQValueList<FrameIndex> InteractionPolicy::m_indexFrame |
|
protected |
◆ m_parent
The documentation for this class was generated from the following files:
|