umbrello: umbrello/umlwidgets/pinportbase.h Source File

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

pinportbase.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) 2014-2021 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef PINPORTBASE_H
12 #define PINPORTBASE_H
13
14 #include "umlwidget.h"
15
16 #include <QScopedPointer>
17
18 class FloatingTextWidget;
19 class ChildWidgetPlacement;
20
27 class PinPortBase : public UMLWidget
28 {
29 Q_OBJECT
30 public:
31 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o);
32 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner = 0, Uml::ID::Type id = Uml::ID::None);
33 virtual ~PinPortBase();
34
35 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
36 virtual QRectF boundingRect() const;
37
38 virtual UMLWidget* ownerWidget() const;
39
40 void setInitialPosition(const QPointF &scenePos);
41
42 qreal getX() const;
43 qreal getY() const;
44 QPointF getPos() const;
45
46 void updateWidget();
47 void setName(const QString &strName);
48 void moveWidgetBy(qreal diffX, qreal diffY);
49 virtual void notifyParentResize();
50
51 UMLWidget* onWidget(const QPointF& p);
52 UMLWidget* widgetWithID(Uml::ID::Type id);
53
54 FloatingTextWidget *floatingTextWidget();
55 void setFloatingTextWidget(FloatingTextWidget *ft);
56
57 void saveToXMI1(QXmlStreamWriter& writer);
58 bool loadFromXMI1(QDomElement& qElement);
59
60 public slots:
61 virtual void slotMenuSelection(QAction* action);
62
63 protected:
64 void init(UMLWidget *owner = 0);
65 bool activate(IDChangeLog* changeLog = 0);
66
67 private:
68 ChildWidgetPlacement* createPlacement(WidgetBase::WidgetType type);
69
70 protected:
71 FloatingTextWidget *m_pName;
72
73 private:
74 QScopedPointer<ChildWidgetPlacement> m_childPlacement;
75 };
76
77 #endif
ChildWidgetPlacement
Base class for child widget placement.
Definition: childwidgetplacement.h:27
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
IDChangeLog
Definition: idchangelog.h:27
PinPortBase
Abstract base class for PinWidget and PortWidget.
Definition: pinportbase.h:28
PinPortBase::widgetWithID
UMLWidget * widgetWithID(Uml::ID::Type id)
Definition: pinportbase.cpp:272
PinPortBase::m_childPlacement
QScopedPointer< ChildWidgetPlacement > m_childPlacement
Definition: pinportbase.h:74
PinPortBase::~PinPortBase
virtual ~PinPortBase()
Definition: pinportbase.cpp:51
PinPortBase::PinPortBase
PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o)
Definition: pinportbase.cpp:34
PinPortBase::setInitialPosition
void setInitialPosition(const QPointF &scenePos)
Definition: pinportbase.cpp:92
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:87
PinPortBase::createPlacement
ChildWidgetPlacement * createPlacement(WidgetBase::WidgetType type)
Definition: pinportbase.cpp:55
PinPortBase::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: pinportbase.cpp:258
PinPortBase::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: pinportbase.cpp:190
PinPortBase::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: pinportbase.cpp:239
PinPortBase::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: pinportbase.cpp:168
PinPortBase::activate
bool activate(IDChangeLog *changeLog=0)
Definition: pinportbase.cpp:340
PinPortBase::getPos
QPointF getPos() const
Definition: pinportbase.cpp:107
PinPortBase::setName
void setName(const QString &strName)
Definition: pinportbase.cpp:132
PinPortBase::getY
qreal getY() const
Definition: pinportbase.cpp:102
PinPortBase::moveWidgetBy
void moveWidgetBy(qreal diffX, qreal diffY)
Definition: pinportbase.cpp:151
PinPortBase::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: pinportbase.cpp:285
PinPortBase::setFloatingTextWidget
void setFloatingTextWidget(FloatingTextWidget *ft)
Definition: pinportbase.cpp:243
PinPortBase::boundingRect
virtual QRectF boundingRect() const
Definition: pinportbase.cpp:182
PinPortBase::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: pinportbase.cpp:302
PinPortBase::getX
qreal getX() const
Definition: pinportbase.cpp:97
PinPortBase::updateWidget
void updateWidget()
Definition: pinportbase.cpp:118
PinPortBase::notifyParentResize
virtual void notifyParentResize()
Definition: pinportbase.cpp:160
PinPortBase::m_pName
FloatingTextWidget * m_pName
Definition: pinportbase.h:71
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
UMLScene
Definition: umlscene.h:70
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
UMLWidget::init
void init()
Definition: umlwidget.cpp:711
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:112
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
Uml::ID::Type
std::string Type
Definition: basictypes.h:385
umlwidget.h