umbrello/umbrello
operation.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 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 { 00027 Q_OBJECT 00028 public: 00041 UMLOperation(UMLClassifier * parent, const QString& name, 00042 Uml::IDType id = Uml::id_None, 00043 Uml::Visibility s = Uml::Visibility::Public, 00044 UMLObject *rt = 0); 00045 00054 UMLOperation(UMLClassifier * parent); 00055 00056 public: 00057 00061 virtual ~UMLOperation(); 00062 00066 bool operator==( const UMLOperation & rhs ); 00067 00072 virtual void copyInto(UMLObject *lhs) const; 00073 00077 virtual UMLObject* clone() const; 00078 00084 void setType(UMLObject *type); 00085 00091 void moveParmLeft(UMLAttribute *a); 00092 00098 void moveParmRight(UMLAttribute *a); 00099 00108 void removeParm(UMLAttribute *a, bool emitModifiedSignal = true); 00109 00115 UMLAttributeList getParmList() { 00116 return m_List; 00117 } 00118 00125 UMLAttribute * findParm(const QString &name); 00126 00133 QString toString(Uml::Signature_Type sig = Uml::st_NoSig); 00134 00143 void addParm(UMLAttribute *parameter, int position = -1); 00144 00151 bool resolveRef(); 00152 00156 QString getUniqueParameterName(); 00157 00163 bool showPropertiesDialog(QWidget* parent); 00164 00170 bool isConstructorOperation(); 00171 00177 bool isDestructorOperation(); 00178 00184 bool isLifeOperation(); 00185 00189 void setConst(bool b); 00190 00194 bool getConst() const; 00195 00201 void setSourceCode(const QString& code); 00202 00206 QString getSourceCode() const; 00207 00211 void saveToXMI( QDomDocument & qDoc, QDomElement & qElement ); 00212 00213 protected: 00217 bool load( QDomElement & element ); 00218 00219 private: 00220 Uml::IDType m_returnId; 00221 UMLAttributeList m_List; 00222 bool m_bConst; 00223 QString m_Code; 00224 }; 00225 00226 #endif
KDE 4.0 API Reference