umbrello: umbrello/umlwidgets/childwidgetplacement.h Source File

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

childwidgetplacement.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) 2016-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef CHILDWIDGETPLACEMENT_H
12 #define CHILDWIDGETPLACEMENT_H
13
14 class PinPortBase;
15 class UMLWidget;
16
17 #include <QPointF>
18 #include <QtGlobal>
19
26 class ChildWidgetPlacement
27 {
28 public:
29 ChildWidgetPlacement(PinPortBase* widget);
30 virtual ~ChildWidgetPlacement() {}
31
32 virtual void detectConnectedSide() = 0;
33 virtual void setInitialPosition(const QPointF &scenePos = QPointF()) = 0;
34 virtual void setNewPositionWhenMoved(qreal diffX, qreal diffY) = 0;
35 virtual void setNewPositionOnParentResize() = 0;
36
37 protected:
38 enum ConnectedSide {
39 Undefined,
40 Top,
41 Right,
42 Bottom,
43 Left,
44 TopLeft,
45 TopRight,
46 BottomRight,
47 BottomLeft
48 };
49
50 void setPos(const QPointF& pos);
51 void setPos(qreal x, qreal y);
52 void setX(qreal x);
53 void setY(qreal y);
54 qreal x() const;
55 qreal y() const;
56 qreal width() const;
57 qreal height() const;
58 UMLWidget* ownerWidget() const;
59
60 PinPortBase* const m_widget;
61 ConnectedSide m_connectedSide;
62 };
63
64 #endif /* ! CHILDWIDGETPLACEMENT_H */
65
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
ChildWidgetPlacement::Bottom
@ Bottom
Definition: childwidgetplacement.h:42
ChildWidgetPlacement::width
qreal width() const
Definition: childwidgetplacement.cpp:50
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
ChildWidgetPlacement::y
qreal y() const
Definition: childwidgetplacement.cpp:45
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
ChildWidgetPlacement::TopRight
@ TopRight
Definition: childwidgetplacement.h:45
ChildWidgetPlacement::Left
@ Left
Definition: childwidgetplacement.h:43
ChildWidgetPlacement::setInitialPosition
virtual void setInitialPosition(const QPointF &scenePos=QPointF())=0
ChildWidgetPlacement::~ChildWidgetPlacement
virtual ~ChildWidgetPlacement()
Definition: childwidgetplacement.h:30
pinportbase.h
ChildWidgetPlacement::ConnectedSide
ConnectedSide
Definition: childwidgetplacement.h:38
ChildWidgetPlacement::Top
@ Top
Definition: childwidgetplacement.h:40
ChildWidgetPlacement::Right
@ Right
Definition: childwidgetplacement.h:41
ChildWidgetPlacement::setY
void setY(qreal y)
Definition: childwidgetplacement.cpp:35
ChildWidgetPlacement::setX
void setX(qreal x)
Definition: childwidgetplacement.cpp:30
ChildWidgetPlacement::BottomRight
@ BottomRight
Definition: childwidgetplacement.h:46
ChildWidgetPlacement::setPos
void setPos(const QPointF &pos)
Definition: childwidgetplacement.cpp:20
ChildWidgetPlacement::x
qreal x() const
Definition: childwidgetplacement.cpp:40
childwidgetplacement.h
UMLWidget::setX
virtual void setX(qreal x)
Definition: umlwidget.cpp:1685
PinPortBase
Abstract base class for PinWidget and PortWidget.
Definition: pinportbase.h:28
ChildWidgetPlacement::ownerWidget
UMLWidget * ownerWidget() const
Definition: childwidgetplacement.cpp:60
ChildWidgetPlacement::height
qreal height() const
Definition: childwidgetplacement.cpp:55
ChildWidgetPlacement::detectConnectedSide
virtual void detectConnectedSide()=0
ChildWidgetPlacement::Undefined
@ Undefined
Definition: childwidgetplacement.h:39
ChildWidgetPlacement::setNewPositionOnParentResize
virtual void setNewPositionOnParentResize()=0
ChildWidgetPlacement::m_widget
PinPortBase *const m_widget
Definition: childwidgetplacement.h:60
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
ChildWidgetPlacement
Base class for child widget placement.
Definition: childwidgetplacement.h:27
ChildWidgetPlacement::ChildWidgetPlacement
ChildWidgetPlacement(PinPortBase *widget)
Definition: childwidgetplacement.cpp:15
ChildWidgetPlacement::setNewPositionWhenMoved
virtual void setNewPositionWhenMoved(qreal diffX, qreal diffY)=0
ChildWidgetPlacement::m_connectedSide
ConnectedSide m_connectedSide
Definition: childwidgetplacement.h:61
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
ChildWidgetPlacement::BottomLeft
@ BottomLeft
Definition: childwidgetplacement.h:47
ChildWidgetPlacement::TopLeft
@ TopLeft
Definition: childwidgetplacement.h:44
PinPortBase::ownerWidget
virtual UMLWidget * ownerWidget() const
Definition: pinportbase.cpp:86