1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* copyright (C) 2003 Luis De la Parra <lparrab@gmx.net> *
* copyright (C) 2004-2007 *
* Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
***************************************************************************/
#ifndef REFACTORING_ASSISTANT
#define REFACTORING_ASSISTANT
#include <klistview.h>
#include <tqpixmap.h>
#include <map>
class UMLObject;
class UMLClassifier;
class UMLClassifierListItem;
class UMLDoc;
class TQPopupMenu;
class TQPoint;
class RefactoringAssistant : public TDEListView
{
Q_OBJECT
public:
typedef std::map<TQListViewItem*, UMLObject*> UMLObjectMap;
explicit RefactoringAssistant( UMLDoc *doc, UMLClassifier *obj = 0, TQWidget *parent = 0, const char *name = 0 );
virtual ~RefactoringAssistant();
void refactor( UMLClassifier *obj );
public slots:
void addBaseClassifier();
void addDerivedClassifier();
void addInterfaceImplementation();
void createOperation( );
void createAttribute( );
void editProperties( );
void umlObjectModified( const UMLObject *obj = 0 );
void operationAdded( UMLClassifierListItem *o );
void operationRemoved( UMLClassifierListItem *o );
void attributeAdded( UMLClassifierListItem *a );
void attributeRemoved( UMLClassifierListItem *a );
void itemExecuted( TQListViewItem *item );
void showContextMenu( TDEListView*, TQListViewItem*, const TQPoint&);
protected:
struct { TQPixmap Public,
Protected,
Private,
Implementation,
Generalization,
Subclass;
} m_pixmaps;
UMLObject* findUMLObject( const TQListViewItem* );
TQListViewItem* findListViewItem( const UMLObject *obj );
void editProperties( UMLObject *obj );
void addClassifier( UMLClassifier *classifier, TQListViewItem *parent = 0, bool addSuper = true, bool addSub = true, bool recurse = false );
void loadPixmaps();
virtual bool acceptDrag(TQDropEvent *event) const;
virtual void movableDropEvent (TQListViewItem* parent, TQListViewItem* afterme);
void setVisibilityIcon( TQListViewItem *item , const UMLObject *obj );
UMLClassifier *m_umlObject;
UMLDoc *m_doc;
TQPopupMenu *m_menu;
UMLObjectMap m_umlObjectMap;
};
#endif
|