umbrello: umbrello/refactoring/refactoringassistant.h Source File

umbrello 2.31.1 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
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1308
RefactoringAssistant::editProperties
void editProperties()
Definition: refactoringassistant.cpp:311
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:131
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:80
Icon_Utils::N_ICONTYPES
@ N_ICONTYPES
Definition: icon_utils.h:241
Uml::Visibility::Implementation
@ Implementation
Definition: basictypes.h:80
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1323
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
Icon_Utils::it_Properties
@ it_Properties
Definition: icon_utils.h:147
RefactoringAssistant::m_alreadySeen
QSet< UMLClassifier * > m_alreadySeen
recursive guard
Definition: refactoringassistant.h:82
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
umlattributedialog.h
Icon_Utils::it_Protected_Method
@ it_Protected_Method
Definition: icon_utils.h:114
UMLObject::asUMLAttribute
UMLAttribute * asUMLAttribute()
Definition: umlobject.cpp:1304
Object_Factory::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &n, UMLPackage *parentPkg, bool solicitNewName)
Definition: object_factory.cpp:211
UMLDoc::createUMLAssociation
UMLAssociation * createUMLAssociation(UMLObject *a, UMLObject *b, Uml::AssociationType::Enum type)
Definition: umldoc.cpp:1461
UMLObject::ot_Class
@ ot_Class
Definition: umlobject.h:89
operation.h
UMLClassifier::createOperation
UMLOperation * createOperation(const QString &name=QString(), bool *isExistingOp=0, Model_Utils::NameAndType_List *params=0)
Definition: classifier.cpp:236
RefactoringAssistant::operationAdded
void operationAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:216
umloperationdialog.h
UMLObject::ot_Attribute
@ ot_Attribute
Definition: umlobject.h:92
RefactoringAssistant::m_menu
QMenu * m_menu
Definition: refactoringassistant.h:80
object_factory.h
UMLObject::ot_Interface
@ ot_Interface
Definition: umlobject.h:86
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1280
RefactoringAssistant
Definition: refactoringassistant.h:28
Icon_Utils::it_Implementation_Attribute
@ it_Implementation_Attribute
Definition: icon_utils.h:119
Icon_Utils::it_Protected_Attribute
@ it_Protected_Attribute
Definition: icon_utils.h:118
RefactoringAssistant::itemExecuted
void itemExecuted(QTreeWidgetItem *item, int column)
Definition: refactoringassistant.cpp:138
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:670
RefactoringAssistant::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: refactoringassistant.cpp:736
RefactoringAssistant::createAction
QAction * createAction(const QString &text, const char *method, const Icon_Utils::IconType icon=Icon_Utils::N_ICONTYPES)
Definition: refactoringassistant.cpp:420
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
RefactoringAssistant::operationRemoved
void operationRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:246
UMLClassifier::checkOperationSignature
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=0)
Definition: classifier.cpp:134
UMLAttributeDialog
Definition: umlattributedialog.h:32
RefactoringAssistant::m_doc
UMLDoc * m_doc
Definition: refactoringassistant.h:79
Icon_Utils::it_Folder_Orange
@ it_Folder_Orange
Definition: icon_utils.h:62
Icon_Utils::it_Private_Attribute
@ it_Private_Attribute
Definition: icon_utils.h:117
ClassPropertiesDialog
Definition: classpropertiesdialog.h:35
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
RefactoringAssistant::deleteItem
void deleteItem()
Definition: refactoringassistant.cpp:360
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
UMLClassifier::removeAttribute
int removeAttribute(UMLAttribute *att)
Definition: classifier.cpp:893
UMLDoc::signalUMLObjectCreated
void signalUMLObjectCreated(UMLObject *o)
Definition: umldoc.cpp:1983
Uml::Visibility::Public
@ Public
Definition: basictypes.h:77
RefactoringAssistant::m_umlObjectMap
QMap< QTreeWidgetItem *, UMLObject * > m_umlObjectMap
Definition: refactoringassistant.h:81
RefactoringAssistant::addDerivedClassifier
void addDerivedClassifier()
Definition: refactoringassistant.cpp:528
Icon_Utils::it_Uniassociation
@ it_Uniassociation
Definition: icon_utils.h:106
RefactoringAssistant::findListViewItem
QTreeWidgetItem * findListViewItem(const UMLObject *obj)
Definition: refactoringassistant.cpp:120
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
attribute.h
UMLClassifier::addOperation
bool addOperation(UMLOperation *op, int position=-1)
Definition: classifier.cpp:310
uWarning
#define uWarning()
Definition: debug_utils.h:124
Icon_Utils::it_Delete
@ it_Delete
Definition: icon_utils.h:135
UMLClassifier::removeOperation
int removeOperation(UMLOperation *op)
Definition: classifier.cpp:370
i18n
#define i18n
Definition: main.cpp:39
RefactoringAssistant::findUMLObject
UMLObject * findUMLObject(const QTreeWidgetItem *)
Definition: refactoringassistant.cpp:102
basictypes.h
RefactoringAssistant::addClassifier
void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent=0, bool addSuper=true, bool addSub=true, bool recurse=false)
Definition: refactoringassistant.cpp:641
UMLOperationDialog
Definition: umloperationdialog.h:41
Icon_Utils::SmallIcon
QPixmap SmallIcon(IconType type)
Definition: icon_utils.cpp:41
UMLOperation::clone
virtual UMLObject * clone() const
Definition: operation.cpp:338
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
Uml::AssociationType::Generalization
@ Generalization
Definition: basictypes.h:124
RefactoringAssistant::attributeRemoved
void attributeRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:293
UMLDoc
Definition: umldoc.h:75
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:436
Icon_Utils::it_Generalisation
@ it_Generalisation
Definition: icon_utils.h:104
RefactoringAssistant::refactor
void refactor(UMLClassifier *obj)
Definition: refactoringassistant.cpp:78
refactoringassistant.h
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
classifier.h
UMLOperation
Definition: operation.h:25
Icon_Utils::it_Public_Method
@ it_Public_Method
Definition: icon_utils.h:112
Icon_Utils::IconType
IconType
Definition: icon_utils.h:47
RefactoringAssistant::m_umlObject
UMLClassifier * m_umlObject
Definition: refactoringassistant.h:78
Icon_Utils::it_Implementation_Method
@ it_Implementation_Method
Definition: icon_utils.h:115
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:223
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
icon_utils.h
RefactoringAssistant::setVisibilityIcon
void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj)
Definition: refactoringassistant.cpp:152
RefactoringAssistant::addInterfaceImplementation
void addInterfaceImplementation()
Definition: refactoringassistant.cpp:573
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:43
RefactoringAssistant::RefactoringAssistant
RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj=0, QWidget *parent=0, const QString &name=QString())
Definition: refactoringassistant.cpp:41
RefactoringAssistant::addBaseClassifier
void addBaseClassifier()
Definition: refactoringassistant.cpp:483
RefactoringAssistant::attributeAdded
void attributeAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:262
Icon_Utils::it_Public_Attribute
@ it_Public_Attribute
Definition: icon_utils.h:116
classpropertiesdialog.h
RefactoringAssistant::objectModified
void objectModified()
Definition: refactoringassistant.cpp:196
RefactoringAssistant::createAttribute
void createAttribute()
Definition: refactoringassistant.cpp:614
RefactoringAssistant::createOperation
void createOperation()
Definition: refactoringassistant.cpp:592
UMLObject::ot_Operation
@ ot_Operation
Definition: umlobject.h:93
UMLAttribute::clone
virtual UMLObject * clone() const
Definition: attribute.cpp:252
RefactoringAssistant::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: refactoringassistant.cpp:771
Uml::Visibility::Private
@ Private
Definition: basictypes.h:78
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:79
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
UMLClassifier::createAttribute
virtual UMLAttribute * createAttribute(const QString &name=QString(), UMLObject *type=0, Uml::Visibility::Enum vis=Uml::Visibility::Private, const QString &init=QString())
Definition: classifier.cpp:756
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
RefactoringAssistant::~RefactoringAssistant
virtual ~RefactoringAssistant()
Definition: refactoringassistant.cpp:68
Icon_Utils::it_Private_Method
@ it_Private_Method
Definition: icon_utils.h:113
umldoc.h
RefactoringAssistant::showContextMenu
void showContextMenu(const QPoint &)
Definition: refactoringassistant.cpp:435
UMLClassifier::addAttribute
UMLAttribute * addAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: classifier.cpp:810