umbrello  2.32.3
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 {
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).
57 
58 };
59 
60 #endif // CODEBLOCK_H
Definition: codeblock.h:21
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeblock.cpp:101
ContentType
Definition: codeblock.h:27
@ UserGenerated
the content was entered by the user
Definition: codeblock.h:29
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
friend QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:137
void setContentType(ContentType new_var)
Definition: codeblock.cpp:43
static QString enumToString(const ContentType &val)
Definition: codeblock.cpp:127
virtual ~CodeBlock()
Definition: codeblock.cpp:33
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: codeblock.cpp:64
ContentType m_contentType
Definition: codeblock.h:56
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codeblock.cpp:113
ContentType contentType() const
Definition: codeblock.cpp:54
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblock.cpp:91
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: codeblock.cpp:78
CodeBlock(CodeDocument *parent, const QString &body=QString())
Definition: codeblock.cpp:24
Definition: codedocument.h:34
Definition: textblock.h:27