umbrello  2.34.3
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  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;
21 class UMLDoc;
22 
23 class RefactoringAssistant : public QTreeWidget
24 {
25  Q_OBJECT
26 public:
27 
28  explicit RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj = 0, QWidget *parent = 0, const QString &name = QString());
29  virtual ~RefactoringAssistant();
30 
31  void refactor(UMLClassifier *obj);
32 
33 signals:
34 
35 // void moved();
36 
37 public slots:
38 
39  void addBaseClassifier();
40  void addDerivedClassifier();
42  void createOperation();
43  void createAttribute();
44  void editProperties();
45  void deleteItem();
46 
47  void objectModified();
48 
49  void operationAdded(UMLClassifierListItem *listItem);
51 
52  void attributeAdded(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 = 0, 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 
76  QMenu * m_menu;
77  QMap<QTreeWidgetItem*, UMLObject*> m_umlObjectMap;
78  QSet<UMLClassifier *> m_alreadySeen;
79 
80 private 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
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:421
RefactoringAssistant::editProperties
void editProperties()
Definition: refactoringassistant.cpp:312
DEBUG_REGISTER
#define DEBUG_REGISTER(src)
Definition: debug_utils.h:129
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:75
Icon_Utils::N_ICONTYPES
@ N_ICONTYPES
Definition: icon_utils.h:227
Uml::Visibility::Implementation
@ Implementation
Definition: basictypes.h:49
UMLAttributeList
Definition: umlattributelist.h:20
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
Icon_Utils::it_Properties
@ it_Properties
Definition: icon_utils.h:133
RefactoringAssistant::m_alreadySeen
QSet< UMLClassifier * > m_alreadySeen
recursive guard
Definition: refactoringassistant.h:78
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:177
umlattributedialog.h
Icon_Utils::it_Protected_Method
@ it_Protected_Method
Definition: icon_utils.h:100
Object_Factory::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &n, UMLPackage *parentPkg, bool solicitNewName)
Definition: object_factory.cpp:209
UMLDoc::createUMLAssociation
UMLAssociation * createUMLAssociation(UMLObject *a, UMLObject *b, Uml::AssociationType::Enum type)
Definition: umldoc.cpp:1477
UMLObject::ot_Class
@ ot_Class
Definition: umlobject.h:85
operation.h
DEBUG
#define DEBUG()
Definition: debug_utils.h:127
RefactoringAssistant::operationAdded
void operationAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:215
umloperationdialog.h
UMLObject::ot_Attribute
@ ot_Attribute
Definition: umlobject.h:88
RefactoringAssistant::m_menu
QMenu * m_menu
Definition: refactoringassistant.h:76
object_factory.h
UMLObject::ot_Interface
@ ot_Interface
Definition: umlobject.h:82
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1306
RefactoringAssistant
Definition: refactoringassistant.h:23
Icon_Utils::it_Implementation_Attribute
@ it_Implementation_Attribute
Definition: icon_utils.h:105
Icon_Utils::it_Protected_Attribute
@ it_Protected_Attribute
Definition: icon_utils.h:104
RefactoringAssistant::itemExecuted
void itemExecuted(QTreeWidgetItem *item, int column)
Definition: refactoringassistant.cpp:137
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:676
RefactoringAssistant::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: refactoringassistant.cpp:737
RefactoringAssistant::createAction
QAction * createAction(const QString &text, const char *method, const Icon_Utils::IconType icon=Icon_Utils::N_ICONTYPES)
Definition: refactoringassistant.cpp:421
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:12
RefactoringAssistant::operationRemoved
void operationRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:246
UMLAttributeDialog
Definition: umlattributedialog.h:29
UMLObject::asUMLAttribute
UMLAttribute * asUMLAttribute()
Definition: umlobject.cpp:1416
RefactoringAssistant::m_doc
UMLDoc * m_doc
Definition: refactoringassistant.h:75
Icon_Utils::it_Folder_Orange
@ it_Folder_Orange
Definition: icon_utils.h:48
Icon_Utils::it_Private_Attribute
@ it_Private_Attribute
Definition: icon_utils.h:103
ClassPropertiesDialog
Definition: classpropertiesdialog.h:29
UMLObject
The base class for UML objects.
Definition: umlobject.h:69
RefactoringAssistant::deleteItem
void deleteItem()
Definition: refactoringassistant.cpp:361
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1435
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:393
UMLClassifier::removeAttribute
int removeAttribute(UMLAttribute *att)
Definition: classifier.cpp:893
UMLDoc::signalUMLObjectCreated
void signalUMLObjectCreated(UMLObject *o)
Definition: umldoc.cpp:1998
Uml::Visibility::Public
@ Public
Definition: basictypes.h:46
RefactoringAssistant::m_umlObjectMap
QMap< QTreeWidgetItem *, UMLObject * > m_umlObjectMap
Definition: refactoringassistant.h:77
RefactoringAssistant::addDerivedClassifier
void addDerivedClassifier()
Definition: refactoringassistant.cpp:529
Icon_Utils::it_Uniassociation
@ it_Uniassociation
Definition: icon_utils.h:92
RefactoringAssistant::findListViewItem
QTreeWidgetItem * findListViewItem(const UMLObject *obj)
Definition: refactoringassistant.cpp:118
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:462
it
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Definition: GPL-2.0-only.txt:64
attribute.h
UMLClassifier::addOperation
bool addOperation(UMLOperation *op, int position=-1)
Definition: classifier.cpp:308
Icon_Utils::it_Delete
@ it_Delete
Definition: icon_utils.h:121
UMLClassifier::removeOperation
int removeOperation(UMLOperation *op)
Definition: classifier.cpp:369
i18n
#define i18n
Definition: main.cpp:35
RefactoringAssistant::findUMLObject
UMLObject * findUMLObject(const QTreeWidgetItem *)
Definition: refactoringassistant.cpp:99
basictypes.h
RefactoringAssistant::addClassifier
void addClassifier(UMLClassifier *classifier, QTreeWidgetItem *parent=0, bool addSuper=true, bool addSub=true, bool recurse=false)
Definition: refactoringassistant.cpp:642
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1420
UMLOperationDialog
Definition: umloperationdialog.h:38
UMLObject::toString
static QString toString(ObjectType ot)
Definition: umlobject.cpp:1212
Icon_Utils::SmallIcon
QPixmap SmallIcon(IconType type)
Definition: icon_utils.cpp:30
UMLOperation::clone
virtual UMLObject * clone() const
Definition: operation.cpp:338
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
logWarn1
#define logWarn1(s, a)
Definition: uml.h:542
Uml::AssociationType::Generalization
@ Generalization
Definition: basictypes.h:93
c
type show c for details The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of the commands you use may be called something other than show w and show c
Definition: GPL-2.0-only.txt:301
RefactoringAssistant::attributeRemoved
void attributeRemoved(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:294
UMLDoc
Definition: umldoc.h:69
UMLAttribute
Sets up attribute information.
Definition: attribute.h:22
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:435
Icon_Utils::it_Generalisation
@ it_Generalisation
Definition: icon_utils.h:90
RefactoringAssistant::refactor
void refactor(UMLClassifier *obj)
Definition: refactoringassistant.cpp:75
refactoringassistant.h
logWarn0
#define logWarn0(s)
Definition: uml.h:536
classifier.h
UMLOperation
Definition: operation.h:19
Icon_Utils::it_Public_Method
@ it_Public_Method
Definition: icon_utils.h:98
Icon_Utils::IconType
IconType
Definition: icon_utils.h:32
uml.h
RefactoringAssistant::m_umlObject
UMLClassifier * m_umlObject
Definition: refactoringassistant.h:74
Icon_Utils::it_Implementation_Method
@ it_Implementation_Method
Definition: icon_utils.h:101
MultiPageDialogBase::exec
int exec()
Definition: multipagedialogbase.cpp:218
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:34
debug_utils.h
icon_utils.h
RefactoringAssistant::setVisibilityIcon
void setVisibilityIcon(QTreeWidgetItem *item, const UMLObject *obj)
Definition: refactoringassistant.cpp:151
RefactoringAssistant::addInterfaceImplementation
void addInterfaceImplementation()
Definition: refactoringassistant.cpp:574
RefactoringAssistant::RefactoringAssistant
RefactoringAssistant(UMLDoc *doc, UMLClassifier *obj=0, QWidget *parent=0, const QString &name=QString())
Definition: refactoringassistant.cpp:38
RefactoringAssistant::addBaseClassifier
void addBaseClassifier()
Definition: refactoringassistant.cpp:484
RefactoringAssistant::attributeAdded
void attributeAdded(UMLClassifierListItem *listItem)
Definition: refactoringassistant.cpp:262
Icon_Utils::it_Public_Attribute
@ it_Public_Attribute
Definition: icon_utils.h:102
classpropertiesdialog.h
RefactoringAssistant::objectModified
void objectModified()
Definition: refactoringassistant.cpp:195
RefactoringAssistant::createAttribute
void createAttribute()
Definition: refactoringassistant.cpp:615
RefactoringAssistant::createOperation
void createOperation()
Definition: refactoringassistant.cpp:593
UMLObject::ot_Operation
@ ot_Operation
Definition: umlobject.h:89
UMLAttribute::clone
virtual UMLObject * clone() const
Definition: attribute.cpp:254
RefactoringAssistant::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: refactoringassistant.cpp:772
Uml::Visibility::Private
@ Private
Definition: basictypes.h:47
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:48
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:12
UMLClassifier::checkOperationSignature
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=0) const
Definition: classifier.cpp:132
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:24
RefactoringAssistant::~RefactoringAssistant
virtual ~RefactoringAssistant()
Definition: refactoringassistant.cpp:65
Icon_Utils::it_Private_Method
@ it_Private_Method
Definition: icon_utils.h:99
umldoc.h
RefactoringAssistant::showContextMenu
void showContextMenu(const QPoint &)
Definition: refactoringassistant.cpp:436
UMLClassifier::addAttribute
UMLAttribute * addAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Definition: classifier.cpp:810