umbrello API Documentation

CodeBlock Class Reference

class CodeBlock A "chunk" of code within the code document. More...

#include <codeblock.h>

Inheritance diagram for CodeBlock:

TextBlock CodeBlockWithComments CodeClassFieldDeclarationBlock CodeMethodBlock List of all members.

Public Types

enum  ContentType { AutoGenerated = 0, UserGenerated }

Public Member Functions

 CodeBlock (CodeDocument *parent, const QString &body="")
 constructor with QString so we can create & populate it in one step.
 CodeBlock (HierarchicalCodeBlock *parent, const QString &body="")
virtual ~CodeBlock ()
 Empty Destructor.
void setContentType (ContentType new_var)
 Set the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.
ContentType getContentType ()
 Get the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.
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 CodeBlock A "chunk" of code within the code document.

Definition at line 33 of file codeblock.h.


Constructor & Destructor Documentation

CodeBlock::CodeBlock CodeDocument parent,
const QString &  body = ""
[explicit]
 

constructor with QString so we can create & populate it in one step.

Definition at line 30 of file codeblock.cpp.

CodeBlock::~CodeBlock  )  [virtual]
 

Empty Destructor.

Definition at line 36 of file codeblock.cpp.


Member Function Documentation

void CodeBlock::setContentType ContentType  new_var  ) 
 

Set the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.

Parameters:
new_var the new value of m_contentType

Definition at line 57 of file codeblock.cpp.

Referenced by setAttributesFromNode(), and setAttributesFromObject().

CodeBlock::ContentType CodeBlock::getContentType  ) 
 

Get the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.

Returns:
the value of m_contentType

Definition at line 67 of file codeblock.cpp.

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

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

Save the XMI representation of this object.

Implements TextBlock.

Reimplemented in CodeBlockWithComments, CodeClassFieldDeclarationBlock, and OwnedHierarchicalCodeBlock.

Definition at line 87 of file codeblock.cpp.

References setAttributesOnNode().

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

load params from the appropriate XMI element node.

Implements TextBlock.

Reimplemented in CodeBlockWithComments, CodeClassFieldDeclarationBlock, and OwnedHierarchicalCodeBlock.

Definition at line 111 of file codeblock.cpp.

References setAttributesFromNode().

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

void CodeBlock::setAttributesFromObject TextBlock obj  )  [virtual]
 

set the class attributes from a passed object

Reimplemented from TextBlock.

Reimplemented in CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 127 of file codeblock.cpp.

References getContentType(), TextBlock::setAttributesFromObject(), and setContentType().

Referenced by CodeBlockWithComments::setAttributesFromObject().

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

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

Reimplemented from TextBlock.

Reimplemented in CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 96 of file codeblock.cpp.

References getContentType(), and TextBlock::setAttributesOnNode().

Referenced by saveToXMI(), and CodeBlockWithComments::setAttributesOnNode().

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

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

Reimplemented from TextBlock.

Reimplemented in CodeBlockWithComments, CodeClassFieldDeclarationBlock, CodeMethodBlock, and OwnedHierarchicalCodeBlock.

Definition at line 117 of file codeblock.cpp.

References TextBlock::setAttributesFromNode(), and setContentType().

Referenced by loadFromXMI(), and CodeBlockWithComments::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