package.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 PACKAGE_H 00013 #define PACKAGE_H 00014 00015 #include "umlcanvasobject.h" 00016 #include "umlclassifierlist.h" 00017 00018 // forward declarations 00019 class UMLAssociation; 00020 00021 00034 class UMLPackage : public UMLCanvasObject { 00035 Q_OBJECT 00036 public: 00043 explicit UMLPackage(const QString & name = "", Uml::IDType id = Uml::id_None); 00044 00048 virtual ~UMLPackage(); 00049 00054 virtual void copyInto(UMLPackage *rhs) const; 00055 00059 virtual UMLObject* clone() const; 00060 00064 void init(); 00065 00072 bool addObject(UMLObject *pObject); 00073 00080 void removeObject(UMLObject *pObject); 00081 00086 virtual void removeAllObjects(); 00087 00091 UMLObjectList containedObjects(); 00092 00102 void addAssocToConcepts(UMLAssociation* assoc); 00103 00107 void removeAssocFromConcepts(UMLAssociation *assoc); 00108 00115 UMLObject * findObject(const QString &name); 00116 00123 UMLObject * findObjectById(Uml::IDType id); 00124 00133 void appendClassifiers( UMLClassifierList& classifiers, 00134 bool includeNested = true ); 00135 00144 void appendClasses( UMLClassifierList& classes, bool includeNested = true ); 00145 00154 void appendClassesAndInterfaces(UMLClassifierList& classifiers, 00155 bool includeNested = true); 00156 00165 void appendInterfaces(UMLClassifierList& interfaces, 00166 bool includeNested = true ); 00167 00176 virtual bool resolveRef(); 00177 00181 virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); 00182 00183 protected: 00188 virtual bool load(QDomElement& element); 00189 00194 UMLObjectList m_objects; 00195 00196 }; 00197 00198 #endif
