umbrello API Documentation

CodeMethodBlock Class Reference

class CodeMethodBlock A common type of "code block" that occurs in OO code. More...

#include <codemethodblock.h>

Inheritance diagram for CodeMethodBlock:

CodeBlockWithComments OwnedCodeBlock CodeBlock TextBlock List of all members.

Public Slots

virtual void syncToParent ()

Public Member Functions

 CodeMethodBlock (ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body="", const QString &comment="")
 Constructors.
virtual ~CodeMethodBlock ()
 Empty Destructor.
virtual QString toString ()
QString getStartMethodText () const
 Get the starting text that begins this method before the body is printed.
QString getEndMethodText () const
 Get the ending text that finishes this method after the body is printed.
CodeDocumentgetParentDocument ()

Protected Member Functions

virtual void release ()
 causes the text block to release all of its connections and any other text blocks that it 'owns'.
void setStartMethodText (const QString &value)
 Set the starting text that begins this method before the body is printed.
void setEndMethodText (const QString &value)
 Set the ending text that finishes this method after the body is printed.
virtual void updateMethodDeclaration ()=0
 this is the method called from within syncToparent().
virtual void updateContent ()=0
 this is the method called from within syncToparent().
virtual void setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement)
 set attributes of the node that represents this class in the XMI document.
virtual void setAttributesFromNode (QDomElement &element)
 set the class attributes of this object from the passed element node.
virtual void setAttributesFromObject (TextBlock *obj)
 set the class attributes from a passed object

Friends

class CodeGenObjectWithTextBlocks

Detailed Description

class CodeMethodBlock A common type of "code block" that occurs in OO code.

Definition at line 35 of file codemethodblock.h.


Constructor & Destructor Documentation

CodeMethodBlock::CodeMethodBlock ClassifierCodeDocument doc,
UMLObject parentObj,
const QString &  body = "",
const QString &  comment = ""
 

Constructors.

Definition at line 25 of file codemethodblock.cpp.

CodeMethodBlock::~CodeMethodBlock  )  [virtual]
 

Empty Destructor.

Definition at line 31 of file codemethodblock.cpp.


Member Function Documentation

QString CodeMethodBlock::toString  )  [virtual]
 

Returns:
QString

Reimplemented from CodeBlockWithComments.

Definition at line 138 of file codemethodblock.cpp.

References TextBlock::formatMultiLineText(), CodeBlockWithComments::getComment(), UMLApp::getCommonPolicy(), getEndMethodText(), TextBlock::getIndentationLevel(), TextBlock::getIndentationString(), CodeGenerationPolicy::getNewLineEndingChars(), getStartMethodText(), TextBlock::getText(), TextBlock::getWriteOutText(), and TextBlock::toString().

QString CodeMethodBlock::getStartMethodText  )  const
 

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

Definition at line 49 of file codemethodblock.cpp.

Referenced by setAttributesFromObject(), setAttributesOnNode(), and toString().

QString CodeMethodBlock::getEndMethodText  )  const
 

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

Definition at line 56 of file codemethodblock.cpp.

Referenced by setAttributesFromObject(), setAttributesOnNode(), and toString().

void CodeMethodBlock::release  )  [protected, virtual]
 

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.

Definition at line 77 of file codemethodblock.cpp.

References TextBlock::release(), and OwnedCodeBlock::release().

void CodeMethodBlock::setStartMethodText const QString &  value  )  [protected]
 

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

Definition at line 63 of file codemethodblock.cpp.

Referenced by setAttributesFromNode(), and setAttributesFromObject().

void CodeMethodBlock::setEndMethodText const QString &  value  )  [protected]
 

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

Definition at line 70 of file codemethodblock.cpp.

Referenced by setAttributesFromNode(), and setAttributesFromObject().

virtual void CodeMethodBlock::updateMethodDeclaration  )  [protected, pure 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.

virtual void CodeMethodBlock::updateContent  )  [protected, 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.

void CodeMethodBlock::setAttributesOnNode QDomDocument &  doc,
QDomElement &  elem
[protected, virtual]
 

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

Reimplemented from CodeBlockWithComments.

Definition at line 86 of file codemethodblock.cpp.

References TextBlock::encodeText(), UMLApp::getCommonPolicy(), CodeBlock::getContentType(), getEndMethodText(), CodeGenerationPolicy::getNewLineEndingChars(), getStartMethodText(), OwnedCodeBlock::setAttributesOnNode(), and CodeBlockWithComments::setAttributesOnNode().

void CodeMethodBlock::setAttributesFromNode QDomElement &  elem  )  [protected, virtual]
 

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

Reimplemented from CodeBlockWithComments.

Definition at line 105 of file codemethodblock.cpp.

References TextBlock::decodeText(), UMLApp::getCommonPolicy(), CodeBlock::getContentType(), CodeGenerationPolicy::getNewLineEndingChars(), OwnedCodeBlock::setAttributesFromNode(), CodeBlockWithComments::setAttributesFromNode(), setEndMethodText(), and setStartMethodText().

void CodeMethodBlock::setAttributesFromObject TextBlock obj  )  [protected, virtual]
 

set the class attributes from a passed object

Reimplemented from CodeBlockWithComments.

Definition at line 121 of file codemethodblock.cpp.

References getEndMethodText(), getStartMethodText(), CodeBlockWithComments::setAttributesFromObject(), setEndMethodText(), and setStartMethodText().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:04 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003