summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/seqlinewidget.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/seqlinewidget.h
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/seqlinewidget.h')
-rw-r--r--umbrello/umbrello/seqlinewidget.h135
1 files changed, 135 insertions, 0 deletions
diff --git a/umbrello/umbrello/seqlinewidget.h b/umbrello/umbrello/seqlinewidget.h
new file mode 100644
index 00000000..1978fafd
--- /dev/null
+++ b/umbrello/umbrello/seqlinewidget.h
@@ -0,0 +1,135 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * copyright (C) 2002-2007 *
+ * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
+ ***************************************************************************/
+
+#ifndef SEQLINEWIDGET_H
+#define SEQLINEWIDGET_H
+
+#include <qcanvas.h>
+
+class UMLView;
+class ObjectWidget;
+
+/**
+ * @short Widget class for graphical representation of sequence lines
+ * @author Paul Hensgen
+ * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
+ */
+class SeqLineWidget : public QCanvasLine {
+public:
+ /**
+ * Constructor.
+ */
+ SeqLineWidget( UMLView * pView, ObjectWidget * pObject );
+
+ /**
+ * Destructor.
+ */
+ ~SeqLineWidget();
+
+ /**
+ * Return whether on seq. line.
+ * Takes into account destruction box if shown.
+ *
+ * @param p The point to investigate.
+ * @return Non-zero if point is on this sequence line.
+ */
+ int onWidget(const QPoint & p);
+
+ /**
+ * Clean up anything before deletion.
+ */
+ void cleanup();
+
+ /**
+ * Set up destruction box.
+ */
+ void setupDestructionBox();
+
+ /**
+ * Set the start point of the line.
+ *
+ * @param startX X coordinate of the start point.
+ * @param startY Y coordinate of the start point.
+ */
+ void setStartPoint( int startX, int startY );
+
+ /**
+ * Gets the length of the line.
+ *
+ * @return Length of the line.
+ */
+ int getLineLength() {
+ return m_nLengthY;
+ }
+
+ /**
+ * Returns the @ref ObjectWidget associated with this sequence line.
+ *
+ * @return Pointer to the associated ObjectWidget.
+ */
+ ObjectWidget * getObjectWidget() {
+ return m_pObject;
+ }
+
+ /**
+ * Sets the y position of the bottom of the vertical line.
+ *
+ * @param yPosition The y coordinate for the bottom of the line.
+ */
+ void setEndOfLine(int yPosition);
+
+protected:
+ /**
+ * Clean up destruction box.
+ */
+ void cleanupDestructionBox();
+
+ /**
+ * Move destruction box.
+ */
+ void moveDestructionBox();
+
+ /**
+ * ObjectWidget associated with this sequence line.
+ */
+ ObjectWidget * m_pObject;
+
+ /**
+ * View displayed on.
+ */
+ UMLView * m_pView;
+
+ /// The destruction box.
+ struct DestructionBox {
+ QCanvasLine * line1;
+ QCanvasLine * line2;
+ void setLine1Points(QRect rect) {
+ line1->setPoints( rect.x(), rect.y(),
+ rect.x() + rect.width(), rect.y() + rect.height() );
+ }
+ void setLine2Points(QRect rect) {
+ line2->setPoints( rect.x(), rect.y() + rect.height(),
+ rect.x() + rect.width(), rect.y() );
+ }
+ } m_DestructionBox;
+
+ /**
+ * The length of the line.
+ */
+ int m_nLengthY;
+
+ /**
+ * Margin used for mouse clicks.
+ */
+ static int const m_nMouseDownEpsilonX;
+};
+
+#endif