umbrello: umbrello/toolbarstate.h Source File

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

toolbarstate.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) 2004-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef TOOLBARSTATE_H
12 #define TOOLBARSTATE_H
13
14 #include <QEvent>
15 #include <QObject>
16 #include <QPointF>
17
18 class AssociationWidget;
19 class FloatingDashLineWidget;
20 class MessageWidget;
21 class QGraphicsSceneMouseEvent;
22 class UMLScene;
23 class UMLWidget;
24
69 class ToolBarState: public QObject
70 {
71 Q_OBJECT
72 public:
73 virtual ~ToolBarState();
74
75 virtual void init();
76
77 virtual void cleanBeforeChange();
78
79 virtual void mousePress(QGraphicsSceneMouseEvent* ome);
80 virtual void mouseRelease(QGraphicsSceneMouseEvent* ome);
81 virtual void mouseDoubleClick(QGraphicsSceneMouseEvent* ome);
82 virtual void mouseMove(QGraphicsSceneMouseEvent* ome);
83
84 public slots:
85 virtual void slotAssociationRemoved(AssociationWidget* association);
86 virtual void slotWidgetRemoved(UMLWidget* widget);
87
88 signals:
89 // signals finish of operation
90 void finished();
91
92 protected:
93 ToolBarState(UMLScene* umlScene);
94
95 virtual void setCurrentElement();
96
97 virtual void mousePressAssociation();
98 virtual void mousePressWidget();
99 virtual void mousePressEmpty();
100 virtual void mouseReleaseAssociation();
101 virtual void mouseReleaseWidget();
102 virtual void mouseReleaseEmpty();
103 virtual void mouseDoubleClickAssociation();
104 virtual void mouseDoubleClickWidget();
105 virtual void mouseDoubleClickEmpty();
106 virtual void mouseMoveAssociation();
107 virtual void mouseMoveWidget();
108 virtual void mouseMoveEmpty();
109
110 virtual void changeTool();
111
112 virtual UMLWidget* currentWidget() const;
113 virtual void setCurrentWidget(UMLWidget* widget);
114
115 virtual AssociationWidget* currentAssociation() const;
116 virtual void setCurrentAssociation(AssociationWidget* association);
117
118 void setMouseEvent(QGraphicsSceneMouseEvent* ome, const QEvent::Type &type);
119
120 AssociationWidget* associationAt(const QPointF& pos);
121 MessageWidget* messageAt(const QPointF& pos);
122 FloatingDashLineWidget* floatingLineAt(const QPointF& pos);
123
124 UMLScene* m_pUMLScene;
125 QGraphicsSceneMouseEvent* m_pMouseEvent;
126 // This event is the equivalent of the received event after transforming it
127 // using the inverse world matrix in the UMLScene.
128
129 private:
130 UMLWidget* m_currentWidget;
131 AssociationWidget* m_currentAssociation;
132
133 };
134
135 #endif //TOOLBARSTATE_H
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:34
MessageWidget
Displays a message.
Definition: messagewidget.h:41
ToolBarState
Definition: toolbarstate.h:70
ToolBarState::slotAssociationRemoved
virtual void slotAssociationRemoved(AssociationWidget *association)
Definition: toolbarstate.cpp:229
ToolBarState::mousePressEmpty
virtual void mousePressEmpty()
Definition: toolbarstate.cpp:337
ToolBarState::setCurrentElement
virtual void setCurrentElement()
Definition: toolbarstate.cpp:273
ToolBarState::setCurrentWidget
virtual void setCurrentWidget(UMLWidget *widget)
Definition: toolbarstate.cpp:452
ToolBarState::mouseReleaseEmpty
virtual void mouseReleaseEmpty()
Definition: toolbarstate.cpp:364
ToolBarState::mouseDoubleClickAssociation
virtual void mouseDoubleClickAssociation()
Definition: toolbarstate.cpp:372
ToolBarState::init
virtual void init()
Definition: toolbarstate.cpp:41
ToolBarState::messageAt
MessageWidget * messageAt(const QPointF &pos)
Definition: toolbarstate.cpp:516
ToolBarState::mouseMove
virtual void mouseMove(QGraphicsSceneMouseEvent *ome)
Definition: toolbarstate.cpp:181
ToolBarState::mouseMoveEmpty
virtual void mouseMoveEmpty()
Definition: toolbarstate.cpp:418
ToolBarState::ToolBarState
ToolBarState(UMLScene *umlScene)
Definition: toolbarstate.cpp:257
ToolBarState::~ToolBarState
virtual ~ToolBarState()
Definition: toolbarstate.cpp:32
ToolBarState::currentAssociation
virtual AssociationWidget * currentAssociation() const
Definition: toolbarstate.cpp:462
ToolBarState::currentWidget
virtual UMLWidget * currentWidget() const
Definition: toolbarstate.cpp:438
ToolBarState::cleanBeforeChange
virtual void cleanBeforeChange()
Definition: toolbarstate.cpp:60
ToolBarState::mouseMoveAssociation
virtual void mouseMoveAssociation()
Definition: toolbarstate.cpp:400
ToolBarState::finished
void finished()
ToolBarState::mouseMoveWidget
virtual void mouseMoveWidget()
Definition: toolbarstate.cpp:409
ToolBarState::mousePress
virtual void mousePress(QGraphicsSceneMouseEvent *ome)
Definition: toolbarstate.cpp:79
ToolBarState::m_currentAssociation
AssociationWidget * m_currentAssociation
The association currently in use, if any.
Definition: toolbarstate.h:131
ToolBarState::setMouseEvent
void setMouseEvent(QGraphicsSceneMouseEvent *ome, const QEvent::Type &type)
Definition: toolbarstate.cpp:489
ToolBarState::m_pUMLScene
UMLScene * m_pUMLScene
The UMLScene.
Definition: toolbarstate.h:124
ToolBarState::mouseDoubleClickEmpty
virtual void mouseDoubleClickEmpty()
Definition: toolbarstate.cpp:388
ToolBarState::setCurrentAssociation
virtual void setCurrentAssociation(AssociationWidget *association)
Definition: toolbarstate.cpp:476
ToolBarState::m_currentWidget
UMLWidget * m_currentWidget
The widget currently in use, if any.
Definition: toolbarstate.h:130
ToolBarState::mouseReleaseWidget
virtual void mouseReleaseWidget()
Definition: toolbarstate.cpp:356
ToolBarState::mousePressAssociation
virtual void mousePressAssociation()
Definition: toolbarstate.cpp:321
ToolBarState::changeTool
virtual void changeTool()
Definition: toolbarstate.cpp:426
ToolBarState::mouseReleaseAssociation
virtual void mouseReleaseAssociation()
Definition: toolbarstate.cpp:348
ToolBarState::mousePressWidget
virtual void mousePressWidget()
Definition: toolbarstate.cpp:329
ToolBarState::mouseDoubleClickWidget
virtual void mouseDoubleClickWidget()
Definition: toolbarstate.cpp:380
ToolBarState::mouseDoubleClick
virtual void mouseDoubleClick(QGraphicsSceneMouseEvent *ome)
Definition: toolbarstate.cpp:144
ToolBarState::slotWidgetRemoved
virtual void slotWidgetRemoved(UMLWidget *widget)
Definition: toolbarstate.cpp:242
ToolBarState::associationAt
AssociationWidget * associationAt(const QPointF &pos)
Definition: toolbarstate.cpp:534
ToolBarState::m_pMouseEvent
QGraphicsSceneMouseEvent * m_pMouseEvent
The mouse event currently in use.
Definition: toolbarstate.h:125
ToolBarState::mouseRelease
virtual void mouseRelease(QGraphicsSceneMouseEvent *ome)
Definition: toolbarstate.cpp:111
ToolBarState::floatingLineAt
FloatingDashLineWidget * floatingLineAt(const QPointF &pos)
Definition: toolbarstate.cpp:551
UMLScene
Definition: umlscene.h:70
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
Uml::ID::Type
std::string Type
Definition: basictypes.h:385