umbrello: umbrello/umlwidgets/pinportbase.h Source File

umbrello 2.31.1 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
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
PinPortBase::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: pinportbase.cpp:223
WidgetBase::onWidget
virtual UMLWidget * onWidget(const QPointF &p)
Definition: widgetbase.cpp:875
port.h
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
ChildWidgetPlacementPort
Child widget placement on parent border.
Definition: childwidgetplacementport.h:22
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
Uml::ID::Reserved
const Type Reserved
special value for illegal ID
Definition: basictypes.h:371
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
PinPortBase::setInitialPosition
void setInitialPosition(const QPointF &scenePos)
Definition: pinportbase.cpp:91
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
PinPortBase::m_childPlacement
QScopedPointer< ChildWidgetPlacement > m_childPlacement
Definition: pinportbase.h:70
FloatingTextWidget::setText
void setText(const QString &t)
Definition: floatingtextwidget.cpp:109
UMLWidget::m_ignoreSnapComponentSizeToGrid
bool m_ignoreSnapComponentSizeToGrid
Definition: umlwidget.h:318
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:370
FloatingTextWidget::activate
bool activate(IDChangeLog *ChangeLog=0)
Definition: floatingtextwidget.cpp:302
UMLScene::backgroundColor
const QColor & backgroundColor() const
Definition: umlscene.cpp:1355
pinportbase.h
PinPortBase::widgetWithID
UMLWidget * widgetWithID(Uml::ID::Type id)
Definition: pinportbase.cpp:256
FloatingTextWidget::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: floatingtextwidget.cpp:594
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1280
UMLWidget::setMaximumSize
void setMaximumSize(const QSizeF &size)
Definition: umlwidget.cpp:251
ListPopupMenu::mt_NameAsTooltip
@ mt_NameAsTooltip
Definition: listpopupmenu.h:184
PinPortBase::boundingRect
virtual QRectF boundingRect() const
Definition: pinportbase.cpp:166
Uml::ID::Type
std::string Type
Definition: basictypes.h:368
PinPortBase::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: pinportbase.cpp:152
FloatingTextWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: floatingtextwidget.cpp:649
PinPortBase::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: pinportbase.cpp:174
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
PinPortBase::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: pinportbase.cpp:269
childwidgetplacementpin.h
Uml::TextRole::Floating
@ Floating
Definition: basictypes.h:196
floatingtextwidget.h
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1285
IDChangeLog
Definition: idchangelog.h:27
WidgetBase::widgetWithID
virtual UMLWidget * widgetWithID(Uml::ID::Type id)
Definition: widgetbase.cpp:255
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
WidgetBase::wt_Pin
@ wt_Pin
Definition: widgetbase.h:138
UMLWidget::setX
virtual void setX(qreal x)
Definition: umlwidget.cpp:1685
PinPortBase
Abstract base class for PinWidget and PortWidget.
Definition: pinportbase.h:28
PinPortBase::m_pName
FloatingTextWidget * m_pName
Definition: pinportbase.h:67
PinPortBase::~PinPortBase
virtual ~PinPortBase()
Definition: pinportbase.cpp:50
WidgetBase::wt_Port
@ wt_Port
Definition: widgetbase.h:142
UMLWidget::m_ignoreSnapToGrid
bool m_ignoreSnapToGrid
Definition: umlwidget.h:317
umlwidget.h
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
PinPortBase::activate
bool activate(IDChangeLog *changeLog=0)
Definition: pinportbase.cpp:323
PinPortBase::onWidget
UMLWidget * onWidget(const QPointF &p)
Definition: pinportbase.cpp:242
uDebug
#define uDebug()
Definition: debug_utils.h:122
PinPortBase::updateWidget
void updateWidget()
Definition: pinportbase.cpp:102
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:37
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:316
PinPortBase::setName
void setName(const QString &strName)
Definition: pinportbase.cpp:116
PinPortBase::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: pinportbase.cpp:285
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
UMLScene::findWidget
UMLWidget * findWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1184
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
UMLWidget::init
void init()
Definition: umlwidget.cpp:698
childwidgetplacementport.h
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
PinPortBase::notifyParentResize
virtual void notifyParentResize()
Definition: pinportbase.cpp:144
uError
#define uError()
Definition: debug_utils.h:123
umlscene.h
UMLWidget::setSize
void setSize(qreal width, qreal height)
Definition: umlwidget.cpp:1745
debug_utils.h
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:111
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:43
UMLWidget::updateGeometry
void updateGeometry(bool withAssocs=true)
Definition: umlwidget.cpp:1781
ChildWidgetPlacement
Base class for child widget placement.
Definition: childwidgetplacement.h:27
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
listpopupmenu.h
PinPortBase::createPlacement
ChildWidgetPlacement * createPlacement(WidgetBase::WidgetType type)
Definition: pinportbase.cpp:54
PinPortBase::setFloatingTextWidget
void setFloatingTextWidget(FloatingTextWidget *ft)
Definition: pinportbase.cpp:227
PinPortBase::PinPortBase
PinPortBase(UMLScene *scene, WidgetType type, UMLWidget *owner, UMLObject *o)
Definition: pinportbase.cpp:33
WidgetBase::setName
virtual void setName(const QString &strName)
Definition: widgetbase.cpp:322
package.h
ChildWidgetPlacementPin
Child widget placement attached to parent.
Definition: childwidgetplacementpin.h:23
FloatingTextWidget::text
QString text() const
Definition: floatingtextwidget.cpp:88
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
WidgetBase::baseType
WidgetType baseType() const
Definition: widgetbase.cpp:115
UMLWidget::setMinimumSize
void setMinimumSize(const QSizeF &size)
Definition: umlwidget.cpp:230
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
umldoc.h
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:86
FloatingTextWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: floatingtextwidget.cpp:676
PinPortBase::moveWidgetBy
void moveWidgetBy(qreal diffX, qreal diffY)
Definition: pinportbase.cpp:135
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869
UMLWidget::m_resizable
bool m_resizable
Definition: umlwidget.h:306