• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
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-2013 *
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 = "");
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 saveToXMI(QDomDocument & doc, QDomElement & root);
41  virtual void loadFromXMI(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).
56  ContentType m_contentType;
57 
58 };
59 
60 #endif // CODEBLOCK_H
CodeBlock::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeblock.cpp:91
CodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Set attributes of the node that represents this class in the XMI document.
Definition: codeblock.cpp:78
CodeBlock
A "chunk" of code within the code document.
Definition: codeblock.h:20
CodeBlock::AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
CodeBlock::contentType
ContentType contentType() const
Get the value of m_contentType specifies whether the content (text) of this object was generated by t...
Definition: codeblock.cpp:54
CodeBlock::ContentType
ContentType
Describes the creation of the content.
Definition: codeblock.h:27
textblock.h
CodeBlock::UserGenerated
the content was entered by the user
Definition: codeblock.h:29
CodeBlock::CodeBlock
CodeBlock(CodeDocument *parent, const QString &body="")
Constructor.
Definition: codeblock.cpp:24
CodeBlock::enumToString
static QString enumToString(const ContentType &val)
Return a string representation of ContentType.
Definition: codeblock.cpp:127
CodeBlock::operator<<
friend QDebug operator<<(QDebug str, const CodeBlock &obj)
Definition: codeblock.cpp:137
CodeDocument
A document containing the code for one file.
Definition: codedocument.h:32
CodeBlock::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeblock.cpp:64
TextBlock
The fundemental unit of text within an output file containing code.
Definition: textblock.h:24
CodeBlock::setContentType
void setContentType(ContentType new_var)
Set the value of m_contentType specifies whether the content (text) of this object was generated by t...
Definition: codeblock.cpp:43
CodeBlock::~CodeBlock
virtual ~CodeBlock()
Empty Destructor.
Definition: codeblock.cpp:33
CodeBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Set the class attributes from a passed object.
Definition: codeblock.cpp:113
CodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Set the class attributes of this object from the passed element node.
Definition: codeblock.cpp:101
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal