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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

refactoringassistant.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Luis De la Parra <lparrab@gmx.net>
5 SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef REFACTORING_ASSISTANT_H
9#define REFACTORING_ASSISTANT_H
10
11#include "icon_utils.h"
12
13#include <QDropEvent>
14#include <QTreeWidget>
15
16 class QPoint;
17 class QMenu;
18 class UMLObject;
19 class UMLClassifier;
20 class UMLClassifierListItem;
21 class UMLDoc;
22
23 class RefactoringAssistant : public QTreeWidget
24{
25 Q_OBJECT
26 public:
27
28 explicit RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj = nullptr, QWidget *parent = nullptr, const QString &name = QString());
29 virtual ~RefactoringAssistant();
30
31 void refactor(UMLClassifier *obj);
32
33Q_SIGNALS:
34
35// void moved();
36
37 public Q_SLOTS:
38
39 void addBaseClassifier();
40 void addDerivedClassifier();
41 void addInterfaceImplementation();
42 void createOperation();
43 void createAttribute();
44 void editProperties();
45 void deleteItem();
46
47 void objectModified();
48
49 void operationAdded(UMLClassifierListItem *listItem);
50 void operationRemoved(UMLClassifierListItem *listItem);
51
52 void attributeAdded(UMLClassifierListItem *listItem);
53 void attributeRemoved(UMLClassifierListItem *listItem);
54
55 void itemExecuted(QTreeWidgetItem *item, int column);
56
57 protected:
58
59 UMLObject* findUMLObject(const QTreeWidgetItem*);
60
61 QTreeWidgetItem* findListViewItem(const UMLObject *obj);
62
63 void editProperties(UMLObject *obj);
64
65 void deleteItem(QTreeWidgetItem *item, UMLObject *obj);
66
67 void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent = nullptr, bool addSuper = true, bool addSub = true, bool recurse = false);
68
69 virtual void dragMoveEvent(QDragMoveEvent *event);
70 virtual void dropEvent(QDropEvent *event);
71
72 void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj);
73
74 UMLClassifier * m_umlObject;
75 UMLDoc * m_doc;
76 QMenu * m_menu;
77 QMap<QTreeWidgetItem*, UMLObject*> m_umlObjectMap;
78 QSet<UMLClassifier *> m_alreadySeen;
79
80 private Q_SLOTS:
81
82 void showContextMenu(const QPoint&);
83
84 private:
85
86 QAction* createAction(const QString& text, const char * method, const Icon_Utils::IconType icon = Icon_Utils::N_ICONTYPES);
87
88};
89
90#endif
RefactoringAssistant
Definition: refactoringassistant.h:24
RefactoringAssistant::operationAdded
void operationAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:215
RefactoringAssistant::attributeRemoved
void attributeRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:294
RefactoringAssistant::m_menu
QMenu * m_menu
Definition: refactoringassistant.h:76
RefactoringAssistant::showContextMenu
void showContextMenu(const QPoint &)
Definition: refactoringassistant.cpp:432
RefactoringAssistant::m_umlObject
UMLClassifier * m_umlObject
Definition: refactoringassistant.h:74
RefactoringAssistant::addInterfaceImplementation
void addInterfaceImplementation()
Definition: refactoringassistant.cpp:570
RefactoringAssistant::createAction
QAction * createAction(const QString &text, const char *method, const Icon_Utils::IconType icon=Icon_Utils::N_ICONTYPES)
Definition: refactoringassistant.cpp:417
RefactoringAssistant::addDerivedClassifier
void addDerivedClassifier()
Definition: refactoringassistant.cpp:525
RefactoringAssistant::findUMLObject
UMLObject * findUMLObject(const QTreeWidgetItem *)
Definition: refactoringassistant.cpp:99
RefactoringAssistant::findListViewItem
QTreeWidgetItem * findListViewItem(const UMLObject *obj)
Definition: refactoringassistant.cpp:118
RefactoringAssistant::setVisibilityIcon
void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj)
Definition: refactoringassistant.cpp:151
RefactoringAssistant::~RefactoringAssistant
virtual ~RefactoringAssistant()
Definition: refactoringassistant.cpp:65
RefactoringAssistant::refactor
void refactor(UMLClassifier *obj)
Definition: refactoringassistant.cpp:75
RefactoringAssistant::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: refactoringassistant.cpp:733
RefactoringAssistant::operationRemoved
void operationRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:246
RefactoringAssistant::createAttribute
void createAttribute()
Definition: refactoringassistant.cpp:611
RefactoringAssistant::deleteItem
void deleteItem()
Definition: refactoringassistant.cpp:357
RefactoringAssistant::m_umlObjectMap
QMap< QTreeWidgetItem *, UMLObject * > m_umlObjectMap
Definition: refactoringassistant.h:77
RefactoringAssistant::addClassifier
void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent=nullptr, bool addSuper=true, bool addSub=true, bool recurse=false)
Definition: refactoringassistant.cpp:638
RefactoringAssistant::itemExecuted
void itemExecuted(QTreeWidgetItem *item, int column)
Definition: refactoringassistant.cpp:137
RefactoringAssistant::createOperation
void createOperation()
Definition: refactoringassistant.cpp:589
RefactoringAssistant::m_doc
UMLDoc * m_doc
Definition: refactoringassistant.h:75
RefactoringAssistant::attributeAdded
void attributeAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:262
RefactoringAssistant::addBaseClassifier
void addBaseClassifier()
Definition: refactoringassistant.cpp:480
RefactoringAssistant::objectModified
void objectModified()
Definition: refactoringassistant.cpp:195
RefactoringAssistant::m_alreadySeen
QSet< UMLClassifier * > m_alreadySeen
recursive guard
Definition: refactoringassistant.h:78
RefactoringAssistant::editProperties
void editProperties()
Definition: refactoringassistant.cpp:312
RefactoringAssistant::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: refactoringassistant.cpp:768
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.h:35
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: umlclassifierlistitem.h:25
UMLDoc
Definition: umldoc.h:63
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
icon_utils.h
Icon_Utils::IconType
IconType
Definition: icon_utils.h:25
Icon_Utils::N_ICONTYPES
@ N_ICONTYPES
Definition: icon_utils.h:219