karbon
VTool Class Reference
#include <vtool.h>
Inheritance diagram for VTool:

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.
Public Slots | |
virtual void | activate () |
Public Member Functions | |
VTool (KarbonView *view, const char *name) | |
virtual | ~VTool () |
virtual void | registerTool (VTool *tool) |
virtual void | deactivate () |
virtual bool | showDialog () const |
virtual QString | uiname () |
virtual QString | contextHelp () |
virtual enumToolType | toolType () |
virtual QString | statusText () |
virtual uint | priority () |
QString | icon () |
bool | mouseEvent (QMouseEvent *event, const KoPoint &) |
bool | keyEvent (QEvent *event) |
virtual void | refreshUnit () |
virtual void | setup (KActionCollection *) |
KRadioAction * | action () const |
virtual void | draw (VPainter *painter) |
Protected Member Functions | |
bool | isDragging () const |
virtual void | draw () |
virtual void | setCursor () const |
virtual void | mouseButtonPress () |
virtual void | rightMouseButtonPress () |
virtual void | mouseButtonRelease () |
virtual void | rightMouseButtonRelease () |
virtual void | mouseButtonDblClick () |
virtual void | mouseMove () |
virtual void | mouseDrag () |
virtual void | mouseDragRelease () |
virtual void | mouseDragShiftPressed () |
virtual void | mouseDragCtrlPressed () |
virtual void | mouseDragShiftReleased () |
virtual void | mouseDragCtrlReleased () |
virtual void | arrowKeyReleased (Qt::Key) |
virtual bool | keyReleased (Qt::Key) |
virtual void | cancel () |
virtual void | cancelStep () |
virtual void | accept () |
KarbonView * | view () const |
const KoPoint & | first () const |
const KoPoint & | last () const |
bool | shiftPressed () const |
bool | ctrlPressed () const |
bool | altPressed () const |
VToolController * | toolController () const |
Protected Attributes | |
KRadioAction * | m_action |
Constructor & Destructor Documentation
VTool::VTool | ( | KarbonView * | view, | |
const char * | name | |||
) |
VTool::~VTool | ( | ) | [virtual] |
Member Function Documentation
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, VPolylineTool, and VTextTool.
KRadioAction* VTool::action | ( | ) | const [inline] |
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 VImageTool, VZoomTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, VShearTool, and VTextTool.
bool VTool::altPressed | ( | ) | const [inline, protected] |
virtual void VTool::arrowKeyReleased | ( | Qt::Key | ) | [inline, protected, virtual] |
"Arrow" key released up, down, left, right
Reimplemented in VPolygonTool, VSelectTool, VSpiralTool, and VStarTool.
virtual void VTool::cancel | ( | ) | [inline, protected, virtual] |
Cancels all tool operations.
This event is invoked when ESC is pressed.
Reimplemented in VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, VShearTool, and VTextTool.
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.
virtual QString VTool::contextHelp | ( | ) | [inline, virtual] |
The context help of the tool.
Reimplemented in VImageTool, VZoomTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VSelectTool, VShapeTool, and VTextTool.
bool VTool::ctrlPressed | ( | ) | const [inline, protected] |
virtual void VTool::deactivate | ( | ) | [inline, virtual] |
Deactivates the tool.
Reimplemented in VImageTool, VZoomTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, and VTextTool.
virtual void VTool::draw | ( | VPainter * | painter | ) | [inline, virtual] |
Draws the actual tool state.
- Parameters:
-
painter the painter on which to paint
Reimplemented in VGradientTool, VPatternTool, and VTextTool.
const KoPoint& VTool::first | ( | ) | const [inline, protected] |
bool VTool::isDragging | ( | ) | const [inline, protected] |
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.
virtual bool VTool::keyReleased | ( | Qt::Key | ) | [inline, protected, virtual] |
Specified key released.
Reimplemented in VZoomTool, VGradientTool, VPatternTool, VSelectNodesTool, and VSelectTool.
const KoPoint& VTool::last | ( | ) | const [inline, protected] |
virtual void VTool::mouseButtonDblClick | ( | ) | [inline, protected, virtual] |
virtual void VTool::mouseButtonPress | ( | ) | [inline, protected, virtual] |
Left mouse button press.
Reimplemented in VZoomTool, VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, VShearTool, and VTextTool.
virtual void VTool::mouseButtonRelease | ( | ) | [inline, protected, virtual] |
Left mouse button release.
The mouse wasn't moved.
Reimplemented in VImageTool, VZoomTool, VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VSelectNodesTool, VSelectTool, VShapeTool, and VTextTool.
virtual void VTool::mouseDrag | ( | ) | [inline, protected, virtual] |
Mouse drag.
Reimplemented in VZoomTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, VShearTool, and VTextTool.
virtual void VTool::mouseDragCtrlPressed | ( | ) | [inline, protected, virtual] |
Mouse drag with "Ctrl" key pressed at the same time.
Reimplemented in VPencilTool, VPolylineTool, VSelectTool, and VShapeTool.
virtual void VTool::mouseDragCtrlReleased | ( | ) | [inline, protected, virtual] |
"Ctrl" key released while mouse drag.
Reimplemented in VPencilTool, VPolylineTool, VSelectTool, and VShapeTool.
virtual void VTool::mouseDragRelease | ( | ) | [inline, protected, virtual] |
Mouse button release.
The mouse was moved before.
Reimplemented in VZoomTool, VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, VShearTool, and VTextTool.
virtual void VTool::mouseDragShiftPressed | ( | ) | [inline, protected, virtual] |
Mouse drag with "Shift" key pressed at the same time.
Reimplemented in VPencilTool, VPolylineTool, VSelectTool, VShapeTool, and VTextTool.
virtual void VTool::mouseDragShiftReleased | ( | ) | [inline, protected, virtual] |
"Shift" key released while mouse drag.
Reimplemented in VPencilTool, VPolylineTool, VSelectTool, VShapeTool, and VTextTool.
bool VTool::mouseEvent | ( | QMouseEvent * | event, | |
const KoPoint & | ||||
) |
virtual void VTool::mouseMove | ( | ) | [inline, protected, virtual] |
Mouse move.
No mouse button is pressed.
Reimplemented in VEllipseTool, VPencilTool, and VPolylineTool.
virtual uint VTool::priority | ( | ) | [inline, virtual] |
Position in toolbox.
Zero means no preferred position, other values indicate the true position.
Reimplemented in VRotateTool, VSelectNodesTool, VSelectTool, and VShearTool.
virtual void VTool::refreshUnit | ( | ) | [inline, virtual] |
This function is called when the documents unit setting were changed.
Reimplemented in VEllipseTool, VPolygonTool, VRectangleTool, VRoundRectTool, VSelectTool, VSinusTool, VSpiralTool, and VStarTool.
void VTool::registerTool | ( | VTool * | tool | ) | [virtual] |
virtual void VTool::rightMouseButtonPress | ( | ) | [inline, protected, virtual] |
virtual void VTool::rightMouseButtonRelease | ( | ) | [inline, protected, virtual] |
Right mouse button release.
The mouse wasn't moved.
Reimplemented in VZoomTool, VPolylineTool, VSelectNodesTool, and VSelectTool.
virtual void VTool::setCursor | ( | ) | const [inline, protected, virtual] |
This function is called on each mouse event the tool receives.
Reimplemented in VGradientTool, VPatternTool, VSelectNodesTool, VSelectTool, and VShearTool.
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 VImageTool, VZoomTool, VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolygonTool, VPolylineTool, VRectangleTool, VRotateTool, VRoundRectTool, VSelectNodesTool, VSelectTool, VShearTool, VSinusTool, VSpiralTool, VStarTool, and VTextTool.
bool VTool::shiftPressed | ( | ) | const [inline, protected] |
virtual bool VTool::showDialog | ( | ) | const [inline, virtual] |
Shows the tools option dialog.
Reimplemented in VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolygonTool, VRectangleTool, VRoundRectTool, VSelectTool, VSinusTool, VSpiralTool, VStarTool, and VTextTool.
virtual QString VTool::statusText | ( | ) | [inline, virtual] |
The tool status text.
Reimplemented in VImageTool, VZoomTool, VGradientTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, and VShearTool.
VToolController * VTool::toolController | ( | ) | const [protected] |
virtual enumToolType VTool::toolType | ( | ) | [inline, virtual] |
The tool type.
Reimplemented in VPencilTool, VPolylineTool, VRotateTool, VSelectNodesTool, VSelectTool, VShapeTool, and VShearTool.
virtual QString VTool::uiname | ( | ) | [inline, virtual] |
The name of the tool.
Reimplemented in VImageTool, VZoomTool, VEllipseTool, VGradientTool, VPatternTool, VPencilTool, VPolygonTool, VPolylineTool, VRectangleTool, VRotateTool, VRoundRectTool, VSelectNodesTool, VSelectTool, VShearTool, VSinusTool, VSpiralTool, VStarTool, and VTextTool.
KarbonView * VTool::view | ( | ) | const [protected] |
Member Data Documentation
KRadioAction* VTool::m_action [protected] |
The documentation for this class was generated from the following files: