umbrello API Documentation

hierarchicalcodeblock.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) 2004-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 /*  This code generated by:
00013  *      Author : thomas
00014  *      Date   : Wed Jun 18 2003
00015  */
00016 
00017 
00018 #ifndef HIERARCHICALCODEBLOCK_H
00019 #define HIERARCHICALCODEBLOCK_H
00020 
00021 #include <qmap.h>
00022 #include <qstring.h>
00023 
00024 #include "codegenobjectwithtextblocks.h"
00025 #include "codeblockwithcomments.h"
00026 #include "codeclassfieldlist.h"
00027 
00028 class HierarchicalCodeBlock : public CodeBlockWithComments, public CodeGenObjectWithTextBlocks
00029 {
00030     Q_OBJECT
00031     friend class CodeGenObjectWithTextBlocks;
00032 public:
00033 
00034     // Constructors/Destructors
00035     //
00036 
00040     explicit HierarchicalCodeBlock ( CodeDocument * doc , const QString &startString = "", const QString &endString = "", const QString &comment = "");
00041 
00045     virtual ~HierarchicalCodeBlock ( );
00046 
00047     // Public attributes
00048     //
00049 
00050     // Public attribute accessor methods
00051     //
00052 
00057     void setEndText ( const QString &new_var );
00058 
00063     QString getEndText ( );
00064 
00068     bool addTextBlock ( TextBlock * add_object );
00069 
00074     bool insertTextBlock (TextBlock * newBlock, TextBlock * existingBlock, bool after = true);
00075 
00080     bool removeTextBlock ( TextBlock * remove_object );
00081 
00085     void setStartText ( const QString &text );
00086 
00090     QString getStartText ( );
00091 
00095     virtual void saveToXMI ( QDomDocument & doc, QDomElement & root );
00096 
00100     virtual void loadFromXMI ( QDomElement & root );
00101 
00105     virtual QString toString ( );
00106 
00107     // return a unique, and currently unallocated, text block tag for this hblock
00108     QString getUniqueTag();
00109     QString getUniqueTag( QString prefix );
00110 
00114     void addCodeClassFieldMethods ( CodeClassFieldList &list );
00115 
00116     virtual CodeBlock * newCodeBlock();
00117     virtual CodeBlockWithComments * newCodeBlockWithComments();
00118     virtual HierarchicalCodeBlock * newHierarchicalCodeBlock();
00119 
00120 protected:
00121 
00126     virtual void release ();
00127 
00131     virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & elem );
00132 
00136     virtual void setAttributesFromNode ( QDomElement & element);
00137 
00140     virtual void setAttributesFromObject (TextBlock * obj);
00141 
00142     // look for specific text blocks which belong to code classfields
00143     TextBlock * findCodeClassFieldTextBlockByTag ( const QString &tag );
00144 
00145 private:
00146 
00147     QString m_startText;
00148     QString m_endText;
00149 
00150     QString childTextBlocksToString();
00151     void initAttributes ( ) ;
00152 
00153 };
00154 
00155 #endif // HIERARCHICALCODEBLOCK_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:57 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003