umllistviewitem.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef UMLLISTVIEWITEM_H
00014 #define UMLLISTVIEWITEM_H
00015
00016 #include <qlistview.h>
00017 #include <qmap.h>
00018 #include <qdom.h>
00019 #include "umlnamespace.h"
00020
00021
00022 class UMLListView;
00023 class UMLObject;
00024 class UMLClassifierListItem;
00025
00036 class UMLListViewItem : public QListViewItem {
00037 public:
00046 UMLListViewItem(UMLListView * parent, const QString &name, Uml::ListView_Type t, UMLObject*o=0);
00047
00053 UMLListViewItem(UMLListView * parent);
00054
00060 UMLListViewItem(UMLListViewItem * parent);
00061
00070 UMLListViewItem(UMLListViewItem * parent, const QString &name, Uml::ListView_Type t, UMLObject*o=0);
00071
00080 UMLListViewItem(UMLListViewItem * parent, const QString &name, Uml::ListView_Type t, Uml::IDType id);
00081
00085 ~UMLListViewItem();
00086
00092 Uml::ListView_Type getType() const;
00093
00101 void setID(Uml::IDType id);
00102
00108 Uml::IDType getID() const;
00109
00115 void setUMLObject(UMLObject * obj) {
00116 m_pObject = obj;
00117 }
00118
00124 UMLObject * getUMLObject() {
00125 return m_pObject;
00126 }
00127
00132 bool isOwnParent(Uml::IDType listViewItemID);
00133
00137 void updateObject();
00138
00142 void updateFolder();
00143
00148 void setOpen( bool open );
00149
00153 void setText( const QString &text );
00154
00158 QString getText() const;
00159
00163 void setCreating( bool creating ) {
00164 m_bCreating = creating;
00165 }
00166
00170 void setIcon(Uml::Icon_Type iconType);
00171
00175 void cancelRename( int col );
00176
00180 void addClassifierListItem(UMLClassifierListItem *child, UMLListViewItem *childItem);
00181
00185 void deleteChildItem(UMLClassifierListItem *child);
00186
00190 virtual int compare(QListViewItem *other, int col, bool ascending) const;
00191
00196 int childCount() const {
00197 return m_nChildren;
00198 }
00199
00205 UMLListViewItem* deepCopy(UMLListViewItem *newParent);
00206
00212 UMLListViewItem* findUMLObject(const UMLObject *o);
00213
00220 UMLListViewItem* findChildObject(UMLClassifierListItem *cli);
00221
00230 UMLListViewItem * findItem(Uml::IDType id);
00231
00235 void saveToXMI( QDomDocument& qDoc, QDomElement& qElement);
00236
00240 bool loadFromXMI(QDomElement& qElement);
00241
00242 protected:
00246 void init(UMLListView * parent = 0);
00247
00252 void okRename( int col );
00253
00257 void cancelRenameWithMsg();
00258
00262 static UMLListView * s_pListView;
00263
00267 bool m_bCreating;
00268
00275 typedef QMap<UMLClassifierListItem*, UMLListViewItem*> ChildObjectMap;
00276
00277 Uml::ListView_Type m_Type;
00278 Uml::IDType m_nId;
00279 int m_nChildren;
00280 UMLObject * m_pObject;
00281 QString m_Label;
00282 ChildObjectMap m_comap;
00283 };
00284
00285 #endif
This file is part of the documentation for umbrello Version 3.1.0.