umbrello: umbrello/codegenerators/codeblock.h Source File

umbrello 2.32.0 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 * 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 CODEBLOCK_H
13 #define CODEBLOCK_H
14
15 #include "textblock.h"
16
20 class CodeBlock : public TextBlock
21 {
22 public:
23
27 enum ContentType {
28 AutoGenerated=0,
29 UserGenerated
30 };
31
32 explicit CodeBlock(CodeDocument * parent, const QString & body = QString());
33 virtual ~CodeBlock();
34
35 void setContentType(ContentType new_var);
36 ContentType contentType() const;
37
38 static QString enumToString(const ContentType& val);
39
40 virtual void saveToXMI1(QXmlStreamWriter& writer);
41 virtual void loadFromXMI1(QDomElement & root);
42
43 virtual void setAttributesFromObject(TextBlock * obj);
44
45 friend QDebug operator<<(QDebug str, const CodeBlock& obj);
46
47 protected:
48
49 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
50 virtual void setAttributesFromNode(QDomElement & element);
51
52 private:
53
54 // specifies whether the content (text) of this object
55 // was generated by the code generator or was supplied by the user (or some other way).
56 ContentType m_contentType;
57
58 };
59
60 #endif // CODEBLOCK_H
CodeBlock
Definition: codeblock.h:21
CodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeblock.cpp:101
CodeBlock::ContentType
ContentType
Definition: codeblock.h:27
CodeBlock::UserGenerated
@ UserGenerated
the content was entered by the user
Definition: codeblock.h:29
CodeBlock::AutoGenerated
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
CodeBlock::operator<<
friend QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:137
CodeBlock::setContentType
void setContentType(ContentType new_var)
Definition: codeblock.cpp:43
CodeBlock::enumToString
static QString enumToString(const ContentType &val)
Definition: codeblock.cpp:127
CodeBlock::~CodeBlock
virtual ~CodeBlock()
Definition: codeblock.cpp:33
CodeBlock::saveToXMI1
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: codeblock.cpp:64
CodeBlock::m_contentType
ContentType m_contentType
Definition: codeblock.h:56
CodeBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codeblock.cpp:113
CodeBlock::contentType
ContentType contentType() const
Definition: codeblock.cpp:54
CodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblock.cpp:91
CodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: codeblock.cpp:78
CodeBlock::CodeBlock
CodeBlock(CodeDocument *parent, const QString &body=QString())
Definition: codeblock.cpp:24
CodeDocument
Definition: codedocument.h:34
TextBlock
Definition: textblock.h:27
textblock.h