umbrello: umbrello/umlwidgets/activitywidget.h Source File

umbrello 2.38.5 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

activitywidget.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef ACTIVITYWIDGET_H
7#define ACTIVITYWIDGET_H
8
9#include "umlwidget.h"
10#include "worktoolbar.h"
11
12#define ACTIVITY_MARGIN 5
13#define ACTIVITY_WIDTH 30
14#define ACTIVITY_HEIGHT 10
15
28 class ActivityWidget : public UMLWidget
29{
30 Q_OBJECT
31 Q_ENUMS(ActivityType)
32public:
33 enum ActivityType
34 {
35 Initial = 0,
36 Normal,
37 End,
38 Final,
39 Branch,
40 Invok,
41 Param
42 };
43
44 explicit ActivityWidget(UMLScene * scene, ActivityType activityType = Normal, Uml::ID::Type id = Uml::ID::None);
45 virtual ~ActivityWidget();
46
47 ActivityType activityType() const;
48 QString activityTypeStr() const;
49 void setActivityType(ActivityType activityType);
50
51 static bool isActivity(WorkToolBar::ToolBar_Buttons tbb,
52 ActivityType& resultType);
53
54 QString preconditionText() const;
55 void setPreconditionText(const QString&);
56
57 QString postconditionText() const;
58 void setPostconditionText(const QString&);
59
60 virtual bool showPropertiesDialog();
61 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
62 virtual void moveWidgetBy(qreal diffX, qreal diffY);
63
64 virtual bool loadFromXMI(QDomElement & qElement);
65 virtual void saveToXMI(QXmlStreamWriter& writer);
66
67 void constrain(qreal& width, qreal& height);
68
69signals:
78 void sigActMoved(qreal diffX, qreal diffY);
79
80public Q_SLOTS:
81 virtual void slotMenuSelection(QAction* action);
82
83protected:
84 virtual QSizeF minimumSize() const;
85 virtual QSizeF maximumSize();
86
87 ActivityType m_activityType;
88
89 QString m_preconditionText;
90 QString m_postconditionText;
91};
92
93#endif
ActivityWidget
A graphical version of a UML Activity.
Definition activitywidget.h:29
ActivityWidget::preconditionText
QString preconditionText() const
Definition activitywidget.cpp:119
ActivityWidget::ActivityType
ActivityType
Definition activitywidget.h:34
ActivityWidget::Branch
@ Branch
Definition activitywidget.h:39
ActivityWidget::Param
@ Param
Definition activitywidget.h:41
ActivityWidget::End
@ End
Definition activitywidget.h:37
ActivityWidget::Initial
@ Initial
Definition activitywidget.h:35
ActivityWidget::Final
@ Final
Definition activitywidget.h:38
ActivityWidget::Invok
@ Invok
Definition activitywidget.h:40
ActivityWidget::Normal
@ Normal
Definition activitywidget.h:36
ActivityWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition activitywidget.cpp:368
ActivityWidget::~ActivityWidget
virtual ~ActivityWidget()
Definition activitywidget.cpp:50
ActivityWidget::setPreconditionText
void setPreconditionText(const QString &)
Definition activitywidget.cpp:127
ActivityWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition activitywidget.cpp:156
ActivityWidget::ActivityWidget
ActivityWidget(UMLScene *scene, ActivityType activityType=Normal, Uml::ID::Type id=Uml::ID::None)
Definition activitywidget.cpp:37
ActivityWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition activitywidget.cpp:174
ActivityWidget::m_postconditionText
QString m_postconditionText
Definition activitywidget.h:90
ActivityWidget::setPostconditionText
void setPostconditionText(const QString &)
Definition activitywidget.cpp:145
ActivityWidget::m_preconditionText
QString m_preconditionText
Definition activitywidget.h:89
ActivityWidget::setActivityType
void setActivityType(ActivityType activityType)
Definition activitywidget.cpp:73
ActivityWidget::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition activitywidget.cpp:335
ActivityWidget::minimumSize
virtual QSizeF minimumSize() const
Definition activitywidget.cpp:395
ActivityWidget::activityType
ActivityType activityType() const
Definition activitywidget.cpp:57
ActivityWidget::activityTypeStr
QString activityTypeStr() const
Definition activitywidget.cpp:65
ActivityWidget::m_activityType
ActivityType m_activityType
Type of activity.
Definition activitywidget.h:87
ActivityWidget::maximumSize
virtual QSizeF maximumSize()
Definition activitywidget.cpp:435
ActivityWidget::sigActMoved
void sigActMoved(qreal diffX, qreal diffY)
ActivityWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Definition activitywidget.cpp:308
ActivityWidget::postconditionText
QString postconditionText() const
Definition activitywidget.cpp:137
ActivityWidget::constrain
void constrain(qreal &width, qreal &height)
Definition activitywidget.cpp:350
ActivityWidget::isActivity
static bool isActivity(WorkToolBar::ToolBar_Buttons tbb, ActivityType &resultType)
Definition activitywidget.cpp:89
ActivityWidget::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
Definition activitywidget.cpp:317
UMLScene
Definition umlscene.h:65
UMLWidget
The base class for graphical UML objects.
Definition umlwidget.h:36
UMLWidget::width
qreal width() const
Definition umlwidget.h:119
UMLWidget::height
qreal height() const
Definition umlwidget.h:112
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition worktoolbar.h:52
Uml::ID::None
const Type None
special value for uninitialized ID
Definition basictypes.h:373
Uml::ID::Type
std::string Type
Definition basictypes.h:371
umlwidget.h
worktoolbar.h