umlcanvasobject.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) 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 class IDChangeLog; 00021 00037 class UMLCanvasObject : public UMLObject { 00038 Q_OBJECT 00039 public: 00046 explicit UMLCanvasObject(const QString & name = "", Uml::IDType id = Uml::id_None); 00047 00051 virtual ~UMLCanvasObject(); 00052 00056 virtual bool operator==(UMLCanvasObject& rhs); 00057 00062 virtual void copyInto(UMLCanvasObject *rhs) const; 00063 00064 // The abstract method UMLObject::clone() is implemented 00065 // in the classes inheriting from UMLCanvasObject. 00066 00073 bool addAssociationEnd(UMLAssociation* assoc); 00074 00080 bool hasAssociation(UMLAssociation* assoc); 00081 00088 int removeAssociationEnd(UMLAssociation *assoc); 00089 00093 void removeAllAssociationEnds(); 00094 00101 int associations(); 00102 00108 UMLAssociationList getAssociations(); 00109 00116 UMLAssociationList getSpecificAssocs(Uml::Association_Type assocType); 00117 00125 UMLClassifierList getSuperClasses(); 00126 00134 UMLClassifierList getSubClasses(); 00135 00141 virtual UMLAssociationList getRealizations(); 00142 00148 UMLAssociationList getAggregations(); 00149 00155 UMLAssociationList getCompositions(); 00156 00162 UMLAssociationList getRelationships(); 00163 00172 virtual UMLObject *findChildObject(const QString &n, Uml::Object_Type t = Uml::ot_UMLObject); 00173 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
