umbrello: umbrello/clipboard/umlclipboard.h Source File

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 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 UMLCLIPBOARD_H
7#define UMLCLIPBOARD_H
8
9#include "associationwidgetlist.h"
10#include "umlobjectlist.h"
11#include "umllistviewitemlist.h"
12#include "umllistviewitem.h"
13#include "umlviewlist.h"
14#include "umlwidgetlist.h"
15
16class QMimeData;
17
27 class UMLClipboard : public QObject
28{
29 Q_OBJECT
30public:
31
32 UMLClipboard();
33
34 virtual ~UMLClipboard();
35
36 bool paste(const QMimeData* data);
37
38 QMimeData* copy(bool fromView = false);
39
41 enum UMLCopyType
42 {
43 clip1 = 1,
44 clip2 = 2,
45 clip3 = 3,
46 clip4 = 4,
47 clip5 = 5
48 };
49
50private:
51
52 bool pasteClip1(const QMimeData* data);
53 bool pasteClip2(const QMimeData* data);
54 bool pasteClip3(const QMimeData* data);
55 bool pasteClip4(const QMimeData* data);
56 bool pasteClip5(const QMimeData* data);
57
58 UMLObjectList m_ObjectList;
59 UMLListViewItemList m_ItemList;
60 UMLWidgetList m_WidgetList;
61 AssociationWidgetList m_AssociationList;
62 UMLViewList m_ViewList;
63 UMLCopyType m_type;
64
65private:
66 void addRelatedWidgets();
67
68 void fillObjectListForWidgets(const UMLWidgetList& widgets);
69
70 bool fillSelectionLists(UMLListViewItemList& selectedItems);
71
72 void setCopyType(UMLListViewItemList& selectedItems);
73
74 void checkItemForCopyType(UMLListViewItem* item,
75 bool& withDiagrams,
76 bool& withObjects,
77 bool& onlyAttsOps);
78
79 bool insertItemChildren(UMLListViewItem* item,
80 UMLListViewItemList& selectedItems);
81
82 void pasteItemAlreadyExists();
83};
84
85#endif
associationwidgetlist.h
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:15
UMLClipboard
Clipboard management class.
Definition: umlclipboard.h:28
UMLClipboard::checkItemForCopyType
void checkItemForCopyType(UMLListViewItem *item, bool &withDiagrams, bool &withObjects, bool &onlyAttsOps)
Definition: umlclipboard.cpp:383
UMLClipboard::fillObjectListForWidgets
void fillObjectListForWidgets(const UMLWidgetList &widgets)
Definition: umlclipboard.cpp:269
UMLClipboard::UMLCopyType
UMLCopyType
Enumeration that codes the different types of UML clips.
Definition: umlclipboard.h:42
UMLClipboard::clip4
@ clip4
UMLObjects, Associations and UMLWidgets.
Definition: umlclipboard.h:46
UMLClipboard::clip2
@ clip2
UMLObjects, UMLListViewItems (not diagrams) and diagrams.
Definition: umlclipboard.h:44
UMLClipboard::clip5
@ clip5
Only Attributes, Operations, Templates and EnumLiterals.
Definition: umlclipboard.h:47
UMLClipboard::clip1
@ clip1
UMLObjects (not diagrams)
Definition: umlclipboard.h:43
UMLClipboard::clip3
@ clip3
UMLListViewItems (not diagrams)
Definition: umlclipboard.h:45
UMLClipboard::insertItemChildren
bool insertItemChildren(UMLListViewItem *item, UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:421
UMLClipboard::~UMLClipboard
virtual ~UMLClipboard()
Definition: umlclipboard.cpp:55
UMLClipboard::m_AssociationList
AssociationWidgetList m_AssociationList
Definition: umlclipboard.h:61
UMLClipboard::m_ObjectList
UMLObjectList m_ObjectList
Definition: umlclipboard.h:58
UMLClipboard::m_type
UMLCopyType m_type
Type of copy operation to perform.
Definition: umlclipboard.h:63
UMLClipboard::paste
bool paste(const QMimeData *data)
Definition: umlclipboard.cpp:189
UMLClipboard::pasteClip1
bool pasteClip1(const QMimeData *data)
Definition: umlclipboard.cpp:448
UMLClipboard::m_WidgetList
UMLWidgetList m_WidgetList
Definition: umlclipboard.h:60
UMLClipboard::m_ViewList
UMLViewList m_ViewList
Definition: umlclipboard.h:62
UMLClipboard::pasteClip4
bool pasteClip4(const QMimeData *data)
Definition: umlclipboard.cpp:518
UMLClipboard::m_ItemList
UMLListViewItemList m_ItemList
Definition: umlclipboard.h:59
UMLClipboard::setCopyType
void setCopyType(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:355
UMLClipboard::addRelatedWidgets
void addRelatedWidgets()
Definition: umlclipboard.cpp:232
UMLClipboard::UMLClipboard
UMLClipboard()
Definition: umlclipboard.cpp:47
UMLClipboard::pasteItemAlreadyExists
void pasteItemAlreadyExists()
Definition: umlclipboard.cpp:743
UMLClipboard::pasteClip3
bool pasteClip3(const QMimeData *data)
Definition: umlclipboard.cpp:498
UMLClipboard::fillSelectionLists
bool fillSelectionLists(UMLListViewItemList &selectedItems)
Definition: umlclipboard.cpp:304
UMLClipboard::pasteClip2
bool pasteClip2(const QMimeData *data)
Definition: umlclipboard.cpp:460
UMLClipboard::copy
QMimeData * copy(bool fromView=false)
Definition: umlclipboard.cpp:64
UMLClipboard::pasteClip5
bool pasteClip5(const QMimeData *data)
Definition: umlclipboard.cpp:601
UMLListViewItem
Items used by UMLListView.
Definition: umllistviewitem.h:36
UMLObjectList
Definition: umlobjectlist.h:25
umllistviewitem.h
umllistviewitemlist.h
UMLListViewItemList
QList< UMLListViewItem * > UMLListViewItemList
Definition: umllistviewitemlist.h:12
umlobjectlist.h
umlviewlist.h
UMLViewList
QList< QPointer< UMLView > > UMLViewList
Definition: umlviewlist.h:14
umlwidgetlist.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:13