operation.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-2006 * 00009 * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * 00010 ***************************************************************************/ 00011 00012 #ifndef OPERATION_H 00013 #define OPERATION_H 00014 00015 #include "umlattributelist.h" 00016 #include "classifierlistitem.h" 00017 00018 class UMLClassifier; 00019 00025 class UMLOperation : public UMLClassifierListItem { 00026 Q_OBJECT 00027 public: 00040 UMLOperation(const UMLClassifier * parent, const QString& name, 00041 Uml::IDType id = Uml::id_None, 00042 Uml::Visibility s = Uml::Visibility::Public, 00043 UMLObject *rt = 0); 00044 00053 UMLOperation(const UMLClassifier * parent); 00054 public: 00055 00059 virtual ~UMLOperation(); 00060 00064 bool operator==( UMLOperation & rhs ); 00065 00070 virtual void copyInto(UMLOperation *rhs) const; 00071 00075 virtual UMLObject* clone() const; 00076 00082 void setType(UMLObject *type); 00083 00089 void moveParmLeft(UMLAttribute *a); 00090 00096 void moveParmRight(UMLAttribute *a); 00097 00106 void removeParm(UMLAttribute *a, bool emitModifiedSignal = true); 00107 00113 UMLAttributeList getParmList() { 00114 return m_List; 00115 } 00116 00123 UMLAttribute * findParm(const QString &name); 00124 00131 QString toString(Uml::Signature_Type sig = Uml::st_NoSig); 00132 00141 void addParm(UMLAttribute *parameter, int position = -1); 00142 00149 bool resolveRef(); 00150 00154 QString getUniqueParameterName(); 00155 00159 bool showPropertiesDialog(QWidget* parent); 00160 00166 bool isConstructorOperation(); 00167 00173 bool isDestructorOperation(); 00174 00180 bool isLifeOperation(); 00181 00185 void setConst(bool b); 00186 00190 bool getConst() const; 00191 00195 void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); 00196 00197 protected: 00201 bool load( QDomElement & element ); 00202 00203 private: 00204 Uml::IDType m_returnId; 00205 UMLAttributeList m_List; 00206 bool m_bConst; 00207 }; 00208 00209 #endif
