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

umlclipboard.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 UMLCLIPBOARD_H
12 #define UMLCLIPBOARD_H
13
14 #include "associationwidgetlist.h"
15 #include "umlobjectlist.h"
16 #include "umllistviewitemlist.h"
17 #include "umllistviewitem.h"
18 #include "umlviewlist.h"
19 #include "umlwidgetlist.h"
20
21 class QMimeData;
22
32 class UMLClipboard : public QObject
33 {
34 Q_OBJECT
35 public:
36
37 UMLClipboard();
38
39 virtual ~UMLClipboard();
40
41 bool paste(const QMimeData* data);
42
43 QMimeData* copy(bool fromView = false);
44
46 enum UMLCopyType
47 {
48 clip1 = 1,
49 clip2 = 2,
50 clip3 = 3,
51 clip4 = 4,
52 clip5 = 5
53 };
54
55 private:
56
57 bool pasteClip1(const QMimeData* data);
58 bool pasteClip2(const QMimeData* data);
59 bool pasteClip3(const QMimeData* data);
60 bool pasteClip4(const QMimeData* data);
61 bool pasteClip5(const QMimeData* data);
62
63 UMLObjectList m_ObjectList;
64 UMLListViewItemList m_ItemList;
65 UMLWidgetList m_WidgetList;
66 AssociationWidgetList m_AssociationList;
67 UMLViewList m_ViewList;
68 UMLCopyType m_type;
69
70 private:
71 void addRelatedWidgets();
72
73 void fillObjectListForWidgets(const UMLWidgetList& widgets);
74
75 bool fillSelectionLists(UMLListViewItemList& selectedItems);
76
77 void setCopyType(UMLListViewItemList& selectedItems);
78
79 void checkItemForCopyType(UMLListViewItem* item,
80 bool& withDiagrams,
81 bool& withObjects,
82 bool& onlyAttsOps);
83
84 bool insertItemChildren(UMLListViewItem* item,
85 UMLListViewItemList& selectedItems);
86
87 void pasteItemAlreadyExists();
88 };
89
90 #endif
notewidget.h
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:35
UMLApp::currentView
UMLView * currentView() const
Definition: uml.cpp:3166
Model_Utils::typeIsDiagram
bool typeIsDiagram(UMLListViewItem::ListViewType type)
Definition: model_utils.cpp:1393
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1309
template.h
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
UMLObject::asUMLEnumLiteral
UMLEnumLiteral * asUMLEnumLiteral()
Definition: umlobject.cpp:1317
UMLClipboard::clip1
@ clip1
UMLObjects (not diagrams)
Definition: umlclipboard.h:48
UMLClipboard::UMLClipboard
UMLClipboard()
Definition: umlclipboard.cpp:52
UMLClipboard::paste
bool paste(const QMimeData *data)
Definition: umlclipboard.cpp:194
UMLDoc::assignNewIDs
bool assignNewIDs(UMLObject *obj)
Definition: umldoc.cpp:3164
UMLDragData::decodeClip2
static bool decodeClip2(const QMimeData *mimeData, UMLObjectList &objects, UMLViewList &diagrams)
Definition: umldragdata.cpp:299
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1324
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
UMLScene::associationList
const AssociationWidgetList associationList() const
Definition: umlscene.cpp:589
IDChangeLog::findNewID
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:62
UMLClipboard::m_type
UMLCopyType m_type
Type of copy operation to perform.
Definition: umlclipboard.h:68
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Definition: umlcanvasobject.cpp:180
entity.h
UMLListViewItem::ListViewType
ListViewType
Definition: umllistviewitem.h:43
UMLListViewItem::umlObject
UMLObject * umlObject() const
Definition: umllistviewitem.cpp:312
UMLClipboard::clip3
@ clip3
UMLListViewItems (not diagrams)
Definition: umlclipboard.h:50
UMLObject::asUMLAttribute
UMLAttribute * asUMLAttribute()
Definition: umlobject.cpp:1305
UMLClipboard::clip2
@ clip2
UMLObjects, UMLListViewItems (not diagrams) and diagrams.
Definition: umlclipboard.h:49
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:40
operation.h
UMLScene::endPartialWidgetPaste
void endPartialWidgetPaste()
Definition: umlscene.cpp:2214
umlclipboard.h
WidgetBase::setID
void setID(Uml::ID::Type id)
Definition: widgetbase.cpp:200
UMLListViewItem::ID
Uml::ID::Type ID() const
Definition: umllistviewitem.cpp:271
UMLClipboard::pasteClip1
bool pasteClip1(const QMimeData *data)
Definition: umlclipboard.cpp:450
UMLListViewItem::type
ListViewType type() const
Definition: umllistviewitem.cpp:234
Uml::RoleType::A
@ A
Definition: basictypes.h:239
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
UMLObject::ot_Attribute
@ ot_Attribute
Definition: umlobject.h:92
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:77
UMLScene::isActivityDiagram
bool isActivityDiagram()
Definition: umlscene.h:321
UMLClipboard::~UMLClipboard
virtual ~UMLClipboard()
Definition: umlclipboard.cpp:60
UMLEnumLiteral
Sets up attribute information.
Definition: enumliteral.h:26
UMLClipboard::pasteClip4
bool pasteClip4(const QMimeData *data)
Definition: umlclipboard.cpp:520
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
UMLObject::setName
virtual void setName(const QString &strName)
Definition: umlobject.cpp:192
Diagram_Utils::importGraph
bool importGraph(const QStringList &lines, UMLScene *scene, const QString &fileName)
Definition: diagram_utils.cpp:317
umlwidgetlist.h
UMLDragData
Definition: umldragdata.h:38
UMLClassifier::checkOperationSignature
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=0)
Definition: classifier.cpp:134
UMLClipboard::fillSelectionLists
bool fillSelectionLists(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:309
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
UMLScene::selectedWidgetsExt
UMLWidgetList selectedWidgetsExt(bool filterText=true)
Definition: umlscene.cpp:2030
WidgetBase::asMessageWidget
MessageWidget * asMessageWidget()
Definition: widgetbase.cpp:1480
UMLClipboard::m_ViewList
UMLViewList m_ViewList
Definition: umlclipboard.h:67
UMLScene::clearSelected
void clearSelected()
Definition: umlscene.cpp:1456
model_utils.h
UMLScene::isStateDiagram
bool isStateDiagram()
Definition: umlscene.h:320
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLScene::activate
void activate()
Definition: umlscene.cpp:1952
UMLClipboard::pasteClip5
bool pasteClip5(const QMimeData *data)
Definition: umlclipboard.cpp:603
diagram_utils.h
UMLObject::asUMLEntityAttribute
UMLEntityAttribute * asUMLEntityAttribute()
Definition: umlobject.cpp:1314
UMLObject::asUMLEnum
UMLEnum * asUMLEnum()
Definition: umlobject.cpp:1316
UMLClipboard::UMLCopyType
UMLCopyType
Enumeration that codes the different types of UML clips.
Definition: umlclipboard.h:47
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
UMLClipboard::clip4
@ clip4
UMLObjects, Associations and UMLWidgets.
Definition: umlclipboard.h:51
UMLObject::ot_EnumLiteral
@ ot_EnumLiteral
Definition: umlobject.h:94
floatingtextwidget.h
UMLDragData::getCodingType
static int getCodingType(const QMimeData *mimeData)
Definition: umldragdata.cpp:879
UMLObject::asUMLEntity
UMLEntity * asUMLEntity()
Definition: umlobject.cpp:1313
UMLScene::beginPartialWidgetPaste
void beginPartialWidgetPaste()
Definition: umlscene.cpp:2205
UMLDragData::decodeClip3
static bool decodeClip3(const QMimeData *mimeData, UMLListViewItemList &umlListViewItems, const UMLListView *parentListView=0)
Definition: umldragdata.cpp:413
UMLDoc::endPaste
void endPaste()
Definition: umldoc.cpp:3257
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
NoteWidget::s_pCurrentNote
static QPointer< NoteWidget > s_pCurrentNote
Definition: notewidget.h:68
entityattribute.h
UMLView
Definition: umlview.h:35
UMLScene::selectWidgets
void selectWidgets(qreal px, qreal py, qreal qx, qreal qy)
Definition: umlscene.cpp:1770
umlviewlist.h
attribute.h
UMLScene::addAssociation
bool addAssociation(AssociationWidget *pAssoc, bool isPasteOperation=false)
Definition: umlscene.cpp:2095
UMLApp::listView
UMLListView * listView() const
Definition: uml.cpp:1074
UMLClassifier::addOperation
bool addOperation(UMLOperation *op, int position=-1)
Definition: classifier.cpp:310
umlwidget.h
uWarning
#define uWarning()
Definition: debug_utils.h:124
i18n
#define i18n
Definition: main.cpp:39
messagewidget.h
UMLClipboard::m_ObjectList
UMLObjectList m_ObjectList
Definition: umlclipboard.h:63
UMLListView::selectedItems
UMLListViewItemList selectedItems()
Definition: umllistview.cpp:1960
UMLClipboard::checkItemForCopyType
void checkItemForCopyType(UMLListViewItem *item, bool &withDiagrams, bool &withObjects, bool &onlyAttsOps)
Definition: umlclipboard.cpp:385
UMLObject::ot_EntityAttribute
@ ot_EntityAttribute
Definition: umlobject.h:102
UMLClipboard::m_WidgetList
UMLWidgetList m_WidgetList
Definition: umlclipboard.h:65
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:17
uDebug
#define uDebug()
Definition: debug_utils.h:122
UMLScene::widgetList
const UMLWidgetList widgetList() const
Definition: umlscene.cpp:603
Uml::RoleType::B
@ B
Definition: basictypes.h:240
Model_Utils::typeIsCanvasWidget
bool typeIsCanvasWidget(UMLListViewItem::ListViewType type)
Definition: model_utils.cpp:1180
umllistview.h
UMLDoc::assignNewID
Uml::ID::Type assignNewID(Uml::ID::Type oldID)
Definition: umldoc.cpp:3272
MessageWidget::objectWidget
ObjectWidget * objectWidget(Uml::RoleType::Enum role)
Definition: messagewidget.cpp:1326
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
UMLDoc
Definition: umldoc.h:75
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClipboard::addRelatedWidgets
void addRelatedWidgets()
Definition: umlclipboard.cpp:237
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3136
UMLClipboard::pasteClip3
bool pasteClip3(const QMimeData *data)
Definition: umlclipboard.cpp:500
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
UMLScene::findWidget
UMLWidget * findWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1184
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Definition: umlcanvasobject.cpp:238
umllistviewitem.h
associationwidget.h
UMLClipboard::pasteItemAlreadyExists
void pasteItemAlreadyExists()
Definition: umlclipboard.cpp:745
UMLObject::asUMLTemplate
UMLTemplate * asUMLTemplate()
Definition: umlobject.cpp:1329
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:25
UMLScene::selectedAssocs
AssociationWidgetList selectedAssocs()
Definition: umlscene.cpp:2049
umlscene.h
uml.h
UMLDoc::changeLog
virtual IDChangeLog * changeLog()
Definition: umldoc.cpp:3236
enumliteral.h
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLClipboard::clip5
@ clip5
Only Attributes, Operations, Templates and EnumLiterals.
Definition: umlclipboard.h:52
UMLClipboard::setCopyType
void setCopyType(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:357
UMLEntity::addEntityAttribute
UMLObject * addEntityAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: entity.cpp:305
UMLScene
Definition: umlscene.h:69
UMLDragData::decodeClip5
static bool decodeClip5(const QMimeData *mimeData, UMLObjectList &objects, UMLClassifier *newParent)
Definition: umldragdata.cpp:663
UMLObject::ot_Template
@ ot_Template
Definition: umlobject.h:95
UMLDragData::decodeClip4
static bool decodeClip4(const QMimeData *mimeData, UMLObjectList &objects, UMLWidgetList &widgets, AssociationWidgetList &associations, Uml::DiagramType::Enum &dType)
Definition: umldragdata.cpp:481
associationwidgetlist.h
UMLClassifier::findTemplate
UMLTemplate * findTemplate(const QString &name)
Definition: classifier.cpp:1119
UMLView::umlScene
UMLScene * umlScene() const
Definition: umlview.cpp:56
UMLScene::selectWidgetsOfAssoc
void selectWidgetsOfAssoc(AssociationWidget *a)
Definition: umlscene.cpp:1750
UMLEnum::addEnumLiteral
UMLObject * addEnumLiteral(const QString &name, Uml::ID::Type id=Uml::ID::None, const QString &value=QString())
Definition: enum.cpp:132
idchangelog.h
UMLListView
Displays the list view for the program.
Definition: umllistview.h:47
UMLTemplate
Sets up template information.
Definition: template.h:27
Model_Utils::typeIsClassifier
bool typeIsClassifier(UMLListViewItem::ListViewType type)
Definition: model_utils.cpp:1268
UMLObject::ot_Operation
@ ot_Operation
Definition: umlobject.h:93
UMLClipboard
Clipboard management class.
Definition: umlclipboard.h:33
UMLClipboard::insertItemChildren
bool insertItemChildren(UMLListViewItem *item, UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:423
umlobjectlist.h
UMLEntityAttribute
Sets up entityattribute information.
Definition: entityattribute.h:26
UMLDoc::addUMLView
bool addUMLView(UMLView *pView)
Definition: umldoc.cpp:3311
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26
Model_Utils::typeIsFolder
bool typeIsFolder(UMLListViewItem::ListViewType type)
Definition: model_utils.cpp:1213
UMLObjectList
Definition: umlobjectlist.h:29
UMLClipboard::copy
QMimeData * copy(bool fromView=false)
Definition: umlclipboard.cpp:69
UMLClipboard::m_ItemList
UMLListViewItemList m_ItemList
Definition: umlclipboard.h:64
UMLScene::copyAsImage
void copyAsImage(QPixmap *&pix)
Definition: umlscene.cpp:2867
UMLEnum
Non-graphical Information for an Enum.
Definition: enum.h:29
UMLClipboard::fillObjectListForWidgets
void fillObjectListForWidgets(const UMLWidgetList &widgets)
Definition: umlclipboard.cpp:274
MessageWidget
Displays a message.
Definition: messagewidget.h:41
UMLClipboard::m_AssociationList
AssociationWidgetList m_AssociationList
Definition: umlclipboard.h:66
UMLDoc::findView
UMLView * findView(Uml::ID::Type id)
Definition: umldoc.cpp:1005
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
umldoc.h
Model_Utils::typeIsClassifierList
bool typeIsClassifierList(UMLListViewItem::ListViewType type)
Definition: model_utils.cpp:1246
UMLListViewItemList
QList< UMLListViewItem * > UMLListViewItemList
Definition: umllistviewitemlist.h:24
UMLClassifier::addTemplate
UMLTemplate * addTemplate(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: classifier.cpp:1024
UMLClipboard::pasteClip2
bool pasteClip2(const QMimeData *data)
Definition: umlclipboard.cpp:462
WidgetBase::id
Uml::ID::Type id() const
Definition: widgetbase.cpp:214
UMLDoc::beginPaste
void beginPaste()
Definition: umldoc.cpp:3245
UMLClassifier::addAttribute
UMLAttribute * addAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: classifier.cpp:810
AssociationWidget::widgetForRole
UMLWidget * widgetForRole(Uml::RoleType::Enum role) const
Definition: associationwidget.cpp:1232
Import_Rose::diagramType
Uml::DiagramType::Enum diagramType(QString objType)
Definition: petaltree2uml.cpp:543
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33
enum.h