umbrello: umbrello/codegenerators/codegenobjectwithtextblocks.h Source File

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

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

- File List
- File Members

codegenobjectwithtextblocks.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-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef CODEGENOBJECTWITHTEXTBLOCKS_H
9#define CODEGENOBJECTWITHTEXTBLOCKS_H
10
11#include "codeaccessormethod.h"
12#include "textblocklist.h"
13
14#include <QMap>
15
16class CodeBlock;
17class CodeBlockWithComments;
18class CodeClassField;
19class CodeComment;
20class CodeDocument;
21class HierarchicalCodeBlock;
22class QXmlStreamWriter;
23class TextBlock;
24
28 class CodeGenObjectWithTextBlocks
29{
30public:
31
32 explicit CodeGenObjectWithTextBlocks(CodeDocument *parent);
33 virtual ~CodeGenObjectWithTextBlocks();
34
35 virtual bool addTextBlock(TextBlock * add_object);
36
37 virtual bool removeTextBlock(TextBlock * remove_object);
38
43 virtual bool insertTextBlock(TextBlock * newBlock, TextBlock * existingBlock, bool after) = 0;
44
45 TextBlockList * getTextBlockList() const;
46
47 virtual HierarchicalCodeBlock * getHierarchicalCodeBlock(const QString &tag, const QString &comment, int indentLevel);
48
49 virtual CodeBlockWithComments * getCodeBlockWithComments(const QString &tag, const QString &comment, int indentLevel);
50
51 CodeComment * addOrUpdateTaggedCodeComment(const QString &tag = QString(), const QString &text = QString(), int indentationLevel = 0);
52
53 CodeBlockWithComments * addOrUpdateTaggedCodeBlockWithComments
54 (const QString &tag, const QString &text, const QString &ctext,
55 int indentLevel, bool forceUserBlockUpdate);
56
57 TextBlock * findTextBlockByTag(const QString &tag);
58
63 virtual QString getUniqueTag(const QString& prefix = QString()) = 0;
64
68 virtual CodeBlock * newCodeBlock() = 0;
69 virtual CodeBlockWithComments * newCodeBlockWithComments() = 0;
70 virtual HierarchicalCodeBlock * newHierarchicalCodeBlock() = 0;
71
72 CodeGenObjectWithTextBlocks * findParentObjectForTaggedTextBlock(const QString & tag);
73
74protected:
75
76 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
77
78 virtual void setAttributesFromNode(QDomElement & element);
79
80 /*virtual*/ void setAttributesFromObject(CodeGenObjectWithTextBlocks * obj);
81
82 virtual void loadChildTextBlocksFromNode(QDomElement & root);
83
84 virtual void resetTextBlocks();
85
90 virtual TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag) = 0;
91
92 QMap<QString, TextBlock *> m_textBlockTagMap;
93 TextBlockList m_textblockVector;
94
95private:
96
97 // needed in order to use findTextBlocksByTag
98 CodeDocument *m_pCodeDoc;
99
100};
101
102#endif // CODEGENOBJECTWITHTEXTBLOCKS_H
CodeBlockWithComments
Definition codeblockwithcomments.h:20
CodeBlock
Definition codeblock.h:17
CodeClassField
Definition codeclassfield.h:26
CodeComment
Definition codecomment.h:20
CodeDocument
Definition codedocument.h:30
CodeGenObjectWithTextBlocks
Definition codegenobjectwithtextblocks.h:29
CodeGenObjectWithTextBlocks::CodeGenObjectWithTextBlocks
CodeGenObjectWithTextBlocks(CodeDocument *parent)
Definition codegenobjectwithtextblocks.cpp:28
CodeGenObjectWithTextBlocks::insertTextBlock
virtual bool insertTextBlock(TextBlock *newBlock, TextBlock *existingBlock, bool after)=0
CodeGenObjectWithTextBlocks::addTextBlock
virtual bool addTextBlock(TextBlock *add_object)
Definition codegenobjectwithtextblocks.cpp:56
CodeGenObjectWithTextBlocks::~CodeGenObjectWithTextBlocks
virtual ~CodeGenObjectWithTextBlocks()
Definition codegenobjectwithtextblocks.cpp:36
CodeGenObjectWithTextBlocks::newCodeBlockWithComments
virtual CodeBlockWithComments * newCodeBlockWithComments()=0
CodeGenObjectWithTextBlocks::newCodeBlock
virtual CodeBlock * newCodeBlock()=0
CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment
CodeComment * addOrUpdateTaggedCodeComment(const QString &tag=QString(), const QString &text=QString(), int indentationLevel=0)
Definition codegenobjectwithtextblocks.cpp:239
CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments
CodeBlockWithComments * addOrUpdateTaggedCodeBlockWithComments(const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate)
Definition codegenobjectwithtextblocks.cpp:279
CodeGenObjectWithTextBlocks::setAttributesFromObject
void setAttributesFromObject(CodeGenObjectWithTextBlocks *obj)
Definition codegenobjectwithtextblocks.cpp:338
CodeGenObjectWithTextBlocks::getHierarchicalCodeBlock
virtual HierarchicalCodeBlock * getHierarchicalCodeBlock(const QString &tag, const QString &comment, int indentLevel)
Definition codegenobjectwithtextblocks.cpp:176
CodeGenObjectWithTextBlocks::resetTextBlocks
virtual void resetTextBlocks()
Definition codegenobjectwithtextblocks.cpp:322
CodeGenObjectWithTextBlocks::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition codegenobjectwithtextblocks.cpp:372
CodeGenObjectWithTextBlocks::m_textblockVector
TextBlockList m_textblockVector
Definition codegenobjectwithtextblocks.h:93
CodeGenObjectWithTextBlocks::findCodeClassFieldTextBlockByTag
virtual TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)=0
CodeGenObjectWithTextBlocks::findTextBlockByTag
TextBlock * findTextBlockByTag(const QString &tag)
Definition codegenobjectwithtextblocks.cpp:121
CodeGenObjectWithTextBlocks::findParentObjectForTaggedTextBlock
CodeGenObjectWithTextBlocks * findParentObjectForTaggedTextBlock(const QString &tag)
Definition codegenobjectwithtextblocks.cpp:141
CodeGenObjectWithTextBlocks::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition codegenobjectwithtextblocks.cpp:354
CodeGenObjectWithTextBlocks::getUniqueTag
virtual QString getUniqueTag(const QString &prefix=QString())=0
CodeGenObjectWithTextBlocks::getCodeBlockWithComments
virtual CodeBlockWithComments * getCodeBlockWithComments(const QString &tag, const QString &comment, int indentLevel)
Definition codegenobjectwithtextblocks.cpp:208
CodeGenObjectWithTextBlocks::m_textBlockTagMap
QMap< QString, TextBlock * > m_textBlockTagMap
Definition codegenobjectwithtextblocks.h:92
CodeGenObjectWithTextBlocks::newHierarchicalCodeBlock
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock()=0
CodeGenObjectWithTextBlocks::loadChildTextBlocksFromNode
virtual void loadChildTextBlocksFromNode(QDomElement &root)
Definition codegenobjectwithtextblocks.cpp:389
CodeGenObjectWithTextBlocks::removeTextBlock
virtual bool removeTextBlock(TextBlock *remove_object)
Definition codegenobjectwithtextblocks.cpp:91
CodeGenObjectWithTextBlocks::m_pCodeDoc
CodeDocument * m_pCodeDoc
Definition codegenobjectwithtextblocks.h:98
CodeGenObjectWithTextBlocks::getTextBlockList
TextBlockList * getTextBlockList() const
Definition codegenobjectwithtextblocks.cpp:45
HierarchicalCodeBlock
Definition hierarchicalcodeblock.h:21
TextBlock
Definition textblock.h:23
codeaccessormethod.h
textblocklist.h
TextBlockList
QList< TextBlock * > TextBlockList
Definition textblocklist.h:14