umbrello: umbrello/clipboard/umlclipboard.h Source File

umbrello 2.32.1 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
associationwidgetlist.h
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:19
UMLClipboard
Clipboard management class.
Definition: umlclipboard.h:33
UMLClipboard::checkItemForCopyType
void checkItemForCopyType(UMLListViewItem *item, bool &withDiagrams, bool &withObjects, bool &onlyAttsOps)
Definition: umlclipboard.cpp:388
UMLClipboard::fillObjectListForWidgets
void fillObjectListForWidgets(const UMLWidgetList &widgets)
Definition: umlclipboard.cpp:274
UMLClipboard::UMLCopyType
UMLCopyType
Enumeration that codes the different types of UML clips.
Definition: umlclipboard.h:47
UMLClipboard::clip4
@ clip4
UMLObjects, Associations and UMLWidgets.
Definition: umlclipboard.h:51
UMLClipboard::clip2
@ clip2
UMLObjects, UMLListViewItems (not diagrams) and diagrams.
Definition: umlclipboard.h:49
UMLClipboard::clip5
@ clip5
Only Attributes, Operations, Templates and EnumLiterals.
Definition: umlclipboard.h:52
UMLClipboard::clip1
@ clip1
UMLObjects (not diagrams)
Definition: umlclipboard.h:48
UMLClipboard::clip3
@ clip3
UMLListViewItems (not diagrams)
Definition: umlclipboard.h:50
UMLClipboard::insertItemChildren
bool insertItemChildren(UMLListViewItem *item, UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:426
UMLClipboard::~UMLClipboard
virtual ~UMLClipboard()
Definition: umlclipboard.cpp:60
UMLClipboard::m_AssociationList
AssociationWidgetList m_AssociationList
Definition: umlclipboard.h:66
UMLClipboard::m_ObjectList
UMLObjectList m_ObjectList
Definition: umlclipboard.h:63
UMLClipboard::m_type
UMLCopyType m_type
Type of copy operation to perform.
Definition: umlclipboard.h:68
UMLClipboard::paste
bool paste(const QMimeData *data)
Definition: umlclipboard.cpp:194
UMLClipboard::pasteClip1
bool pasteClip1(const QMimeData *data)
Definition: umlclipboard.cpp:453
UMLClipboard::m_WidgetList
UMLWidgetList m_WidgetList
Definition: umlclipboard.h:65
UMLClipboard::m_ViewList
UMLViewList m_ViewList
Definition: umlclipboard.h:67
UMLClipboard::pasteClip4
bool pasteClip4(const QMimeData *data)
Definition: umlclipboard.cpp:523
UMLClipboard::m_ItemList
UMLListViewItemList m_ItemList
Definition: umlclipboard.h:64
UMLClipboard::setCopyType
void setCopyType(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:360
UMLClipboard::addRelatedWidgets
void addRelatedWidgets()
Definition: umlclipboard.cpp:237
UMLClipboard::UMLClipboard
UMLClipboard()
Definition: umlclipboard.cpp:52
UMLClipboard::pasteItemAlreadyExists
void pasteItemAlreadyExists()
Definition: umlclipboard.cpp:748
UMLClipboard::pasteClip3
bool pasteClip3(const QMimeData *data)
Definition: umlclipboard.cpp:503
UMLClipboard::fillSelectionLists
bool fillSelectionLists(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:309
UMLClipboard::pasteClip2
bool pasteClip2(const QMimeData *data)
Definition: umlclipboard.cpp:465
UMLClipboard::copy
QMimeData * copy(bool fromView=false)
Definition: umlclipboard.cpp:69
UMLClipboard::pasteClip5
bool pasteClip5(const QMimeData *data)
Definition: umlclipboard.cpp:606
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:41
UMLObjectList
Definition: umlobjectlist.h:29
umllistviewitem.h
umllistviewitemlist.h
UMLListViewItemList
QList< UMLListViewItem * > UMLListViewItemList
Definition: umllistviewitemlist.h:24
umlobjectlist.h
umlviewlist.h
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:26
umlwidgetlist.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:17