umbrello: umbrello/refactoring/refactoringassistant.h Source File

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

refactoringassistant.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) 2003 Luis De la Parra <lparrab@gmx.net> *
8 * copyright (C) 2004-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef REFACTORING_ASSISTANT_H
13 #define REFACTORING_ASSISTANT_H
14
15 #include "icon_utils.h"
16
17 #include <QDropEvent>
18 #include <QTreeWidget>
19
20 class QPoint;
21 class QMenu;
22 class UMLObject;
23 class UMLClassifier;
24 class UMLClassifierListItem;
25 class UMLDoc;
26
27 class RefactoringAssistant : public QTreeWidget
28 {
29 Q_OBJECT
30 public:
31
32 explicit RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj = 0, QWidget *parent = 0, const QString &name = QString());
33 virtual ~RefactoringAssistant();
34
35 void refactor(UMLClassifier *obj);
36
37 signals:
38
39 // void moved();
40
41 public slots:
42
43 void addBaseClassifier();
44 void addDerivedClassifier();
45 void addInterfaceImplementation();
46 void createOperation();
47 void createAttribute();
48 void editProperties();
49 void deleteItem();
50
51 void objectModified();
52
53 void operationAdded(UMLClassifierListItem *listItem);
54 void operationRemoved(UMLClassifierListItem *listItem);
55
56 void attributeAdded(UMLClassifierListItem *listItem);
57 void attributeRemoved(UMLClassifierListItem *listItem);
58
59 void itemExecuted(QTreeWidgetItem *item, int column);
60
61 protected:
62
63 UMLObject* findUMLObject(const QTreeWidgetItem*);
64
65 QTreeWidgetItem* findListViewItem(const UMLObject *obj);
66
67 void editProperties(UMLObject *obj);
68
69 void deleteItem(QTreeWidgetItem *item, UMLObject *obj);
70
71 void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent = 0, bool addSuper = true, bool addSub = true, bool recurse = false);
72
73 virtual void dragMoveEvent(QDragMoveEvent *event);
74 virtual void dropEvent(QDropEvent *event);
75
76 void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj);
77
78 UMLClassifier * m_umlObject;
79 UMLDoc * m_doc;
80 QMenu * m_menu;
81 QMap<QTreeWidgetItem*, UMLObject*> m_umlObjectMap;
82 QSet<UMLClassifier *> m_alreadySeen;
83
84 private slots:
85
86 void showContextMenu(const QPoint&);
87
88 private:
89
90 QAction* createAction(const QString& text, const char * method, const Icon_Utils::IconType icon = Icon_Utils::N_ICONTYPES);
91
92 };
93
94 #endif
RefactoringAssistant
Definition: refactoringassistant.h:28
RefactoringAssistant::operationAdded
void operationAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:216
RefactoringAssistant::attributeRemoved
void attributeRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:293
RefactoringAssistant::addClassifier
void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent=0, bool addSuper=true, bool addSub=true, bool recurse=false)
Definition: refactoringassistant.cpp:641
RefactoringAssistant::m_menu
QMenu * m_menu
Definition: refactoringassistant.h:80
RefactoringAssistant::showContextMenu
void showContextMenu(const QPoint &)
Definition: refactoringassistant.cpp:435
RefactoringAssistant::m_umlObject
UMLClassifier * m_umlObject
Definition: refactoringassistant.h:78
RefactoringAssistant::addInterfaceImplementation
void addInterfaceImplementation()
Definition: refactoringassistant.cpp:573
RefactoringAssistant::createAction
QAction * createAction(const QString &text, const char *method, const Icon_Utils::IconType icon=Icon_Utils::N_ICONTYPES)
Definition: refactoringassistant.cpp:420
RefactoringAssistant::addDerivedClassifier
void addDerivedClassifier()
Definition: refactoringassistant.cpp:528
RefactoringAssistant::findUMLObject
UMLObject * findUMLObject(const QTreeWidgetItem *)
Definition: refactoringassistant.cpp:102
RefactoringAssistant::findListViewItem
QTreeWidgetItem * findListViewItem(const UMLObject *obj)
Definition: refactoringassistant.cpp:120
RefactoringAssistant::setVisibilityIcon
void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj)
Definition: refactoringassistant.cpp:152
RefactoringAssistant::~RefactoringAssistant
virtual ~RefactoringAssistant()
Definition: refactoringassistant.cpp:68
RefactoringAssistant::refactor
void refactor(UMLClassifier *obj)
Definition: refactoringassistant.cpp:78
RefactoringAssistant::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: refactoringassistant.cpp:736
RefactoringAssistant::operationRemoved
void operationRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:246
RefactoringAssistant::createAttribute
void createAttribute()
Definition: refactoringassistant.cpp:614
RefactoringAssistant::deleteItem
void deleteItem()
Definition: refactoringassistant.cpp:360
RefactoringAssistant::m_umlObjectMap
QMap< QTreeWidgetItem *, UMLObject * > m_umlObjectMap
Definition: refactoringassistant.h:81
RefactoringAssistant::itemExecuted
void itemExecuted(QTreeWidgetItem *item, int column)
Definition: refactoringassistant.cpp:138
RefactoringAssistant::createOperation
void createOperation()
Definition: refactoringassistant.cpp:592
RefactoringAssistant::m_doc
UMLDoc * m_doc
Definition: refactoringassistant.h:79
RefactoringAssistant::attributeAdded
void attributeAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:262
RefactoringAssistant::addBaseClassifier
void addBaseClassifier()
Definition: refactoringassistant.cpp:483
RefactoringAssistant::objectModified
void objectModified()
Definition: refactoringassistant.cpp:196
RefactoringAssistant::m_alreadySeen
QSet< UMLClassifier * > m_alreadySeen
recursive guard
Definition: refactoringassistant.h:82
RefactoringAssistant::RefactoringAssistant
RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj=0, QWidget *parent=0, const QString &name=QString())
Definition: refactoringassistant.cpp:41
RefactoringAssistant::editProperties
void editProperties()
Definition: refactoringassistant.cpp:311
RefactoringAssistant::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: refactoringassistant.cpp:771
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLDoc
Definition: umldoc.h:75
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
icon_utils.h
Icon_Utils::IconType
IconType
Definition: icon_utils.h:47
Icon_Utils::N_ICONTYPES
@ N_ICONTYPES
Definition: icon_utils.h:241