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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

hierarchicalcodeblock.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
5 SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef HIERARCHICALCODEBLOCK_H
9#define HIERARCHICALCODEBLOCK_H
10
11#include "codegenobjectwithtextblocks.h"
12#include "codeblockwithcomments.h"
13#include "codeclassfieldlist.h"
14
15#include <QMap>
16#include <QString>
17
18 class QXmlStreamWriter;
19
20 class HierarchicalCodeBlock : public CodeBlockWithComments, public CodeGenObjectWithTextBlocks
21{
22 friend class CodeGenObjectWithTextBlocks;
23 public:
24
25 explicit HierarchicalCodeBlock (CodeDocument * doc, const QString &startString = QString(), const QString &endString = QString(), const QString &comment = QString());
26
30 virtual ~HierarchicalCodeBlock ();
31
32 void setEndText (const QString &new_var);
33
34 QString getEndText () const;
35
36 bool addTextBlock (TextBlock * add_object);
37
38 bool insertTextBlock (TextBlock * newBlock, TextBlock * existingBlock, bool after = true);
39
40 bool removeTextBlock (TextBlock * remove_object);
41
42 void setStartText (const QString &text);
43
44 QString getStartText () const;
45
46 virtual void saveToXMI(QXmlStreamWriter& writer);
47
48 virtual void loadFromXMI (QDomElement & root);
49
50 virtual QString toString () const;
51
52 QString getUniqueTag();
53 QString getUniqueTag(const QString& prefix);
54
55 void addCodeClassFieldMethods (CodeClassFieldList &list);
56
57 virtual CodeBlock * newCodeBlock();
58 virtual CodeBlockWithComments * newCodeBlockWithComments();
59 virtual HierarchicalCodeBlock * newHierarchicalCodeBlock();
60
61 protected:
62
63 virtual void release ();
64
65 virtual void setAttributesOnNode (QXmlStreamWriter& writer);
66
67 virtual void setAttributesFromNode (QDomElement & element);
68
69 virtual void setAttributesFromObject (TextBlock * obj);
70
71 TextBlock * findCodeClassFieldTextBlockByTag (const QString &tag);
72
73 private:
74
75 QString m_startText;
76 QString m_endText;
77
78 QString childTextBlocksToString() const;
79 void initAttributes () ;
80
81};
82
83#endif // HIERARCHICALCODEBLOCK_H
CodeBlock
Definition: codeblock.h:17
CodeBlockWithComments
Definition: codeblockwithcomments.h:20
CodeDocument
Definition: codedocument.h:30
CodeGenObjectWithTextBlocks
Definition: codegenobjectwithtextblocks.h:29
HierarchicalCodeBlock
Definition: hierarchicalcodeblock.h:21
HierarchicalCodeBlock::m_endText
QString m_endText
Definition: hierarchicalcodeblock.h:76
HierarchicalCodeBlock::m_startText
QString m_startText
Definition: hierarchicalcodeblock.h:75
HierarchicalCodeBlock::release
virtual void release()
Definition: hierarchicalcodeblock.cpp:385
HierarchicalCodeBlock::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Definition: hierarchicalcodeblock.cpp:267
HierarchicalCodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: hierarchicalcodeblock.cpp:249
HierarchicalCodeBlock::findCodeClassFieldTextBlockByTag
TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)
Definition: hierarchicalcodeblock.cpp:360
HierarchicalCodeBlock::newCodeBlockWithComments
virtual CodeBlockWithComments * newCodeBlockWithComments()
Definition: hierarchicalcodeblock.cpp:77
HierarchicalCodeBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: hierarchicalcodeblock.cpp:295
HierarchicalCodeBlock::toString
virtual QString toString() const
Definition: hierarchicalcodeblock.cpp:311
HierarchicalCodeBlock::setStartText
void setStartText(const QString &text)
Definition: hierarchicalcodeblock.cpp:197
HierarchicalCodeBlock::~HierarchicalCodeBlock
virtual ~HierarchicalCodeBlock()
Definition: hierarchicalcodeblock.cpp:34
HierarchicalCodeBlock::getEndText
QString getEndText() const
Definition: hierarchicalcodeblock.cpp:51
HierarchicalCodeBlock::newCodeBlock
virtual CodeBlock * newCodeBlock()
Definition: hierarchicalcodeblock.cpp:72
HierarchicalCodeBlock::initAttributes
void initAttributes()
Definition: hierarchicalcodeblock.cpp:373
HierarchicalCodeBlock::insertTextBlock
bool insertTextBlock(TextBlock *newBlock, TextBlock *existingBlock, bool after=true)
Definition: hierarchicalcodeblock.cpp:106
HierarchicalCodeBlock::setEndText
void setEndText(const QString &new_var)
Definition: hierarchicalcodeblock.cpp:42
HierarchicalCodeBlock::removeTextBlock
bool removeTextBlock(TextBlock *remove_object)
Definition: hierarchicalcodeblock.cpp:167
HierarchicalCodeBlock::addCodeClassFieldMethods
void addCodeClassFieldMethods(CodeClassFieldList &list)
Definition: hierarchicalcodeblock.cpp:213
HierarchicalCodeBlock::childTextBlocksToString
QString childTextBlocksToString() const
Definition: hierarchicalcodeblock.cpp:344
HierarchicalCodeBlock::getStartText
QString getStartText() const
Definition: hierarchicalcodeblock.cpp:205
HierarchicalCodeBlock::addTextBlock
bool addTextBlock(TextBlock *add_object)
Definition: hierarchicalcodeblock.cpp:92
HierarchicalCodeBlock::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: hierarchicalcodeblock.cpp:238
HierarchicalCodeBlock::newHierarchicalCodeBlock
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock()
Definition: hierarchicalcodeblock.cpp:82
HierarchicalCodeBlock::getUniqueTag
QString getUniqueTag()
Definition: hierarchicalcodeblock.cpp:59
HierarchicalCodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: hierarchicalcodeblock.cpp:276
TextBlock
Definition: textblock.h:23
codeblockwithcomments.h
codeclassfieldlist.h
CodeClassFieldList
QList< CodeClassField * > CodeClassFieldList
Definition: codeclassfieldlist.h:14
codegenobjectwithtextblocks.h