umbrello: umbrello/clipboard/umldragdata.h Source File

umbrello 25.08.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 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef UMLDRAGDATA_H
7#define UMLDRAGDATA_H
8
9#include "associationwidgetlist.h"
10#include "basictypes.h"
11#include "umllistviewitem.h"
12#include "umllistviewitemlist.h"
13#include "umlobjectlist.h"
14#include "umlviewlist.h"
15#include "umlwidgetlist.h"
16
17#include <QList>
18#include <QMimeData>
19
20class UMLClassifier;
21class UMLListView;
22class UMLScene;
23class QPixmap;
24
32 class UMLDragData : public QMimeData
33{
34 Q_OBJECT
35public:
36
37 explicit UMLDragData(UMLObjectList& Objects, QWidget *dragSource = nullptr);
38
39 UMLDragData(UMLObjectList &Objects, UMLViewList& Diagrams, QWidget *dragSource = nullptr);
40
41 explicit UMLDragData(UMLListViewItemList& UMLListViewItems, QWidget *dragSource = nullptr);
42
43 UMLDragData(UMLObjectList& Objects, UMLWidgetList& Widgets, AssociationWidgetList& Associations,
44 QPixmap& PngImage, UMLScene *scene, QWidget *dragSource = nullptr);
45
46 UMLDragData(UMLObjectList& Objects, int, QWidget *dragSource = nullptr);
47
48 explicit UMLDragData(QWidget *dragSource = nullptr);
49
50 ~UMLDragData();
51
52 static bool decodeClip1(const QMimeData* mimeData, UMLObjectList& objects);
53
54 static bool decodeClip2(const QMimeData* mimeData, UMLObjectList& objects, UMLViewList& diagrams);
55
56 static bool decodeClip3(const QMimeData* mimeData,
57 UMLListViewItemList& umlListViewItems,
58 const UMLListView *parentListView= nullptr);
59
60 struct LvTypeAndID {
61 UMLListViewItem::ListViewType type;
62 Uml::ID::Type id;
63 };
64 typedef QList<LvTypeAndID*> LvTypeAndID_List;
65 typedef QListIterator<LvTypeAndID*> LvTypeAndID_It;
66
67 static bool getClip3TypeAndID(const QMimeData* mimeData,
68 LvTypeAndID_List& typeAndIdList);
69
70 static bool decodeClip4(const QMimeData* mimeData, UMLObjectList& objects,
71 UMLWidgetList& widgets,
72 AssociationWidgetList& associations,
73 Uml::DiagramType::Enum & dType);
74
75 static bool decodeClip5(const QMimeData* mimeData, UMLObjectList& objects,
76 UMLClassifier *newParent);
77
78 static int getCodingType(const QMimeData* mimeData);
79
80 private:
81
82 void setUMLDataClip1(UMLObjectList& Objects);
83
84 void setUMLDataClip2(UMLObjectList& Objects, UMLViewList& Diagrams);
85
86 void setUMLDataClip3(UMLListViewItemList& UMLListViewItems);
87
88 void setUMLDataClip4(UMLObjectList& Objects,
89 UMLWidgetList& WidgetDatas,
90 AssociationWidgetList& Associations, QPixmap& PngImage,
91 UMLScene *scene);
92
93 void setUMLDataClip5(UMLObjectList& Objects);
94
95 static void executeCreateWidgetCommand(UMLWidget* widget);
96
97 static bool decodeObjects(QDomNode& objectsNode, UMLObjectList& objects,
98 bool skipIfObjectExists = false);
99
100 static bool decodeViews(QDomNode& umlviewsNode, UMLViewList& diagrams);
101};
102
103#endif
associationwidgetlist.h
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition associationwidgetlist.h:17
basictypes.h
UMLClassifier
Information for a non-graphical Concept/Class.
Definition classifier.h:35
UMLDragData::executeCreateWidgetCommand
static void executeCreateWidgetCommand(UMLWidget *widget)
Definition umldragdata.cpp:727
UMLDragData::decodeClip3
static bool decodeClip3(const QMimeData *mimeData, UMLListViewItemList &umlListViewItems, const UMLListView *parentListView=nullptr)
Definition umldragdata.cpp:418
UMLDragData::LvTypeAndID_List
QList< LvTypeAndID * > LvTypeAndID_List
Definition umldragdata.h:64
UMLDragData::decodeClip4
static bool decodeClip4(const QMimeData *mimeData, UMLObjectList &objects, UMLWidgetList &widgets, AssociationWidgetList &associations, Uml::DiagramType::Enum &dType)
Definition umldragdata.cpp:486
UMLDragData::decodeClip5
static bool decodeClip5(const QMimeData *mimeData, UMLObjectList &objects, UMLClassifier *newParent)
Definition umldragdata.cpp:668
UMLDragData::getCodingType
static int getCodingType(const QMimeData *mimeData)
Definition umldragdata.cpp:884
UMLDragData::LvTypeAndID_It
QListIterator< LvTypeAndID * > LvTypeAndID_It
Definition umldragdata.h:65
UMLDragData::setUMLDataClip3
void setUMLDataClip3(UMLListViewItemList &UMLListViewItems)
Definition umldragdata.cpp:171
UMLDragData::decodeClip2
static bool decodeClip2(const QMimeData *mimeData, UMLObjectList &objects, UMLViewList &diagrams)
Definition umldragdata.cpp:304
UMLDragData::decodeObjects
static bool decodeObjects(QDomNode &objectsNode, UMLObjectList &objects, bool skipIfObjectExists=false)
Definition umldragdata.cpp:735
UMLDragData::getClip3TypeAndID
static bool getClip3TypeAndID(const QMimeData *mimeData, LvTypeAndID_List &typeAndIdList)
Definition umldragdata.cpp:356
UMLDragData::setUMLDataClip2
void setUMLDataClip2(UMLObjectList &Objects, UMLViewList &Diagrams)
Definition umldragdata.cpp:141
UMLDragData::decodeClip1
static bool decodeClip1(const QMimeData *mimeData, UMLObjectList &objects)
Definition umldragdata.cpp:263
UMLDragData::~UMLDragData
~UMLDragData()
Definition umldragdata.cpp:110
UMLDragData::decodeViews
static bool decodeViews(QDomNode &umlviewsNode, UMLViewList &diagrams)
Definition umldragdata.cpp:840
UMLDragData::setUMLDataClip5
void setUMLDataClip5(UMLObjectList &Objects)
Definition umldragdata.cpp:241
UMLDragData::setUMLDataClip1
void setUMLDataClip1(UMLObjectList &Objects)
Definition umldragdata.cpp:118
UMLDragData::UMLDragData
UMLDragData(UMLObjectList &Objects, QWidget *dragSource=nullptr)
Definition umldragdata.cpp:45
UMLDragData::setUMLDataClip4
void setUMLDataClip4(UMLObjectList &Objects, UMLWidgetList &WidgetDatas, AssociationWidgetList &Associations, QPixmap &PngImage, UMLScene *scene)
Definition umldragdata.cpp:193
UMLListViewItem::ListViewType
ListViewType
Definition umllistviewitem.h:39
UMLListView
Displays the list view for the program.
Definition umllistview.h:43
UMLObjectList
Definition umlobjectlist.h:25
UMLScene
Definition umlscene.h:65
UMLWidget
The base class for graphical UML objects.
Definition umlwidget.h:36
Uml::DiagramType::Enum
Enum
Definition basictypes.h:63
Uml::ID::Type
std::string Type
Definition basictypes.h:371
UMLDragData::LvTypeAndID
Definition umldragdata.h:60
UMLDragData::LvTypeAndID::id
Uml::ID::Type id
Definition umldragdata.h:62
UMLDragData::LvTypeAndID::type
UMLListViewItem::ListViewType type
Definition umldragdata.h:61
umllistviewitem.h
umllistviewitemlist.h
UMLListViewItemList
QList< UMLListViewItem * > UMLListViewItemList
Definition umllistviewitemlist.h:14
umlobjectlist.h
umlviewlist.h
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition umlviewlist.h:16
umlwidgetlist.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition umlwidgetlist.h:15