hierarchicalcodeblock.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00035
00036
00040 explicit HierarchicalCodeBlock ( CodeDocument * doc , const QString &startString = "", const QString &endString = "", const QString &comment = "");
00041
00045 virtual ~HierarchicalCodeBlock ( );
00046
00047
00048
00049
00050
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
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
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
This file is part of the documentation for umbrello Version 3.1.0.