umlrole.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 UMLROLE_H 00013 #define UMLROLE_H 00014 00015 #include "umlobject.h" 00016 00017 class UMLAssociation; 00018 00026 class UMLRole : public UMLObject { 00027 Q_OBJECT 00028 public: 00034 UMLRole (UMLAssociation * parent, UMLObject * parentUMLObject, Uml::Role_Type role); 00035 00039 bool operator==(UMLRole & rhs); 00040 00044 virtual ~UMLRole(); 00045 00050 UMLObject* getObject(); 00051 00057 Uml::Changeability_Type getChangeability() const; 00058 00064 QString getMultiplicity() const; 00065 00071 void setObject(UMLObject *obj); 00072 00078 void setChangeability (Uml::Changeability_Type value); 00079 00085 void setMultiplicity ( const QString &multi ); 00086 00087 UMLAssociation * getParentAssociation (); 00088 00095 Uml::Role_Type getRole(); 00096 00101 UMLObject* clone() const { return NULL; } 00102 00106 void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); 00107 00108 protected: 00113 bool load(QDomElement& element); 00114 00115 private: 00116 00118 void init (UMLAssociation * parent, UMLObject * parentObj, Uml::Role_Type r); 00119 00120 UMLAssociation * m_pAssoc; 00121 Uml::Role_Type m_role; 00122 QString m_Multi; 00123 Uml::Changeability_Type m_Changeability; 00124 }; 00125 00126 #endif
