umbrello: CodeBlockWithComments Class Reference

umbrello 2.32.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CodeBlockWithComments Class Reference

`#include <codeblockwithcomments.h>`

Inheritance diagram for CodeBlockWithComments:

## Public Member Functions
| CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeBlockWithComments ()
void | setComment (CodeComment *object)
CodeComment * | getComment () const
virtual QString | toString () const
void | setOverallIndentationLevel (int level)
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
virtual void | loadFromXMI1 (QDomElement &root)
virtual void | setAttributesFromObject (TextBlock *obj)
Public Member Functions inherited from CodeBlock
| CodeBlock (CodeDocument *parent, const QString &body=QString())
virtual | ~CodeBlock ()
void | setContentType (ContentType new_var)
ContentType | contentType () const
Public Member Functions inherited from TextBlock
| TextBlock (CodeDocument *parent, const QString &text=QString())
virtual | ~TextBlock ()
void | setText (const QString &text)
QString | getText () const
void | appendText (const QString &text)
void | setTag (const QString &value)
QString | getTag () const
CodeDocument * | getParentDocument () const
void | setWriteOutText (bool write)
bool | getWriteOutText () const
void | setIndentationLevel (int level)
int | getIndentationLevel () const
QString | getIndentationString (int level=0) const
virtual QString | unformatText (const QString &text, const QString &indent=QString())
bool | canDelete () const
virtual QString | getNewEditorLine (int amount=0)
virtual int | firstEditableLine ()
virtual int | lastEditableLine ()

## Protected Member Functions
virtual void | setAttributesOnNode (QXmlStreamWriter &writer)
virtual void | setAttributesFromNode (QDomElement &element)
Protected Member Functions inherited from TextBlock
void | setCanDelete (bool canDelete)
virtual void | release ()

## Private Attributes
CodeComment * | m_comment

## Additional Inherited Members
Public Types inherited from CodeBlock
enum | ContentType { AutoGenerated =0 , UserGenerated }
Static Public Member Functions inherited from CodeBlock
static QString | enumToString (const ContentType &val)
Static Public Member Functions inherited from TextBlock
static QString | getIndentation ()
static QString | getNewLineEndingChars ()
static QString | formatMultiLineText (const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true)
static QString | encodeText (const QString &text, const QString &endLine)
static QString | decodeText (const QString &text, const QString &endLine)

## Detailed Description

class CodeBlockWithComments A very common type of text block in any type of code.

## Constructor & Destructor Documentation

## ◆ CodeBlockWithComments()

CodeBlockWithComments::CodeBlockWithComments | ( | CodeDocument * | parent,
|  | const QString & | body = `QString()`,
|  | const QString & | comment = `QString()`
| ) |  |
| explicit

Basic Constructor

## ◆ ~CodeBlockWithComments()

CodeBlockWithComments::~CodeBlockWithComments | ( |  | ) |
| virtual

Empty Destructor

## Member Function Documentation

## ◆ getComment()

CodeComment * CodeBlockWithComments::getComment | ( |  | ) | const

Get the Comment object.

## ◆ loadFromXMI1()

void CodeBlockWithComments::loadFromXMI1 | ( | QDomElement & | root | ) |
| virtual

Load params from the appropriate XMI element node.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

## ◆ saveToXMI1()

void CodeBlockWithComments::saveToXMI1 | ( | QXmlStreamWriter & | writer | ) |
| virtual

Save the XMI representation of this object

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

## ◆ setAttributesFromNode()

void CodeBlockWithComments::setAttributesFromNode | ( | QDomElement & | root | ) |
| protectedvirtual

Set the class attributes of this object from the passed element node.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, DCodeAccessorMethod, HierarchicalCodeBlock, JavaCodeAccessorMethod, OwnedHierarchicalCodeBlock, RubyCodeAccessorMethod, and XMLElementCodeBlock.

## ◆ setAttributesFromObject()

void CodeBlockWithComments::setAttributesFromObject | ( | TextBlock * | obj | ) |
| virtual

Set the class attributes from a passed object.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, and OwnedHierarchicalCodeBlock.

## ◆ setAttributesOnNode()

void CodeBlockWithComments::setAttributesOnNode | ( | QXmlStreamWriter & | writer | ) |
| protectedvirtual

Set attributes of the node that represents this class in the XMI document.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, DCodeAccessorMethod, HierarchicalCodeBlock, JavaCodeAccessorMethod, OwnedHierarchicalCodeBlock, RubyCodeAccessorMethod, and XMLElementCodeBlock.

## ◆ setComment()

void CodeBlockWithComments::setComment | ( | CodeComment * | object | ) |

Set the Comment object.

## ◆ setOverallIndentationLevel()

void CodeBlockWithComments::setOverallIndentationLevel | ( | int | level | ) |

A utility method that causes the comment and body of the code block to have the same indentation level.

## ◆ toString()

QString CodeBlockWithComments::toString | ( |  | ) | const
| virtual

Returns
  QString

Reimplemented from TextBlock.

Reimplemented in CodeMethodBlock, and HierarchicalCodeBlock.

## Member Data Documentation

## ◆ m_comment

CodeComment* CodeBlockWithComments::m_comment
| private

The documentation for this class was generated from the following files:

- umbrello/codegenerators/codeblockwithcomments.h
- umbrello/codegenerators/codeblockwithcomments.cpp