umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
codeblock.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 CODEBLOCK_H
9#define CODEBLOCK_H
10
11#include "textblock.h"
12
16class CodeBlock : public TextBlock
17{
18public:
19
26 };
27
28 explicit CodeBlock(CodeDocument * parent, const QString & body = QString());
29 virtual ~CodeBlock();
30
31 void setContentType(ContentType new_var);
33
34 static QString enumToString(const ContentType& val);
35
36 virtual void saveToXMI(QXmlStreamWriter& writer);
37 virtual void loadFromXMI(QDomElement & root);
38
39 virtual void setAttributesFromObject(TextBlock * obj);
40
41 friend QDebug operator<<(QDebug str, const CodeBlock& obj);
42
43protected:
44
45 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
46 virtual void setAttributesFromNode(QDomElement & element);
47
48private:
49
50 // specifies whether the content (text) of this object
51 // was generated by the code generator or was supplied by the user (or some other way).
53
54};
55
56#endif // CODEBLOCK_H
Definition: codeblock.h:17
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeblock.cpp:95
virtual void loadFromXMI(QDomElement &root)
Definition: codeblock.cpp:85
ContentType
Definition: codeblock.h:23
@ UserGenerated
the content was entered by the user
Definition: codeblock.h:25
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:24
friend QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:131
void setContentType(ContentType new_var)
Definition: codeblock.cpp:39
static QString enumToString(const ContentType &val)
Definition: codeblock.cpp:121
virtual ~CodeBlock()
Definition: codeblock.cpp:29
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: codeblock.cpp:59
ContentType m_contentType
Definition: codeblock.h:52
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codeblock.cpp:107
ContentType contentType() const
Definition: codeblock.cpp:50
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: codeblock.cpp:72
CodeBlock(CodeDocument *parent, const QString &body=QString())
Definition: codeblock.cpp:20
Definition: codedocument.h:30
Definition: textblock.h:23