umbrello: umbrello/codegenerators/hierarchicalcodeblock.h Source File

umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

hierarchicalcodeblock.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
8 * copyright (C) 2004-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef HIERARCHICALCODEBLOCK_H
13 #define HIERARCHICALCODEBLOCK_H
14
15 #include "codegenobjectwithtextblocks.h"
16 #include "codeblockwithcomments.h"
17 #include "codeclassfieldlist.h"
18
19 #include <QMap>
20 #include <QString>
21
22 class HierarchicalCodeBlock : public CodeBlockWithComments, public CodeGenObjectWithTextBlocks
23 {
24 friend class CodeGenObjectWithTextBlocks;
25 public:
26
27 explicit HierarchicalCodeBlock (CodeDocument * doc, const QString &startString = QString(), const QString &endString = QString(), const QString &comment = QString());
28
32 virtual ~HierarchicalCodeBlock ();
33
34 void setEndText (const QString &new_var);
35
36 QString getEndText () const;
37
38 bool addTextBlock (TextBlock * add_object);
39
40 bool insertTextBlock (TextBlock * newBlock, TextBlock * existingBlock, bool after = true);
41
42 bool removeTextBlock (TextBlock * remove_object);
43
44 void setStartText (const QString &text);
45
46 QString getStartText () const;
47
48 virtual void saveToXMI1 (QDomDocument & doc, QDomElement & root);
49
50 virtual void loadFromXMI1 (QDomElement & root);
51
52 virtual QString toString () const;
53
54 QString getUniqueTag();
55 QString getUniqueTag(const QString& prefix);
56
57 void addCodeClassFieldMethods (CodeClassFieldList &list);
58
59 virtual CodeBlock * newCodeBlock();
60 virtual CodeBlockWithComments * newCodeBlockWithComments();
61 virtual HierarchicalCodeBlock * newHierarchicalCodeBlock();
62
63 protected:
64
65 virtual void release ();
66
67 virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & elem);
68
69 virtual void setAttributesFromNode (QDomElement & element);
70
71 virtual void setAttributesFromObject (TextBlock * obj);
72
73 TextBlock * findCodeClassFieldTextBlockByTag (const QString &tag);
74
75 private:
76
77 QString m_startText;
78 QString m_endText;
79
80 QString childTextBlocksToString() const;
81 void initAttributes () ;
82
83 };
84
85 #endif // HIERARCHICALCODEBLOCK_H
CodeBlockWithComments
Definition: codeblockwithcomments.h:24
CodeBlock
Definition: codeblock.h:21
CodeDocument
Definition: codedocument.h:33
CodeGenObjectWithTextBlocks
Definition: codegenobjectwithtextblocks.h:32
HierarchicalCodeBlock
Definition: hierarchicalcodeblock.h:23
HierarchicalCodeBlock::m_endText
QString m_endText
Definition: hierarchicalcodeblock.h:78
HierarchicalCodeBlock::m_startText
QString m_startText
Definition: hierarchicalcodeblock.h:77
HierarchicalCodeBlock::release
virtual void release()
Definition: hierarchicalcodeblock.cpp:386
HierarchicalCodeBlock::findCodeClassFieldTextBlockByTag
TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)
Definition: hierarchicalcodeblock.cpp:362
HierarchicalCodeBlock::newCodeBlockWithComments
virtual CodeBlockWithComments * newCodeBlockWithComments()
Definition: hierarchicalcodeblock.cpp:78
HierarchicalCodeBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: hierarchicalcodeblock.cpp:297
HierarchicalCodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &elem)
Definition: hierarchicalcodeblock.cpp:251
HierarchicalCodeBlock::toString
virtual QString toString() const
Definition: hierarchicalcodeblock.cpp:313
HierarchicalCodeBlock::setStartText
void setStartText(const QString &text)
Definition: hierarchicalcodeblock.cpp:199
HierarchicalCodeBlock::~HierarchicalCodeBlock
virtual ~HierarchicalCodeBlock()
Definition: hierarchicalcodeblock.cpp:35
HierarchicalCodeBlock::getEndText
QString getEndText() const
Definition: hierarchicalcodeblock.cpp:52
HierarchicalCodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: hierarchicalcodeblock.cpp:269
HierarchicalCodeBlock::saveToXMI1
virtual void saveToXMI1(QDomDocument &doc, QDomElement &root)
Definition: hierarchicalcodeblock.cpp:240
HierarchicalCodeBlock::newCodeBlock
virtual CodeBlock * newCodeBlock()
Definition: hierarchicalcodeblock.cpp:73
HierarchicalCodeBlock::initAttributes
void initAttributes()
Definition: hierarchicalcodeblock.cpp:374
HierarchicalCodeBlock::insertTextBlock
bool insertTextBlock(TextBlock *newBlock, TextBlock *existingBlock, bool after=true)
Definition: hierarchicalcodeblock.cpp:107
HierarchicalCodeBlock::HierarchicalCodeBlock
HierarchicalCodeBlock(CodeDocument *doc, const QString &startString=QString(), const QString &endString=QString(), const QString &comment=QString())
Definition: hierarchicalcodeblock.cpp:27
HierarchicalCodeBlock::setEndText
void setEndText(const QString &new_var)
Definition: hierarchicalcodeblock.cpp:43
HierarchicalCodeBlock::removeTextBlock
bool removeTextBlock(TextBlock *remove_object)
Definition: hierarchicalcodeblock.cpp:169
HierarchicalCodeBlock::addCodeClassFieldMethods
void addCodeClassFieldMethods(CodeClassFieldList &list)
Definition: hierarchicalcodeblock.cpp:215
HierarchicalCodeBlock::childTextBlocksToString
QString childTextBlocksToString() const
Definition: hierarchicalcodeblock.cpp:346
HierarchicalCodeBlock::getStartText
QString getStartText() const
Definition: hierarchicalcodeblock.cpp:207
HierarchicalCodeBlock::addTextBlock
bool addTextBlock(TextBlock *add_object)
Definition: hierarchicalcodeblock.cpp:93
HierarchicalCodeBlock::newHierarchicalCodeBlock
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock()
Definition: hierarchicalcodeblock.cpp:83
HierarchicalCodeBlock::getUniqueTag
QString getUniqueTag()
Definition: hierarchicalcodeblock.cpp:60
HierarchicalCodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: hierarchicalcodeblock.cpp:278
TextBlock
Definition: textblock.h:25
codeblockwithcomments.h
codeclassfieldlist.h
CodeClassFieldList
QList< CodeClassField * > CodeClassFieldList
Definition: codeclassfieldlist.h:17
codegenobjectwithtextblocks.h