umbrello: CodeMethodBlock Class Reference

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

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Slots | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
CodeMethodBlock Class Referenceabstract

`#include <codemethodblock.h>`

Inheritance diagram for CodeMethodBlock:

## Public Slots
virtual void | syncToParent ()
Public Slots inherited from OwnedCodeBlock
virtual void | syncToParent ()

## Public Member Functions
| CodeMethodBlock (ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeMethodBlock ()
virtual QString | toString () const
QString | getStartMethodText () const
QString | getEndMethodText () const
CodeDocument * | getParentDocument ()
virtual void | updateContent ()=0
Public Member Functions inherited from OwnedCodeBlock
| OwnedCodeBlock (UMLObject *parent)
virtual | ~OwnedCodeBlock ()
UMLObject * | getParentObject ()
Public Member Functions inherited from CodeBlockWithComments
| CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeBlockWithComments ()
void | setComment (CodeComment *object)
CodeComment * | getComment () const
void | setOverallIndentationLevel (int level)
virtual void | saveToXMI (QXmlStreamWriter &writer)
virtual void | loadFromXMI (QDomElement &root)
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 | release ()
void | setStartMethodText (const QString &value)
void | setEndMethodText (const QString &value)
virtual void | updateMethodDeclaration ()=0
virtual void | setAttributesOnNode (QXmlStreamWriter &writer)
virtual void | setAttributesFromNode (QDomElement &element)
virtual void | setAttributesFromObject (TextBlock *obj)
Protected Member Functions inherited from TextBlock
void | setCanDelete (bool canDelete)

## Private Attributes
QString | m_startMethod
QString | m_endMethod

## Friends
class | CodeGenObjectWithTextBlocks

## 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 CodeMethodBlock A common type of "code block" that occurs in OO code. Note: keep the inheritance sequence: QObject needs to be first in inheritance list.

## Constructor & Destructor Documentation

## ◆ CodeMethodBlock()

CodeMethodBlock::CodeMethodBlock | ( | ClassifierCodeDocument * | doc,
|  | UMLObject * | parentObj,
|  | const QString & | body = `QString()`,
|  | const QString & | comment = `QString()`
| ) |  |

Constructors

## ◆ ~CodeMethodBlock()

CodeMethodBlock::~CodeMethodBlock | ( |  | ) |
| virtual

Empty Destructor

## Member Function Documentation

## ◆ getEndMethodText()

QString CodeMethodBlock::getEndMethodText | ( |  | ) | const

Get the ending text that finishes this method after the body is printed.

## ◆ getParentDocument()

CodeDocument * CodeMethodBlock::getParentDocument | ( |  | ) |

Get the parent code document.

## ◆ getStartMethodText()

QString CodeMethodBlock::getStartMethodText | ( |  | ) | const

Get the starting text that begins this method before the body is printed.

## ◆ release()

void CodeMethodBlock::release | ( |  | ) |
| protectedvirtual

Causes the text block to release all of its connections and any other text blocks that it 'owns'. needed to be called prior to deletion of the textblock.

Reimplemented from OwnedCodeBlock.

Reimplemented in CodeAccessorMethod.

## ◆ setAttributesFromNode()

void CodeMethodBlock::setAttributesFromNode | ( | QDomElement & | elem | ) |
| protectedvirtual

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

Reimplemented from OwnedCodeBlock.

Reimplemented in CodeAccessorMethod, CodeOperation, DCodeAccessorMethod, JavaCodeAccessorMethod, and RubyCodeAccessorMethod.

## ◆ setAttributesFromObject()

void CodeMethodBlock::setAttributesFromObject | ( | TextBlock * | obj | ) |
| protectedvirtual

Set the class attributes from a passed object

Reimplemented from OwnedCodeBlock.

Reimplemented in CodeAccessorMethod, and CodeOperation.

## ◆ setAttributesOnNode()

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

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

Reimplemented from OwnedCodeBlock.

Reimplemented in CodeAccessorMethod, CodeOperation, DCodeAccessorMethod, JavaCodeAccessorMethod, and RubyCodeAccessorMethod.

## ◆ setEndMethodText()

void CodeMethodBlock::setEndMethodText | ( | const QString & | value | ) |
| protected

Set the ending text that finishes this method after the body is printed.

## ◆ setStartMethodText()

void CodeMethodBlock::setStartMethodText | ( | const QString & | value | ) |
| protected

Set the starting text that begins this method before the body is printed.

## ◆ syncToParent

void CodeMethodBlock::syncToParent | ( |  | ) |
| virtualslot

## ◆ toString()

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

Returns
  QString

Reimplemented from CodeBlockWithComments.

## ◆ updateContent()

virtual void CodeMethodBlock::updateContent | ( |  | ) |
| pure virtual

This is the method called from within syncToparent() to update the *body* of the method. It is only called if the method is Auto-generated.

Implements OwnedCodeBlock.

Implemented in CodeOperation, CPPHeaderCodeAccessorMethod, CPPHeaderCodeOperation, CPPSourceCodeAccessorMethod, CPPSourceCodeOperation, DCodeAccessorMethod, JavaCodeAccessorMethod, RubyCodeAccessorMethod, and CodeAccessorMethod.

## ◆ updateMethodDeclaration()

virtual void CodeMethodBlock::updateMethodDeclaration | ( |  | ) |
| protectedpure virtual

This is the method called from within syncToparent(). To update the start and end Method text. It is called whether or not the method is Auto or User generated.

Implemented in CPPHeaderCodeAccessorMethod, CPPHeaderCodeOperation, CPPSourceCodeAccessorMethod, CPPSourceCodeOperation, DCodeAccessorMethod, DCodeOperation, JavaCodeAccessorMethod, JavaCodeOperation, RubyCodeAccessorMethod, RubyCodeOperation, CodeAccessorMethod, and CodeOperation.

## Friends And Related Symbol Documentation

## ◆ CodeGenObjectWithTextBlocks

friend class CodeGenObjectWithTextBlocks
| friend

## Member Data Documentation

## ◆ m_endMethod

QString CodeMethodBlock::m_endMethod
| private

## ◆ m_startMethod

QString CodeMethodBlock::m_startMethod
| private

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

- umbrello/codegenerators/codemethodblock.h
- umbrello/codegenerators/codemethodblock.cpp