umbrello: umbrello/clipboard/umldragdata.h Source File

umbrello 2.31.0 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:3144
UMLScene::createAutoAttributeAssociations2
void createAutoAttributeAssociations2(UMLWidget *widget)
Definition: umlscene.cpp:2796
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:51
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:23
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:40
IDChangeLog::findNewID
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:62
UMLListViewItem::ListViewType
ListViewType
Definition: umllistviewitem.h:42
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:2168
AssociationWidget::create
static AssociationWidget * create(UMLScene *scene)
Definition: associationwidget.cpp:102
UMLObject::resolveRef
virtual bool resolveRef()
Definition: umlobject.cpp:738
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:39
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:370
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:1178
WidgetBase::isPreconditionWidget
bool isPreconditionWidget()
Definition: widgetbase.h:264
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:94
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:1280
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:820
Model_Utils::hasAssociations
bool hasAssociations(UMLObject::ObjectType type)
Definition: model_utils.cpp:2296
umlwidgetlist.h
UMLDragData
Definition: umldragdata.h:37
Uml::ID::Type
std::string Type
Definition: basictypes.h:368
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:73
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:3736
UMLDragData::LvTypeAndID::id
Uml::ID::Type id
Definition: umldragdata.h:67
UMLObject::asUMLFolder
UMLFolder * asUMLFolder()
Definition: umlobject.cpp:1317
floatingtextwidget.h
UMLDoc::signalUMLObjectCreated
void signalUMLObjectCreated(UMLObject *o)
Definition: umldoc.cpp:1983
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:61
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:1285
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:19
umldragdata.h
WidgetBase::umlObject
UMLObject * umlObject() const
Definition: widgetbase.cpp:182
IDChangeLog
Definition: idchangelog.h:26
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:284
UMLView
Definition: umlview.h:34
uniqueid.h
UMLDoc::findObjectById
UMLObject * findObjectById(Uml::ID::Type id)
Definition: umldoc.cpp:1036
umlviewlist.h
objectwidget.h
UMLApp::listView
UMLListView * listView() const
Definition: uml.cpp:1065
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:833
UMLObjectListIt
QListIterator< QPointer< UMLObject > > UMLObjectListIt
Definition: umlobjectlist.h:19
folder.h
UMLScene::loadWidgetFromXMI
UMLWidget * loadWidgetFromXMI(QDomElement &widgetElement)
Definition: umlscene.cpp:3959
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:3261
WidgetBase::setUMLObject
virtual void setUMLObject(UMLObject *obj)
Definition: widgetbase.cpp:192
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
UMLDoc
Definition: umldoc.h:74
UMLListViewItem::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: umllistviewitem.cpp:934
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:34
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:958
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
UMLObject::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &element)
Definition: umlobject.cpp:954
umlscene.h
uml.h
UMLDoc::changeLog
virtual IDChangeLog * changeLog()
Definition: umldoc.cpp:3225
UMLObject::setUMLPackage
bool setUMLPackage(UMLPackage *pPkg)
Definition: umlobject.cpp:615
Object_Factory::makeObjectFromXMI
UMLObject * makeObjectFromXMI(const QString &xmiTag, const QString &stereoID)
Definition: object_factory.cpp:382
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:39
debug_utils.h
UMLScene
Definition: umlscene.h:68
UMLScene::createAutoAssociations
void createAutoAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2397
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:465
PreconditionWidget
A graphical version of a UML Precondition (new in UML 2.0).
Definition: preconditionwidget.h:32
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:1324
UMLListView
Displays the list view for the program.
Definition: umllistview.h:46
umlobjectlist.h
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:442
UMLScene::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlscene.cpp:3811
MessageWidget::resolveObjectWidget
void resolveObjectWidget(IDChangeLog *log)
Definition: messagewidget.cpp:885
UMLApp::executeCommand
void executeCommand(QUndoCommand *cmd)
Definition: uml.cpp:3416
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:22
UMLDragData::decodeObjects
static bool decodeObjects(QDomNode &objectsNode, UMLObjectList &objects, bool skipIfObjectExists=false)
Definition: umldragdata.cpp:730
UMLObjectList
Definition: umlobjectlist.h:28
WidgetBase::baseType
WidgetType baseType() const
Definition: widgetbase.cpp:115
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:29
MessageWidget
Displays a message.
Definition: messagewidget.h:40
UMLDoc::findView
UMLView * findView(Uml::ID::Type id)
Definition: umldoc.cpp:1003
UMLListView::determineParentItem
UMLListViewItem * determineParentItem(UMLObject *object) const
Definition: umllistview.cpp:879
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
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:32