#include <vtool.h>
The base class for all karbon tools.
Each tool has an icon, name and category. Basic mouse event and key handling is implemented here.
Definition at line 51 of file vtool.h.
◆ VTool()
| VTool::VTool |
( |
KarbonView * | view, |
|
|
const char * | name ) |
Constructs a new tool connected to the specified karbon view.
- Parameters
-
| view | the karbon view the tool is connected to |
| name | unused |
Definition at line 34 of file vtool.cpp.
◆ ~VTool()
Destroys the tool and unregisters it from the connected part.
Definition at line 44 of file vtool.cpp.
◆ accept()
| virtual void VTool::accept |
( |
| ) |
|
|
inlineprotectedvirtual |
Terminates the current tool drawing (if any).
This event is invoked when Enter/Return is pressed.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 265 of file vtool.h.
◆ action()
| TDERadioAction * VTool::action |
( |
| ) |
const |
|
inline |
Returns the tool's associated action object.
- Returns
- the associated action
Definition at line 151 of file vtool.h.
◆ activate
Called during the tool activation.
A tool is supposed to set a mouse cursor and/or the statusbar properly here.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 252 of file vtool.cpp.
◆ altPressed()
| bool VTool::altPressed |
( |
| ) |
const |
|
inlineprotected |
The status of the alt key.
- Returns
- true if key is pressed, else false
Definition at line 306 of file vtool.h.
◆ arrowKeyReleased()
| virtual void VTool::arrowKeyReleased |
( |
TQt::Key | | ) |
|
|
inlineprotectedvirtual |
"Arrow" key released up, down, left, right
Definition at line 245 of file vtool.h.
◆ cancel()
| virtual void VTool::cancel |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ cancelStep()
| virtual void VTool::cancelStep |
( |
| ) |
|
|
inlineprotectedvirtual |
Cancels the last tool step (if any).
This event is invoked when Backspace is pressed.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 260 of file vtool.h.
◆ contextHelp()
| virtual TQString VTool::contextHelp |
( |
| ) |
|
|
inlinevirtual |
◆ ctrlPressed()
| bool VTool::ctrlPressed |
( |
| ) |
const |
|
inlineprotected |
The status of the ctrl key.
- Returns
- true if key is pressed, else false
Definition at line 299 of file vtool.h.
◆ deactivate()
| virtual void VTool::deactivate |
( |
| ) |
|
|
inlinevirtual |
◆ draw() [1/2]
| virtual void VTool::draw |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ draw() [2/2]
| virtual void VTool::draw |
( |
VPainter * | painter | ) |
|
|
inlinevirtual |
Draws the actual tool state.
- Parameters
-
| painter | the painter on which to paint |
Definition at line 158 of file vtool.h.
◆ first()
| const KoPoint & VTool::first |
( |
| ) |
const |
|
inlineprotected |
Most tools need to know the first mouse coordinate.
Definition at line 280 of file vtool.h.
◆ icon()
The tool icon name.
Definition at line 119 of file vtool.h.
◆ isDragging()
| bool VTool::isDragging |
( |
| ) |
const |
|
inlineprotected |
Returns the current dagging state.
- Returns
- true if the mouse is currently dragged, else false
Definition at line 173 of file vtool.h.
◆ keyEvent()
| bool VTool::keyEvent |
( |
TQEvent * | event | ) |
|
This function processes every important key event.
It then calls suiting functions like mouseButtonPress() so deriving tools don't need to directly deal with events themselves.
Definition at line 148 of file vtool.cpp.
◆ keyReleased()
| virtual bool VTool::keyReleased |
( |
TQt::Key | | ) |
|
|
inlineprotectedvirtual |
Specified key released.
Definition at line 250 of file vtool.h.
◆ last()
| const KoPoint & VTool::last |
( |
| ) |
const |
|
inlineprotected |
The last mouse coordinate.
Definition at line 285 of file vtool.h.
◆ mouseButtonDblClick()
| virtual void VTool::mouseButtonDblClick |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseButtonPress()
| virtual void VTool::mouseButtonPress |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseButtonRelease()
| virtual void VTool::mouseButtonRelease |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDrag()
| virtual void VTool::mouseDrag |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDragCtrlPressed()
| virtual void VTool::mouseDragCtrlPressed |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDragCtrlReleased()
| virtual void VTool::mouseDragCtrlReleased |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDragRelease()
| virtual void VTool::mouseDragRelease |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDragShiftPressed()
| virtual void VTool::mouseDragShiftPressed |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseDragShiftReleased()
| virtual void VTool::mouseDragShiftReleased |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ mouseEvent()
| bool VTool::mouseEvent |
( |
TQMouseEvent * | event, |
|
|
const KoPoint & | canvasCoordinate ) |
This function processes every important mouse event.
It then calls suiting functions like mouseMoved() so deriving tools don't need to directly deal with events themselves.
Definition at line 72 of file vtool.cpp.
◆ mouseMove()
| virtual void VTool::mouseMove |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ priority()
| virtual uint VTool::priority |
( |
| ) |
|
|
inlinevirtual |
Position in toolbox.
Zero means no preferred position, other values indicate the true position.
Definition at line 114 of file vtool.h.
◆ refreshUnit()
| virtual void VTool::refreshUnit |
( |
| ) |
|
|
inlinevirtual |
This function is called when the documents unit setting were changed.
Definition at line 138 of file vtool.h.
◆ registerTool()
| void VTool::registerTool |
( |
VTool * | tool | ) |
|
|
virtual |
Registers the specified tool at the connected part.
Tools should register themselves by calling this function.
- Parameters
-
Definition at line 54 of file vtool.cpp.
◆ rightMouseButtonPress()
| virtual void VTool::rightMouseButtonPress |
( |
| ) |
|
|
inlineprotectedvirtual |
Right mouse button press.
Definition at line 190 of file vtool.h.
◆ rightMouseButtonRelease()
| virtual void VTool::rightMouseButtonRelease |
( |
| ) |
|
|
inlineprotectedvirtual |
Right mouse button release.
The mouse wasn't moved.
Reimplemented in VPolylineTool.
Definition at line 200 of file vtool.h.
◆ setCursor()
| virtual void VTool::setCursor |
( |
| ) |
const |
|
inlineprotectedvirtual |
This function is called on each mouse event the tool receives.
Definition at line 180 of file vtool.h.
◆ setup()
| virtual void VTool::setup |
( |
TDEActionCollection * | | ) |
|
|
inlinevirtual |
Called after tool creation.
A tool is supposed to hook its associated action into the specified action collection here.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 144 of file vtool.h.
◆ shiftPressed()
| bool VTool::shiftPressed |
( |
| ) |
const |
|
inlineprotected |
The status of the shift key.
- Returns
- true if key is pressed, else false
Definition at line 292 of file vtool.h.
◆ showDialog()
| virtual bool VTool::showDialog |
( |
| ) |
const |
|
inlinevirtual |
◆ statusText()
| virtual TQString VTool::statusText |
( |
| ) |
|
|
inlinevirtual |
The tool status text.
Definition at line 108 of file vtool.h.
◆ toolController()
| VToolController * VTool::toolController |
( |
| ) |
const |
|
protected |
Helper function.
Returns the parent view's toolcontroller.
Definition at line 60 of file vtool.cpp.
◆ toolType()
| virtual enumToolType VTool::toolType |
( |
| ) |
|
|
inlinevirtual |
◆ uiname()
| virtual TQString VTool::uiname |
( |
| ) |
|
|
inlinevirtual |
◆ view()
| KarbonView * VTool::view |
( |
| ) |
const |
|
protected |
Returns the connected karbon part.
Returns the connected karbon view.
Definition at line 66 of file vtool.cpp.
◆ m_action
| TDERadioAction* VTool::m_action |
|
protected |
The tool's action object.
Definition at line 309 of file vtool.h.
The documentation for this class was generated from the following files:
|