umbrello: umbrello/umlwidgets/pinportbase.h Source File

umbrello 2.32.3 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 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2014-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef PINPORTBASE_H
7#define PINPORTBASE_H
8
9#include "umlwidget.h"
10
11#include <QScopedPointer>
12
13class FloatingTextWidget;
14class ChildWidgetPlacement;
15
22 class PinPortBase : public UMLWidget
23{
24 Q_OBJECT
25public:
26 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o);
27 PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner = 0, Uml::ID::Type id = Uml::ID::None);
28 virtual ~PinPortBase();
29
30 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
31 virtual QRectF boundingRect() const;
32
33 virtual UMLWidget* ownerWidget() const;
34
35 void setInitialPosition(const QPointF &scenePos);
36
37 qreal getX() const;
38 qreal getY() const;
39 QPointF getPos() const;
40
41 void updateWidget();
42 void setName(const QString &strName);
43 void moveWidgetBy(qreal diffX, qreal diffY);
44 virtual void notifyParentResize();
45
46 UMLWidget* onWidget(const QPointF& p);
47 UMLWidget* widgetWithID(Uml::ID::Type id);
48
49 FloatingTextWidget *floatingTextWidget();
50 void setFloatingTextWidget(FloatingTextWidget *ft);
51
52 void saveToXMI1(QXmlStreamWriter& writer);
53 bool loadFromXMI1(QDomElement& qElement);
54
55public slots:
56 virtual void slotMenuSelection(QAction* action);
57
58protected:
59 void init(UMLWidget *owner = 0);
60 bool activate(IDChangeLog* changeLog = 0);
61
62private:
63 ChildWidgetPlacement* createPlacement(WidgetBase::WidgetType type);
64
65protected:
66 FloatingTextWidget *m_pName;
67
68private:
69 QScopedPointer<ChildWidgetPlacement> m_childPlacement;
70};
71
72#endif
ChildWidgetPlacement
Base class for child widget placement.
Definition: childwidgetplacement.h:22
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:32
IDChangeLog
Definition: idchangelog.h:22
PinPortBase
Abstract base class for PinWidget and PortWidget.
Definition: pinportbase.h:23
PinPortBase::widgetWithID
UMLWidget * widgetWithID(Uml::ID::Type id)
Definition: pinportbase.cpp:267
PinPortBase::m_childPlacement
QScopedPointer< ChildWidgetPlacement > m_childPlacement
Definition: pinportbase.h:69
PinPortBase::~PinPortBase
virtual ~PinPortBase()
Definition: pinportbase.cpp:46
PinPortBase::PinPortBase
PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o)
Definition: pinportbase.cpp:29
PinPortBase::setInitialPosition
void setInitialPosition(const QPointF &scenePos)
Definition: pinportbase.cpp:87
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:82
PinPortBase::createPlacement
ChildWidgetPlacement * createPlacement(WidgetBase::WidgetType type)
Definition: pinportbase.cpp:50
PinPortBase::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: pinportbase.cpp:253
PinPortBase::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: pinportbase.cpp:185
PinPortBase::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: pinportbase.cpp:234
PinPortBase::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: pinportbase.cpp:163
PinPortBase::activate
bool activate(IDChangeLog *changeLog=0)
Definition: pinportbase.cpp:335
PinPortBase::getPos
QPointF getPos() const
Definition: pinportbase.cpp:102
PinPortBase::setName
void setName(const QString &strName)
Definition: pinportbase.cpp:127
PinPortBase::getY
qreal getY() const
Definition: pinportbase.cpp:97
PinPortBase::moveWidgetBy
void moveWidgetBy(qreal diffX, qreal diffY)
Definition: pinportbase.cpp:146
PinPortBase::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: pinportbase.cpp:280
PinPortBase::setFloatingTextWidget
void setFloatingTextWidget(FloatingTextWidget *ft)
Definition: pinportbase.cpp:238
PinPortBase::boundingRect
virtual QRectF boundingRect() const
Definition: pinportbase.cpp:177
PinPortBase::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: pinportbase.cpp:297
PinPortBase::getX
qreal getX() const
Definition: pinportbase.cpp:92
PinPortBase::updateWidget
void updateWidget()
Definition: pinportbase.cpp:113
PinPortBase::notifyParentResize
virtual void notifyParentResize()
Definition: pinportbase.cpp:155
PinPortBase::m_pName
FloatingTextWidget * m_pName
Definition: pinportbase.h:66
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLScene
Definition: umlscene.h:65
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:36
UMLWidget::init
void init()
Definition: umlwidget.cpp:706
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:107
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