1
/***************************************************************************
3
* This program is free software; you can redistribute it and/or modify *
4
* it under the terms of the GNU General Public License as published by *
5
* the Free Software Foundation; either version 2 of the License, or *
6
* (at your option) any later version. *
8
* copyright (C) 2002-2006 *
9
* Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
10
***************************************************************************/
12
#ifndef PRECONDITIONWIDGET_H
13
#define PRECONDITIONWIDGET_H
15
#include "umlwidget.h"
16
#include "worktoolbar.h"
18
#define PRECONDITION_MARGIN 5
19
#define PRECONDITION_WIDTH 30
20
#define PRECONDITION_HEIGHT 10
25
* This class is the graphical version of a UML Precondition. A PreconditionWidget is created
26
* by a @ref UMLView. An PreconditionWidget belongs to only one @ref UMLView instance.
27
* When the @ref UMLView instance that this class belongs to, it will be automatically deleted.
29
* The PreconditionWidget class inherits from the @ref UMLWidget class which adds most of the functionality
32
* @short A graphical version of a UML Precondition (new in UML 2.0).
33
* @author Florence Mattler <florence.mattler@libertysurf.fr>
34
* Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
36
class PreconditionWidget : public UMLWidget {
42
* Creates a Precondition widget.
44
* @param view The parent of the widget.
45
* @param a The role A widget for this precondition.
46
* @param id The ID to assign (-1 will prompt a new ID.)
48
PreconditionWidget( UMLView * view, ObjectWidget* a, Uml::IDType id = Uml::id_None );
54
virtual ~PreconditionWidget();
57
* Initializes key variables of the class.
62
* Overrides the standard paint event.
64
void draw(QPainter & p, int offsetX, int offsetY);
68
* Calculate the geometry of the widget.
70
void calculateWidget();
73
* Activates a PreconditionWidget. Connects the WidgetMoved signal from
74
* its m_pOw pointer so that PreconditionWidget can adjust to the move of
77
bool activate(IDChangeLog * Log = 0);
80
* Calculates the size of the widget
82
void calculateDimensions();
86
* Returns the minimum height this widget should be set at on
87
* a sequence diagrams. Takes into account the widget positions
93
* Returns the maximum height this widget should be set at on
94
* a sequence diagrams. Takes into account the widget positions
100
* Saves the widget to the "preconditionwidget" XMI element.
102
void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
105
* Loads the widget from the "preconditionwidget" XMI element.
107
bool loadFromXMI( QDomElement & qElement );
111
* Overrides method from UMLWidget
113
QSize calculateSize();
119
* Captures any popup menu signals for menus it created.
121
void slotMenuSelection(QAction* action);
122
void slotWidgetMoved(Uml::IDType id);
125
ObjectWidget * m_pOw;