enum.h
00001 /*************************************************************************** 00002 * * 00003 * This program is free software; you can redistribute it and/or modify * 00004 * it under the terms of the GNU General Public License as published by * 00005 * the Free Software Foundation; either version 2 of the License, or * 00006 * (at your option) any later version. * 00007 * * 00008 * copyright (C) 2003-2006 * 00009 * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * 00010 ***************************************************************************/ 00011 00012 #ifndef ENUM_H 00013 #define ENUM_H 00014 00015 #include "classifier.h" 00016 00017 class UMLEnumLiteral; 00018 00029 class UMLEnum : public UMLClassifier { 00030 Q_OBJECT 00031 public: 00038 explicit UMLEnum(const QString& name = "", Uml::IDType id = Uml::id_None); 00039 00043 virtual ~UMLEnum(); 00044 00048 bool operator==(UMLEnum& rhs); 00049 00054 virtual void copyInto(UMLEnum *rhs) const; 00055 00059 virtual UMLObject* clone() const; 00060 00066 UMLObject* createEnumLiteral(); 00067 00076 UMLObject* addEnumLiteral(const QString &name, Uml::IDType id = Uml::id_None); 00077 00086 bool addEnumLiteral(UMLEnumLiteral* Att, IDChangeLog* Log = 0); 00087 00097 //TODO: give default value -1 to position (append) - now it conflicts with the method above.. 00098 bool addEnumLiteral(UMLEnumLiteral* Att, int position ); 00099 00107 int removeEnumLiteral(UMLEnumLiteral *a); 00108 00114 int enumLiterals(); 00115 00119 void signalEnumLiteralRemoved(UMLClassifierListItem *elit); 00120 00124 virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); 00125 00126 signals: 00127 void enumLiteralAdded(UMLClassifierListItem*); 00128 void enumLiteralRemoved(UMLClassifierListItem*); 00129 00130 protected: 00134 bool load( QDomElement & element ); 00135 00136 private: 00140 void init(); 00141 00142 }; 00143 00144 #endif // ENUM_H 00145
