umbrello API Documentation

CodeBlockWithComments Class Reference

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

#include <codeblockwithcomments.h>

Inheritance diagram for CodeBlockWithComments:

CodeBlock TextBlock CodeClassFieldDeclarationBlock CodeMethodBlock List of all members.

Public Member Functions

 CodeBlockWithComments (CodeDocument *doc, const QString &body="", const QString &comment="")
 Basic Constructor.
 CodeBlockWithComments (HierarchicalCodeBlock *hblock, const QString &body="", const QString &comment="")
virtual ~CodeBlockWithComments ()
 Empty Destructor.
void setComment (CodeComment *object)
 Set the Comment object.
CodeCommentgetComment ()
 Get the Comment object.
virtual QString toString ()
void setOverallIndentationLevel (int level)
 A utility method that causes the comment and body of the code block to have the same indentation level.
virtual void saveToXMI (QDomDocument &doc, QDomElement &root)
 Save the XMI representation of this object.
virtual void loadFromXMI (QDomElement &root)
 load params from the appropriate XMI element node.
virtual void setAttributesFromObject (TextBlock *obj)
 set the class attributes from a passed object

Protected Member Functions

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.

Detailed Description

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

Definition at line 32 of file codeblockwithcomments.h.


Constructor & Destructor Documentation

CodeBlockWithComments::CodeBlockWithComments CodeDocument doc,
const QString &  body = "",
const QString &  comment = ""
[explicit]
 

Basic Constructor.

Definition at line 37 of file codeblockwithcomments.cpp.

CodeBlockWithComments::~CodeBlockWithComments  )  [virtual]
 

Empty Destructor.

Definition at line 43 of file codeblockwithcomments.cpp.


Member Function Documentation

void CodeBlockWithComments::setComment CodeComment object  ) 
 

Set the Comment object.

Definition at line 57 of file codeblockwithcomments.cpp.

Referenced by CodeGenObjectWithTextBlocks::getCodeBlockWithComments().

CodeComment * CodeBlockWithComments::getComment  ) 
 

Get the Comment object.

Definition at line 64 of file codeblockwithcomments.cpp.

Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments(), CodeGenObjectWithTextBlocks::getCodeBlockWithComments(), setAttributesFromNode(), setAttributesFromObject(), setAttributesOnNode(), CodeMethodBlock::toString(), toString(), and CPPHeaderCodeDocument::updateContent().

QString CodeBlockWithComments::toString  )  [virtual]
 

Returns:
QString

Reimplemented from TextBlock.

Reimplemented in CodeMethodBlock.

Definition at line 148 of file codeblockwithcomments.cpp.

References TextBlock::formatMultiLineText(), getComment(), TextBlock::getIndentationString(), TextBlock::getText(), TextBlock::getWriteOutText(), and TextBlock::toString().

void CodeBlockWithComments::setOverallIndentationLevel int  level  ) 
 

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

Definition at line 168 of file codeblockwithcomments.cpp.

References TextBlock::setIndentationLevel().

Referenced by CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments(), and CodeGenObjectWithTextBlocks::getCodeBlockWithComments().

void CodeBlockWithComments::saveToXMI QDomDocument &  doc,
QDomElement &  root
[virtual]
 

Save the XMI representation of this object.

Reimplemented from CodeBlock.

Reimplemented in CodeClassFieldDeclarationBlock, and OwnedHierarchicalCodeBlock.

Definition at line 74 of file codeblockwithcomments.cpp.

References setAttributesOnNode().

void CodeBlockWithComments::loadFromXMI QDomElement &  root  )  [virtual]
 

load params from the appropriate XMI element node.

Reimplemented from CodeBlock.

Reimplemented in CodeClassFieldDeclarationBlock, and OwnedHierarchicalCodeBlock.

Definition at line 111 of file codeblockwithcomments.cpp.

References setAttributesFromNode().

Referenced by RubyClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaANTCodeDocument::loadChildTextBlocksFromNode(), CPPHeaderCodeDocument::loadChildTextBlocksFromNode(), and CodeGenObjectWithTextBlocks::loadChildTextBlocksFromNode().

void CodeBlockWithComments::setAttributesFromObject TextBlock obj  )  [virtual]
 

set the class attributes from a passed object

Reimplemented from CodeBlock.

Reimplemented in CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 97 of file codeblockwithcomments.cpp.

References getComment(), TextBlock::setAttributesFromObject(), and CodeBlock::setAttributesFromObject().

Referenced by CodeMethodBlock::setAttributesFromObject(), and CodeClassFieldDeclarationBlock::setAttributesFromObject().

void CodeBlockWithComments::setAttributesOnNode QDomDocument &  doc,
QDomElement &  blockElement
[protected, virtual]
 

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

Reimplemented from CodeBlock.

Reimplemented in CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 83 of file codeblockwithcomments.cpp.

References getComment(), CodeComment::saveToXMI(), and CodeBlock::setAttributesOnNode().

Referenced by saveToXMI(), CodeMethodBlock::setAttributesOnNode(), and CodeClassFieldDeclarationBlock::setAttributesOnNode().

void CodeBlockWithComments::setAttributesFromNode QDomElement &  element  )  [protected, virtual]
 

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

Reimplemented from CodeBlock.

Reimplemented in CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 116 of file codeblockwithcomments.cpp.

References getComment(), TextBlock::getTag(), CodeComment::loadFromXMI(), and CodeBlock::setAttributesFromNode().

Referenced by loadFromXMI(), CodeMethodBlock::setAttributesFromNode(), and CodeClassFieldDeclarationBlock::setAttributesFromNode().


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