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

umldragdata.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) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef UMLDRAGDATA_H
12 #define UMLDRAGDATA_H
13
14 #include "associationwidgetlist.h"
15 #include "basictypes.h"
16 #include "umllistviewitem.h"
17 #include "umllistviewitemlist.h"
18 #include "umlobjectlist.h"
19 #include "umlviewlist.h"
20 #include "umlwidgetlist.h"
21
22 #include <QList>
23 #include <QMimeData>
24
25 class UMLClassifier;
26 class UMLListView;
27 class UMLScene;
28 class QPixmap;
29
37 class UMLDragData : public QMimeData
38 {
39 Q_OBJECT
40 public:
41
42 explicit UMLDragData(UMLObjectList& Objects, QWidget* dragSource = 0);
43
44 UMLDragData(UMLObjectList &Objects, UMLViewList& Diagrams, QWidget * dragSource = 0);
45
46 explicit UMLDragData(UMLListViewItemList& UMLListViewItems, QWidget* dragSource = 0);
47
48 UMLDragData(UMLObjectList& Objects, UMLWidgetList& Widgets, AssociationWidgetList& Associations,
49 QPixmap& PngImage, UMLScene *scene, QWidget* dragSource = 0);
50
51 UMLDragData(UMLObjectList& Objects, int, QWidget* dragSource = 0);
52
53 explicit UMLDragData(QWidget* dragSource = 0);
54
55 ~UMLDragData();
56
57 static bool decodeClip1(const QMimeData* mimeData, UMLObjectList& objects);
58
59 static bool decodeClip2(const QMimeData* mimeData, UMLObjectList& objects, UMLViewList& diagrams);
60
61 static bool decodeClip3(const QMimeData* mimeData,
62 UMLListViewItemList& umlListViewItems,
63 const UMLListView* parentListView=0);
64
65 struct LvTypeAndID {
66 UMLListViewItem::ListViewType type;
67 Uml::ID::Type id;
68 };
69 typedef QList<LvTypeAndID*> LvTypeAndID_List;
70 typedef QListIterator<LvTypeAndID*> LvTypeAndID_It;
71
72 static bool getClip3TypeAndID(const QMimeData* mimeData,
73 LvTypeAndID_List& typeAndIdList);
74
75 static bool decodeClip4(const QMimeData* mimeData, UMLObjectList& objects,
76 UMLWidgetList& widgets,
77 AssociationWidgetList& associations,
78 Uml::DiagramType::Enum & dType);
79
80 static bool decodeClip5(const QMimeData* mimeData, UMLObjectList& objects,
81 UMLClassifier *newParent);
82
83 static int getCodingType(const QMimeData* mimeData);
84
85 private:
86
87 void setUMLDataClip1(UMLObjectList& Objects);
88
89 void setUMLDataClip2(UMLObjectList& Objects, UMLViewList& Diagrams);
90
91 void setUMLDataClip3(UMLListViewItemList& UMLListViewItems);
92
93 void setUMLDataClip4(UMLObjectList& Objects,
94 UMLWidgetList& WidgetDatas,
95 AssociationWidgetList& Associations, QPixmap& PngImage,
96 UMLScene *scene);
97
98 void setUMLDataClip5(UMLObjectList& Objects);
99
100 static void executeCreateWidgetCommand(UMLWidget* widget);
101
102 static bool decodeObjects(QDomNode& objectsNode, UMLObjectList& objects,
103 bool skipIfObjectExists = false);
104
105 static bool decodeViews(QDomNode& umlviewsNode, UMLViewList& diagrams);
106 };
107
108 #endif
UMLDragData::setUMLDataClip3
void setUMLDataClip3(UMLListViewItemList &UMLListViewItems)
Definition: umldragdata.cpp:170
notewidget.h
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
UMLApp::currentView
UMLView * currentView() const
Definition: uml.cpp:3166
UMLScene::createAutoAttributeAssociations2
void createAutoAttributeAssociations2(UMLWidget *widget)
Definition: umlscene.cpp:2813
WidgetBase::asPreconditionWidget
PreconditionWidget * asPreconditionWidget()
Definition: widgetbase.cpp:1489
UMLDragData::executeCreateWidgetCommand
static void executeCreateWidgetCommand(UMLWidget *widget)
Definition: umldragdata.cpp:722
WidgetBase::isMessageWidget
bool isMessageWidget()
Definition: widgetbase.h:256
umllistviewitemlist.h
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
MessageWidget::floatingTextWidget
FloatingTextWidget * floatingTextWidget()
Definition: messagewidget.h:96
UMLDragData::decodeViews
static bool decodeViews(QDomNode &umlviewsNode, UMLViewList &diagrams)
Definition: umldragdata.cpp:835
UMLDragData::setUMLDataClip5
void setUMLDataClip5(UMLObjectList &Objects)
Definition: umldragdata.cpp:237
UMLDragData::decodeClip2
static bool decodeClip2(const QMimeData *mimeData, UMLObjectList &objects, UMLViewList &diagrams)
Definition: umldragdata.cpp:299
Uml::CmdCreateWidget
Definition: cmdcreatewidget.h:24
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
IDChangeLog::findNewID
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:62
UMLListViewItem::ListViewType
ListViewType
Definition: umllistviewitem.h:43
WidgetBase::setLocalID
void setLocalID(Uml::ID::Type id)
Definition: widgetbase.cpp:226
UMLListViewItem::umlObject
UMLObject * umlObject() const
Definition: umllistviewitem.cpp:312
Model_Utils::typeIsAllowedInDiagram
bool typeIsAllowedInDiagram(UMLObject *o, UMLScene *scene)
Definition: model_utils.cpp:2167
AssociationWidget::create
static AssociationWidget * create(UMLScene *scene)
Definition: associationwidget.cpp:102
UMLObject::resolveRef
virtual bool resolveRef()
Definition: umlobject.cpp:739
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:40
WidgetBase::localID
Uml::ID::Type localID() const
Definition: widgetbase.cpp:238
WidgetBase::setID
void setID(Uml::ID::Type id)
Definition: widgetbase.cpp:200
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
UMLDragData::LvTypeAndID
Definition: umldragdata.h:65
UMLDragData::decodeClip1
static bool decodeClip1(const QMimeData *mimeData, UMLObjectList &objects)
Definition: umldragdata.cpp:258
UMLObject::setID
virtual void setID(Uml::ID::Type NewID)
Definition: umlobject.cpp:183
UMLDoc::addUMLObject
bool addUMLObject(UMLObject *object)
Definition: umldoc.cpp:1180
WidgetBase::isPreconditionWidget
bool isPreconditionWidget()
Definition: widgetbase.h:264
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:77
object_factory.h
PreconditionWidget::resolveObjectWidget
void resolveObjectWidget(IDChangeLog *log)
Definition: preconditionwidget.cpp:177
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
UMLClassifier::makeChildObject
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
Definition: classifier.cpp:1444
cmds.h
UMLListView::findFolderForDiagram
UMLListViewItem * findFolderForDiagram(Uml::DiagramType::Enum dt)
Definition: umllistview.cpp:821
Model_Utils::hasAssociations
bool hasAssociations(UMLObject::ObjectType type)
Definition: model_utils.cpp:2295
umlwidgetlist.h
UMLDragData
Definition: umldragdata.h:38
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
UMLDragData::getClip3TypeAndID
static bool getClip3TypeAndID(const QMimeData *mimeData, LvTypeAndID_List &typeAndIdList)
Definition: umldragdata.cpp:351
WidgetBase::asMessageWidget
MessageWidget * asMessageWidget()
Definition: widgetbase.cpp:1480
model_utils.h
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLDragData::UMLDragData
UMLDragData(UMLObjectList &Objects, QWidget *dragSource=0)
Definition: umldragdata.cpp:46
UMLDragData::LvTypeAndID_It
QListIterator< LvTypeAndID * > LvTypeAndID_It
Definition: umldragdata.h:70
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
UMLListViewItem::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umllistviewitem.cpp:891
UMLScene::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlscene.cpp:3753
UMLDragData::LvTypeAndID::id
Uml::ID::Type id
Definition: umldragdata.h:67
UMLObject::asUMLFolder
UMLFolder * asUMLFolder()
Definition: umlobject.cpp:1318
floatingtextwidget.h
UMLDoc::signalUMLObjectCreated
void signalUMLObjectCreated(UMLObject *o)
Definition: umldoc.cpp:1985
UMLDragData::getCodingType
static int getCodingType(const QMimeData *mimeData)
Definition: umldragdata.cpp:879
WidgetBase::isObjectWidget
bool isObjectWidget()
Definition: widgetbase.h:260
UMLDragData::LvTypeAndID::type
UMLListViewItem::ListViewType type
Definition: umldragdata.h:66
UMLDragData::~UMLDragData
~UMLDragData()
Definition: umldragdata.cpp:111
Model_Utils::isCloneable
bool isCloneable(WidgetBase::WidgetType type)
Definition: model_utils.cpp:53
UMLDragData::decodeClip3
static bool decodeClip3(const QMimeData *mimeData, UMLListViewItemList &umlListViewItems, const UMLListView *parentListView=0)
Definition: umldragdata.cpp:413
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1268
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:19
umldragdata.h
WidgetBase::umlObject
UMLObject * umlObject() const
Definition: widgetbase.cpp:182
IDChangeLog
Definition: idchangelog.h:27
UMLDragData::setUMLDataClip2
void setUMLDataClip2(UMLObjectList &Objects, UMLViewList &Diagrams)
Definition: umldragdata.cpp:141
NoteWidget::s_pCurrentNote
static QPointer< NoteWidget > s_pCurrentNote
Definition: notewidget.h:68
Uml::DiagramType::fromInt
Enum fromInt(int item)
Definition: basictypes.cpp:267
UMLView
Definition: umlview.h:35
uniqueid.h
UMLDoc::findObjectById
UMLObject * findObjectById(Uml::ID::Type id)
Definition: umldoc.cpp:1038
umlviewlist.h
objectwidget.h
UMLApp::listView
UMLListView * listView() const
Definition: uml.cpp:1074
umlwidget.h
uWarning
#define uWarning()
Definition: debug_utils.h:124
UMLScene::type
Uml::DiagramType::Enum type() const
Definition: umlscene.cpp:426
UMLObject::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlobject.cpp:834
UMLObjectListIt
QListIterator< QPointer< UMLObject > > UMLObjectListIt
Definition: umlobjectlist.h:19
folder.h
UMLScene::loadWidgetFromXMI
UMLWidget * loadWidgetFromXMI(QDomElement &widgetElement)
Definition: umlscene.cpp:3976
messagewidget.h
basictypes.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:17
uDebug
#define uDebug()
Definition: debug_utils.h:122
AssociationWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement, const UMLWidgetList &widgets, const MessageWidgetList *messages)
Definition: associationwidget.cpp:4014
umllistview.h
UMLDoc::assignNewID
Uml::ID::Type assignNewID(Uml::ID::Type oldID)
Definition: umldoc.cpp:3272
WidgetBase::setUMLObject
virtual void setUMLObject(UMLObject *obj)
Definition: widgetbase.cpp:192
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
UMLDoc
Definition: umldoc.h:75
UMLListViewItem::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: umllistviewitem.cpp:934
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:35
AssociationWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: associationwidget.cpp:3967
umllistviewitem.h
associationwidget.h
UMLListView::slotObjectCreated
void slotObjectCreated(UMLObject *object)
Definition: umllistview.cpp:959
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
UMLObject::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &element)
Definition: umlobject.cpp:955
umlscene.h
uml.h
UMLDoc::changeLog
virtual IDChangeLog * changeLog()
Definition: umldoc.cpp:3236
UMLObject::setUMLPackage
bool setUMLPackage(UMLPackage *pPkg)
Definition: umlobject.cpp:616
Object_Factory::makeObjectFromXMI
UMLObject * makeObjectFromXMI(const QString &xmiTag, const QString &stereoID)
Definition: object_factory.cpp:374
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLScene
Definition: umlscene.h:69
UMLScene::createAutoAssociations
void createAutoAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2412
umlobject.h
UMLDragData::decodeClip5
static bool decodeClip5(const QMimeData *mimeData, UMLObjectList &objects, UMLClassifier *newParent)
Definition: umldragdata.cpp:663
UMLDragData::decodeClip4
static bool decodeClip4(const QMimeData *mimeData, UMLObjectList &objects, UMLWidgetList &widgets, AssociationWidgetList &associations, Uml::DiagramType::Enum &dType)
Definition: umldragdata.cpp:481
preconditionwidget.h
associationwidgetlist.h
Model_Utils::treeViewGetPackageFromCurrent
UMLPackage * treeViewGetPackageFromCurrent()
Definition: model_utils.cpp:464
PreconditionWidget
A graphical version of a UML Precondition (new in UML 2.0).
Definition: preconditionwidget.h:33
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:56
idchangelog.h
UMLObject::asUMLPackage
UMLPackage * asUMLPackage()
Definition: umlobject.cpp:1325
UMLListView
Displays the list view for the program.
Definition: umllistview.h:47
umlobjectlist.h
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:442
UMLScene::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlscene.cpp:3828
MessageWidget::resolveObjectWidget
void resolveObjectWidget(IDChangeLog *log)
Definition: messagewidget.cpp:885
UMLApp::executeCommand
void executeCommand(QUndoCommand *cmd)
Definition: uml.cpp:3438
UMLObject::ot_Folder
@ ot_Folder
Definition: umlobject.h:103
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26
UMLDragData::LvTypeAndID_List
QList< LvTypeAndID * > LvTypeAndID_List
Definition: umldragdata.h:69
Uml::CmdCreateUMLObject
Definition: cmdcreateumlobject.h:23
UMLDragData::decodeObjects
static bool decodeObjects(QDomNode &objectsNode, UMLObjectList &objects, bool skipIfObjectExists=false)
Definition: umldragdata.cpp:730
UMLObjectList
Definition: umlobjectlist.h:29
WidgetBase::baseType
WidgetType baseType() const
Definition: widgetbase.cpp:115
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
MessageWidget
Displays a message.
Definition: messagewidget.h:41
UMLDoc::findView
UMLView * findView(Uml::ID::Type id)
Definition: umldoc.cpp:1005
UMLListView::determineParentItem
UMLListViewItem * determineParentItem(UMLObject *object) const
Definition: umllistview.cpp:880
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
UMLDragData::setUMLDataClip4
void setUMLDataClip4(UMLObjectList &Objects, UMLWidgetList &WidgetDatas, AssociationWidgetList &Associations, QPixmap &PngImage, UMLScene *scene)
Definition: umldragdata.cpp:192
umldoc.h
UMLDragData::setUMLDataClip1
void setUMLDataClip1(UMLObjectList &Objects)
Definition: umldragdata.cpp:119
UMLListViewItemList
QList< UMLListViewItem * > UMLListViewItemList
Definition: umllistviewitemlist.h:24
WidgetBase::id
Uml::ID::Type id() const
Definition: widgetbase.cpp:214
UMLObject::clone
virtual UMLObject * clone() const
Definition: umlobject.cpp:338
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33