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 * 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-2020 *
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 void updateWidget();
43 void setName(const QString &strName);
44 void moveWidgetBy(qreal diffX, qreal diffY);
45 virtual void notifyParentResize();
46
47 UMLWidget* onWidget(const QPointF& p);
48 UMLWidget* widgetWithID(Uml::ID::Type id);
49
50 FloatingTextWidget *floatingTextWidget();
51 void setFloatingTextWidget(FloatingTextWidget *ft);
52
53 void saveToXMI1(QDomDocument& qDoc, QDomElement& qElement);
54 bool loadFromXMI1(QDomElement& qElement);
55
56 public slots:
57 virtual void slotMenuSelection(QAction* action);
58
59 protected:
60 void init(UMLWidget *owner = 0);
61 bool activate(IDChangeLog* changeLog = 0);
62
63 private:
64 ChildWidgetPlacement* createPlacement(WidgetBase::WidgetType type);
65
66 protected:
67 FloatingTextWidget *m_pName;
68
69 private:
70 QScopedPointer<ChildWidgetPlacement> m_childPlacement;
71 };
72
73 #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:256
PinPortBase::m_childPlacement
QScopedPointer< ChildWidgetPlacement > m_childPlacement
Definition: pinportbase.h:70
PinPortBase::~PinPortBase
virtual ~PinPortBase()
Definition: pinportbase.cpp:50
PinPortBase::PinPortBase
PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o)
Definition: pinportbase.cpp:33
PinPortBase::setInitialPosition
void setInitialPosition(const QPointF &scenePos)
Definition: pinportbase.cpp:91
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:86
PinPortBase::createPlacement
ChildWidgetPlacement * createPlacement(WidgetBase::WidgetType type)
Definition: pinportbase.cpp:54
PinPortBase::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: pinportbase.cpp:242
PinPortBase::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: pinportbase.cpp:174
PinPortBase::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: pinportbase.cpp:223
PinPortBase::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: pinportbase.cpp:152
PinPortBase::activate
bool activate(IDChangeLog *changeLog=0)
Definition: pinportbase.cpp:323
PinPortBase::setName
void setName(const QString &strName)
Definition: pinportbase.cpp:116
PinPortBase::moveWidgetBy
void moveWidgetBy(qreal diffX, qreal diffY)
Definition: pinportbase.cpp:135
PinPortBase::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: pinportbase.cpp:269
PinPortBase::setFloatingTextWidget
void setFloatingTextWidget(FloatingTextWidget *ft)
Definition: pinportbase.cpp:227
PinPortBase::boundingRect
virtual QRectF boundingRect() const
Definition: pinportbase.cpp:166
PinPortBase::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: pinportbase.cpp:285
PinPortBase::updateWidget
void updateWidget()
Definition: pinportbase.cpp:102
PinPortBase::notifyParentResize
virtual void notifyParentResize()
Definition: pinportbase.cpp:144
PinPortBase::m_pName
FloatingTextWidget * m_pName
Definition: pinportbase.h:67
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLScene
Definition: umlscene.h:69
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
UMLWidget::init
void init()
Definition: umlwidget.cpp:698
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:111
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