karbon
VTool Class Reference#include <vtool.h>
List of all members.
Detailed Description
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.
Constructor & Destructor Documentation
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.cc.
VTool::~VTool |
( |
|
) |
[virtual] |
Destroys the tool and unregisters it from the connected part.
Definition at line 44 of file vtool.cc.
Member Function Documentation
void VTool::registerTool |
( |
VTool * |
tool |
) |
[virtual] |
Registers the specified tool at the connected part.
Tools should register themselves by calling this function.
- Parameters:
-
| tool | the tool to register |
Definition at line 54 of file vtool.cc.
virtual void VTool::deactivate |
( |
|
) |
[inline, virtual] |
virtual bool VTool::showDialog |
( |
|
) |
const [inline, virtual] |
virtual QString VTool::uiname |
( |
|
) |
[inline, virtual] |
virtual QString VTool::contextHelp |
( |
|
) |
[inline, virtual] |
virtual enumToolType VTool::toolType |
( |
|
) |
[inline, virtual] |
virtual QString VTool::statusText |
( |
|
) |
[inline, virtual] |
The tool status text.
Definition at line 107 of file vtool.h.
virtual uint VTool::priority |
( |
|
) |
[inline, virtual] |
Position in toolbox.
Zero means no preferred position, other values indicate the true position.
Definition at line 113 of file vtool.h.
QString VTool::icon |
( |
|
) |
[inline] |
The tool icon name.
Definition at line 118 of file vtool.h.
bool VTool::mouseEvent |
( |
QMouseEvent * |
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.cc.
bool VTool::keyEvent |
( |
QEvent * |
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.cc.
virtual void VTool::refreshUnit |
( |
|
) |
[inline, virtual] |
This function is called when the documents unit setting were changed.
Definition at line 137 of file vtool.h.
virtual void VTool::setup |
( |
KActionCollection * |
|
) |
[inline, virtual] |
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 143 of file vtool.h.
KRadioAction* VTool::action |
( |
|
) |
const [inline] |
Returns the tool's associated action object.
- Returns:
- the associated action
Definition at line 150 of file vtool.h.
virtual void VTool::draw |
( |
VPainter * |
painter |
) |
[inline, virtual] |
Draws the actual tool state.
- Parameters:
-
| painter | the painter on which to paint |
Definition at line 157 of file vtool.h.
void VTool::activate |
( |
|
) |
[virtual, slot] |
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.cc.
bool VTool::isDragging |
( |
|
) |
const [inline, protected] |
Returns the current dagging state.
- Returns:
- true if the mouse is currently dragged, else false
Definition at line 172 of file vtool.h.
virtual void VTool::setCursor |
( |
|
) |
const [inline, protected, virtual] |
This function is called on each mouse event the tool receives.
Definition at line 179 of file vtool.h.
virtual void VTool::mouseButtonPress |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::rightMouseButtonPress |
( |
|
) |
[inline, protected, virtual] |
Right mouse button press.
Definition at line 189 of file vtool.h.
virtual void VTool::mouseButtonRelease |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::rightMouseButtonRelease |
( |
|
) |
[inline, protected, virtual] |
Right mouse button release.
The mouse wasn't moved.
Reimplemented in VPolylineTool.
Definition at line 199 of file vtool.h.
virtual void VTool::mouseButtonDblClick |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseMove |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDrag |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDragRelease |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDragShiftPressed |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDragCtrlPressed |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDragShiftReleased |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::mouseDragCtrlReleased |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::arrowKeyReleased |
( |
Qt::Key |
|
) |
[inline, protected, virtual] |
"Arrow" key released up, down, left, right
Definition at line 244 of file vtool.h.
virtual bool VTool::keyReleased |
( |
Qt::Key |
|
) |
[inline, protected, virtual] |
Specified key released.
Definition at line 249 of file vtool.h.
virtual void VTool::cancel |
( |
|
) |
[inline, protected, virtual] |
virtual void VTool::cancelStep |
( |
|
) |
[inline, protected, virtual] |
Cancels the last tool step (if any).
This event is invoked when Backspace is pressed.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 259 of file vtool.h.
virtual void VTool::accept |
( |
|
) |
[inline, protected, virtual] |
Terminates the current tool drawing (if any).
This event is invoked when Enter/Return is pressed.
Reimplemented in VPencilTool, and VPolylineTool.
Definition at line 264 of file vtool.h.
KarbonView * VTool::view |
( |
|
) |
const [protected] |
Returns the connected karbon part.
Returns the connected karbon view.
Definition at line 66 of file vtool.cc.
const KoPoint& VTool::first |
( |
|
) |
const [inline, protected] |
Most tools need to know the first mouse coordinate.
Definition at line 279 of file vtool.h.
const KoPoint& VTool::last |
( |
|
) |
const [inline, protected] |
The last mouse coordinate.
Definition at line 284 of file vtool.h.
bool VTool::shiftPressed |
( |
|
) |
const [inline, protected] |
The status of the shift key.
- Returns:
- true if key is pressed, else false
Definition at line 291 of file vtool.h.
bool VTool::ctrlPressed |
( |
|
) |
const [inline, protected] |
The status of the ctrl key.
- Returns:
- true if key is pressed, else false
Definition at line 298 of file vtool.h.
bool VTool::altPressed |
( |
|
) |
const [inline, protected] |
The status of the alt key.
- Returns:
- true if key is pressed, else false
Definition at line 305 of file vtool.h.
VToolController * VTool::toolController |
( |
|
) |
const [protected] |
Helper function.
Returns the parent view's toolcontroller.
Definition at line 60 of file vtool.cc.
Member Data Documentation
The tool's action object.
Definition at line 308 of file vtool.h.
The documentation for this class was generated from the following files:
|