umbrello/umbrello
umlcanvasobject.h
Go to the documentation of this file.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) 2002-2007 * 00009 * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * 00010 ***************************************************************************/ 00011 00012 #ifndef CANVASOBJECT_H 00013 #define CANVASOBJECT_H 00014 00015 #include "umlobject.h" 00016 #include "umlobjectlist.h" 00017 #include "umlclassifierlist.h" 00018 #include "umlassociationlist.h" 00019 00020 00036 class UMLCanvasObject : public UMLObject { 00037 Q_OBJECT 00038 public: 00045 explicit UMLCanvasObject(const QString & name = QString(), Uml::IDType id = Uml::id_None); 00046 00050 virtual ~UMLCanvasObject(); 00051 00055 virtual bool operator==(const UMLCanvasObject& rhs); 00056 00061 virtual void copyInto(UMLObject *lhs) const; 00062 00063 // The abstract method UMLObject::clone() is implemented 00064 // in the classes inheriting from UMLCanvasObject. 00065 00072 bool addAssociationEnd(UMLAssociation* assoc); 00073 00079 bool hasAssociation(UMLAssociation* assoc); 00080 00087 int removeAssociationEnd(UMLAssociation *assoc); 00088 00092 void removeAllAssociationEnds(); 00093 00100 int associations(); 00101 00107 UMLAssociationList getAssociations(); 00108 00115 UMLAssociationList getSpecificAssocs(Uml::Association_Type assocType); 00116 00124 UMLClassifierList getSuperClasses(); 00125 00133 UMLClassifierList getSubClasses(); 00134 00140 virtual UMLAssociationList getRealizations(); 00141 00147 UMLAssociationList getAggregations(); 00148 00154 UMLAssociationList getCompositions(); 00155 00161 UMLAssociationList getRelationships(); 00162 00171 virtual UMLObject *findChildObject(const QString &n, Uml::Object_Type t = Uml::ot_UMLObject); 00172 00180 virtual UMLObject *findChildObjectById(Uml::IDType id, bool considerAncestors = false); 00181 00193 virtual QString uniqChildName(const Uml::Object_Type type, 00194 const QString &prefix = QString()); 00195 00196 virtual void removeAllChildObjects(); 00197 00201 UMLObjectList subordinates() const { 00202 return m_List; 00203 } 00204 00208 virtual bool resolveRef(); 00209 00210 // The abstract method UMLObject::saveToXMI() is implemented 00211 // in the classes inheriting from UMLCanvasObject. 00212 00213 protected: 00214 00224 UMLObjectList m_List; 00225 00226 private: 00227 00231 void init(); 00232 00233 signals: 00234 00239 void sigAssociationEndAdded(UMLAssociation * assoc); 00240 00245 void sigAssociationEndRemoved(UMLAssociation * assoc); 00246 00247 }; 00248 00249 #endif
KDE 4.0 API Reference