umbrello API Documentation

codeaccessormethod.h

00001 
00002 /***************************************************************************
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU General Public License as published by  *
00006  *   the Free Software Foundation; either version 2 of the License, or     *
00007  *   (at your option) any later version.                                   *
00008  *                                                                         *
00009  ***************************************************************************/
00010 
00011 /*  This code generated by:
00012  *      Author : thomas
00013  *      Date   : Tue Jul 1 2003
00014  */
00015 
00016 
00017 
00018 #ifndef CODEACCESSORMETHOD_H
00019 #define CODEACCESSORMETHOD_H
00020 
00021 #include <qstring.h>
00022 #include "codemethodblock.h"
00023 
00024 class CodeClassField;
00025 
00026 class CodeAccessorMethod : public CodeMethodBlock
00027 {
00028     friend class CodeClassField;
00029     Q_OBJECT
00030 public:
00031 
00032     // some types of accessor methods that are possible:
00033     // "GET" is to retrieve single-valued (primative or Object) fields
00034     // "SET" is to set single-valued (primative or Object) fields
00035     // "ADD" is to add a value to a multiple-valued field of either primative or Object items
00036     // "REMOVE" is to remove a value to a multiple-valued field of either primative or Object items
00037     // "LIST" is to retrive the entire list of items in a  multiple-valued field
00038     enum AccessorType {GET=0, SET, ADD, REMOVE, LIST};
00039 
00040     // Constructors/Destructors
00041     //
00042 
00043 
00047     CodeAccessorMethod ( CodeClassField * field );
00048 
00052     virtual ~CodeAccessorMethod ( );
00053 
00058     CodeClassField * getParentClassField ( );
00059 
00062     AccessorType getType( );
00063 
00066     void setType ( AccessorType type);
00067 
00070     // virtual UMLObject * getParentObject();
00071 
00072     bool parentIsAttribute();
00073 
00077     virtual void saveToXMI ( QDomDocument & doc, QDomElement & root );
00078 
00082     virtual void loadFromXMI ( QDomElement & root );
00083 
00086     virtual void setAttributesFromObject (TextBlock * obj);
00087 
00088 protected:
00089 
00090     virtual void release ();
00091 
00095     virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement);
00096 
00100     virtual void setAttributesFromNode ( QDomElement & element);
00101 
00102     virtual void updateMethodDeclaration() = 0;
00103 
00104     virtual void updateContent() = 0;
00105 
00106     // a method so the parent code classfield can force code block to release
00107     void forceRelease ();
00108 
00109 private:
00110 
00111     CodeClassField * m_parentclassfield;
00112     AccessorType m_accessorType;
00113 
00114     void initFields(CodeClassField * parentCF );
00115 
00116 };
00117 
00118 #endif // CODEACCESSORMETHOD_H
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:55 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003