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 {
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(QDomDocument & doc, QDomElement & root);
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(QDomDocument & doc, QDomElement & blockElement);
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
TextBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &root)
Definition: textblock.cpp:361
CodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblock.cpp:91
textblock.h
CodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeblock.cpp:101
TextBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: textblock.cpp:347
CodeBlock::operator<<
friend QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:137
CodeBlock::m_contentType
ContentType m_contentType
Definition: codeblock.h:56
CodeDocument
Definition: codedocument.h:33
codeblock.h
CodeBlock::UserGenerated
@ UserGenerated
the content was entered by the user
Definition: codeblock.h:29
CodeBlock::~CodeBlock
virtual ~CodeBlock()
Definition: codeblock.cpp:33
CodeBlock
Definition: codeblock.h:21
operator<<
QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:137
CodeBlock::enumToString
static QString enumToString(const ContentType &val)
Definition: codeblock.cpp:127
CodeBlock::ContentType
ContentType
Definition: codeblock.h:27
CodeBlock::setContentType
void setContentType(ContentType new_var)
Definition: codeblock.cpp:43
TextBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Definition: textblock.cpp:322
CodeBlock::contentType
ContentType contentType() const
Definition: codeblock.cpp:54
CodeBlock::AutoGenerated
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
CodeBlock::CodeBlock
CodeBlock(CodeDocument *parent, const QString &body=QString())
Definition: codeblock.cpp:24
codedocument.h
debug_utils.h
TextBlock
Definition: textblock.h:25
CodeBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codeblock.cpp:113
CodeBlock::saveToXMI1
virtual void saveToXMI1(QDomDocument &doc, QDomElement &root)
Definition: codeblock.cpp:64
CodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Definition: codeblock.cpp:78