umbrello: umbrello/umlwidgets/signalwidget.h Source File

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

signalwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef SIGNALWIDGET_H
12 #define SIGNALWIDGET_H
13
14 #include "floatingtextwidget.h"
15 #include "linkwidget.h"
16 #include "umlwidget.h"
17 #include "worktoolbar.h"
18
19 #define SIGNAL_MARGIN 5
20 #define SIGNAL_WIDTH 45
21 #define SIGNAL_HEIGHT 15
22
27 class SignalWidget : public UMLWidget
28 {
29 Q_OBJECT
30 Q_ENUMS(SignalType)
31 public:
33 enum SignalType
34 {
35 Send = 0,
36 Accept,
37 Time
38 };
39
40 explicit SignalWidget(UMLScene * scene, SignalType signalType = Send, Uml::ID::Type id = Uml::ID::None);
41 virtual ~SignalWidget();
42
43 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
44
45 void setX(qreal newX);
46 void setY(qreal newY);
47
48 virtual void setName(const QString &strName);
49
50 SignalType signalType() const;
51 QString signalTypeStr() const;
52 void setSignalType(SignalType signalType);
53
54 virtual bool showPropertiesDialog();
55
56 void mouseMoveEvent(QGraphicsSceneMouseEvent *me);
57
58 virtual bool loadFromXMI1(QDomElement & qElement);
59 virtual void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
60
61 public Q_SLOTS:
62 virtual void slotMenuSelection(QAction* action);
63
64 protected:
65 QSizeF minimumSize() const;
66
70 int m_oldX;
71 int m_oldY;
72
73 // Only for the time event
78 FloatingTextWidget* m_pName;
79
80 SignalType m_signalType;
81
82 protected Q_SLOTS:
83 void slotTextDestroyed();
84 };
85
86 #endif
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
SignalWidget
Definition: signalwidget.h:28
SignalWidget::~SignalWidget
virtual ~SignalWidget()
Definition: signalwidget.cpp:62
SignalWidget::minimumSize
QSizeF minimumSize() const
Definition: signalwidget.cpp:347
SignalWidget::setY
void setY(qreal newY)
Definition: signalwidget.cpp:180
SignalWidget::setSignalType
void setSignalType(SignalType signalType)
Definition: signalwidget.cpp:225
SignalWidget::slotTextDestroyed
void slotTextDestroyed()
Definition: signalwidget.cpp:371
SignalWidget::SignalType
SignalType
Enumeration that codes the different types of signal.
Definition: signalwidget.h:34
SignalWidget::Time
@ Time
Definition: signalwidget.h:37
SignalWidget::Send
@ Send
Definition: signalwidget.h:35
SignalWidget::Accept
@ Accept
Definition: signalwidget.h:36
SignalWidget::m_oldY
int m_oldY
Definition: signalwidget.h:71
SignalWidget::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *me)
Definition: signalwidget.cpp:241
SignalWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: signalwidget.cpp:255
SignalWidget::setName
virtual void setName(const QString &strName)
Definition: signalwidget.cpp:189
SignalWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: signalwidget.cpp:69
SignalWidget::m_oldX
int m_oldX
Definition: signalwidget.h:70
SignalWidget::SignalWidget
SignalWidget(UMLScene *scene, SignalType signalType=Send, Uml::ID::Type id=Uml::ID::None)
Definition: signalwidget.cpp:43
SignalWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: signalwidget.cpp:233
SignalWidget::signalTypeStr
QString signalTypeStr() const
Definition: signalwidget.cpp:217
SignalWidget::signalType
SignalType signalType() const
Definition: signalwidget.cpp:209
SignalWidget::setX
void setX(qreal newX)
Definition: signalwidget.cpp:171
SignalWidget::m_pName
FloatingTextWidget * m_pName
Definition: signalwidget.h:78
SignalWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: signalwidget.cpp:305
SignalWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: signalwidget.cpp:323
SignalWidget::m_signalType
SignalType m_signalType
Type of signal.
Definition: signalwidget.h:80
UMLScene
Definition: umlscene.h:69
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
floatingtextwidget.h
linkwidget.h
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
umlwidget.h
worktoolbar.h