libs/flake
KoConnectionShape Class Reference
#include <KoConnectionShape.h>

Public Types | |
| enum | Type { Standard, Lines, Straight, Curve } |
Public Member Functions | |
| KoConnectionShape () | |
| virtual | ~KoConnectionShape () |
| KoConnection | connection1 () const |
| KoConnection | connection2 () const |
| Type | connectionType () const |
| virtual bool | hitTest (const QPointF &position) const |
| virtual bool | loadOdf (const KoXmlElement &element, KoShapeLoadingContext &context) |
| virtual void | paint (QPainter &painter, const KoViewConverter &converter) |
| QString | pathShapeId () const |
| virtual void | saveOdf (KoShapeSavingContext &context) const |
| bool | setConnection1 (KoShape *shape1, int connectionPointIndex) |
| bool | setConnection2 (KoShape *shape2, int connectionPointIndex) |
| void | setConnectionType (Type connectionType) |
| void | updateConnections () |
Protected Member Functions | |
| QPointF | escapeDirection (int handleId) const |
| bool | handleConnected (int handleId) const |
| bool | intersects (const QPointF &p1, const QPointF &d1, const QPointF &p2, const QPointF &d2, QPointF &isect) |
| void | moveHandleAction (int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
| void | normalPath (const qreal MinimumEscapeLength) |
| QPointF | perpendicularDirection (const QPointF &p1, const QPointF &d1, const QPointF &p2) |
| virtual void | shapeChanged (ChangeType type, KoShape *shape) |
| void | updatePath (const QSizeF &size) |
Detailed Description
Definition at line 34 of file KoConnectionShape.h.
Member Enumeration Documentation
- Enumerator:
Definition at line 37 of file KoConnectionShape.h.
Constructor & Destructor Documentation
| KoConnectionShape::KoConnectionShape | ( | ) | [explicit] |
Definition at line 53 of file KoConnectionShape.cpp.
| KoConnectionShape::~KoConnectionShape | ( | ) | [virtual] |
Definition at line 72 of file KoConnectionShape.cpp.
Member Function Documentation
| KoConnection KoConnectionShape::connection1 | ( | ) | const |
Returns the connection to the first shape.
Definition at line 360 of file KoConnectionShape.cpp.
| KoConnection KoConnectionShape::connection2 | ( | ) | const |
Returns the connection to the second shape.
Definition at line 365 of file KoConnectionShape.cpp.
| KoConnectionShape::Type KoConnectionShape::connectionType | ( | ) | const |
Returns connection type.
Definition at line 404 of file KoConnectionShape.cpp.
| QPointF KoConnectionShape::escapeDirection | ( | int | handleId | ) | const [protected] |
Returns escape direction of given handle.
Definition at line 425 of file KoConnectionShape.cpp.
| bool KoConnectionShape::handleConnected | ( | int | handleId | ) | const [protected] |
Returns if given handle is connected to a shape.
Definition at line 415 of file KoConnectionShape.cpp.
| bool KoConnectionShape::hitTest | ( | const QPointF & | position | ) | const [virtual] |
| bool KoConnectionShape::intersects | ( | const QPointF & | p1, | |
| const QPointF & | d1, | |||
| const QPointF & | p2, | |||
| const QPointF & | d2, | |||
| QPointF & | isect | |||
| ) | [protected] |
Checks if rays from given points into given directions intersect.
Definition at line 459 of file KoConnectionShape.cpp.
| bool KoConnectionShape::loadOdf | ( | const KoXmlElement & | element, | |
| KoShapeLoadingContext & | context | |||
| ) | [virtual] |
Load a shape from odf.
- Parameters:
-
context the KoShapeLoadingContext used for loading element element which represents the shape in odf
- Returns:
- false if loading failed
Reimplemented from KoPathShape.
Definition at line 131 of file KoConnectionShape.cpp.
| void KoConnectionShape::moveHandleAction | ( | int | handleId, | |
| const QPointF & | point, | |||
| Qt::KeyboardModifiers | modifiers = Qt::NoModifier | |||
| ) | [protected, virtual] |
| void KoConnectionShape::normalPath | ( | const qreal | MinimumEscapeLength | ) | [protected] |
Populate the path list by a normal way.
Definition at line 249 of file KoConnectionShape.cpp.
| void KoConnectionShape::paint | ( | QPainter & | painter, | |
| const KoViewConverter & | converter | |||
| ) | [virtual] |
| QString KoConnectionShape::pathShapeId | ( | ) | const [inline, virtual] |
Returns the specific path shape id.
Path shape derived shapes have a different shape id which link them to their respective shape factories. In most cases they do not have a special tool for editing them. This function returns the specific shape id for finding the shape factory from KoShapeRegistry. The default KoPathShapeId is returned from KoShape::shapeId() so that the generic path editing tool gets activated when the shape is selected.
- Returns:
- the specific shape id
Reimplemented from KoPathShape.
Definition at line 57 of file KoConnectionShape.h.
| QPointF KoConnectionShape::perpendicularDirection | ( | const QPointF & | p1, | |
| const QPointF & | d1, | |||
| const QPointF & | p2 | |||
| ) | [protected] |
Returns perpendicular direction from given point p1 and direction d1 toward point p2.
Definition at line 499 of file KoConnectionShape.cpp.
| void KoConnectionShape::saveOdf | ( | KoShapeSavingContext & | context | ) | const [virtual] |
store the shape data as ODF XML.
This is the method that will be called when saving a shape as a described in OpenDocument 9.2 Drawing Shapes.
- See also:
- saveOdfAttributes
Reimplemented from KoPathShape.
Definition at line 86 of file KoConnectionShape.cpp.
| bool KoConnectionShape::setConnection1 | ( | KoShape * | shape1, | |
| int | connectionPointIndex | |||
| ) |
Sets the first shape the connector is connected to.
Passing a null pointer as the first parameter will reset the connection.
- Parameters:
-
shape1 the shape to connect to or null to reset the connection connectionPointIndex1 the index of the connection point to connect to
- Returns:
- true if connection could be established, otherwise false
Definition at line 318 of file KoConnectionShape.cpp.
| bool KoConnectionShape::setConnection2 | ( | KoShape * | shape2, | |
| int | connectionPointIndex | |||
| ) |
Sets the second shape the connector is connected to.
Passing a null pointer as the first parameter will reset the connection.
- Parameters:
-
shape2 the shape to connect to or null to reset the connection connectionPointIndex2 the index of the connection point to connect to
- Returns:
- true if connection could be established, otherwise false
Definition at line 339 of file KoConnectionShape.cpp.
| void KoConnectionShape::setConnectionType | ( | Type | connectionType | ) |
Sets the connection type.
Definition at line 409 of file KoConnectionShape.cpp.
| void KoConnectionShape::shapeChanged | ( | ChangeType | type, | |
| KoShape * | shape | |||
| ) | [protected, virtual] |
reimplemented
Definition at line 509 of file KoConnectionShape.cpp.
| void KoConnectionShape::updateConnections | ( | ) |
Updates connections to shapes.
Definition at line 370 of file KoConnectionShape.cpp.
| void KoConnectionShape::updatePath | ( | const QSizeF & | size | ) | [protected, virtual] |
The documentation for this class was generated from the following files:
