umbrello API Documentation

CodeDocument Class Reference

class CodeDocument A document containing the code for one file. More...

#include <codedocument.h>

Inheritance diagram for CodeDocument:

CodeGenObjectWithTextBlocks ClassifierCodeDocument CPPMakefileCodeDocument JavaANTCodeDocument CPPHeaderCodeDocument CPPSourceCodeDocument JavaClassifierCodeDocument RubyClassifierCodeDocument List of all members.

Public Member Functions

 CodeDocument ()
 Basic constructor for class.
virtual ~CodeDocument ()
 Empty Destructor.
void setFileExtension (const QString &new_var)
 Set the value of m_fileExtension.
QString getFileExtension () const
 Get the value of m_fileExtension.
void setFileName (const QString &new_var)
 Set the complete value (name plus any extension) of m_filename.
QString getFileName () const
 Get the value of m_filename.
void setPackage (UMLPackage *new_var)
 Set the value of m_package.
QString getPackage () const
 Get the value of the package of this codedocument.
virtual QString getPath ()
 Get the value of the path to this codedocument.
void setID (const QString &new_id)
 Set the value of m_ID.
QString getID () const
 Get the value of m_ID.
void setWriteOutCode (bool new_var)
 Set the value of m_writeOutCode Whether or not to write out this code document and any codeblocks, etc that it owns.
bool getWriteOutCode ()
 Get the value of m_writeOutCode Whether or not to write out this code document and any codeblocks, etc that it owns.
void setHeader (CodeComment *comment)
 Set a Header comment object.
CodeCommentgetHeader ()
 Get the Header comment object.
bool insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after=true)
 Insert a new text block after the existing text block.
TextBlockfindTextBlockByTag (const QString &tag, bool descendIntoChildren=false)
 Lookup a certain textblock by its tag value, returns NULL if it cant find the TextBlock with such a tag.
virtual QString toString ()
 create the string representation of this object.
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 CodeBlocknewCodeBlock ()
 create a new CodeBlock object belonging to this CodeDocument.
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock ()
 create a new HierarchicalCodeBlock object belonging to this CodeDocument.
virtual CodeBlockWithCommentsnewCodeBlockWithComments ()
 create a new CodeBlockWithComments object belonging to this CodeDocument.
virtual QString getUniqueTag (QString prefix=QString(""))
QString cleanName (const QString &name)
 a little utility method to make life easier for the code document programmer
virtual void synchronize ()

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.
void addChildTagToMap (const QString &tag, TextBlock *tb)
void removeChildTagFromMap (const QString &tag)
void updateHeader ()
void resetTextBlocks ()
virtual void updateContent ()
virtual TextBlockfindCodeClassFieldTextBlockByTag (const QString &tag)

Friends

class HierarchicalCodeBlock

Detailed Description

class CodeDocument A document containing the code for one file.

Definition at line 45 of file codedocument.h.


Constructor & Destructor Documentation

CodeDocument::CodeDocument  ) 
 

Basic constructor for class.

Definition at line 34 of file codedocument.cpp.

CodeDocument::~CodeDocument  )  [virtual]
 

Empty Destructor.

Definition at line 40 of file codedocument.cpp.


Member Function Documentation

void CodeDocument::setFileExtension const QString &  new_var  ) 
 

Set the value of m_fileExtension.

Parameters:
new_var the new value of m_fileExtension

Definition at line 82 of file codedocument.cpp.

Referenced by CPPHeaderCodeDocument::CPPHeaderCodeDocument(), CPPMakefileCodeDocument::CPPMakefileCodeDocument(), JavaANTCodeDocument::JavaANTCodeDocument(), and setAttributesFromNode().

QString CodeDocument::getFileExtension  )  const
 

Get the value of m_fileExtension.

Returns:
the value of m_fileExtension

Definition at line 91 of file codedocument.cpp.

Referenced by setAttributesOnNode().

void CodeDocument::setFileName const QString &  new_var  ) 
 

Set the complete value (name plus any extension) of m_filename.

Parameters:
new_var the new value of m_filename

Definition at line 66 of file codedocument.cpp.

Referenced by CPPMakefileCodeDocument::CPPMakefileCodeDocument(), JavaANTCodeDocument::JavaANTCodeDocument(), and setAttributesFromNode().

QString CodeDocument::getFileName  )  const
 

Get the value of m_filename.

This name is the "complete" filename, meaning that it contains both the file name plus any extension (e.g. "file.cpp")

Returns:
the value of m_filename

Definition at line 74 of file codedocument.cpp.

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

void CodeDocument::setPackage UMLPackage new_var  ) 
 

Set the value of m_package.

Parameters:
new_var the new value of m_package

Definition at line 99 of file codedocument.cpp.

QString CodeDocument::getPackage  )  const
 

Get the value of the package of this codedocument.

Returns:
the value of m_pathName

Definition at line 129 of file codedocument.cpp.

References UMLObject::getName().

Referenced by RubyClassifierCodeDocument::getPath(), JavaClassifierCodeDocument::getPath(), JavaANTCodeDocument::getPath(), CPPMakefileCodeDocument::getPath(), and getPath().

QString CodeDocument::getPath  )  [virtual]
 

Get the value of the path to this codedocument.

Returns:
the value of m_pathName

Reimplemented in CPPMakefileCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.

Definition at line 107 of file codedocument.cpp.

References getPackage().

void CodeDocument::setID const QString &  new_id  ) 
 

Set the value of m_ID.

Parameters:
new_id the new value of m_ID

Definition at line 139 of file codedocument.cpp.

Referenced by CodeGenerator::addCodeDocument(), CPPMakefileCodeDocument::CPPMakefileCodeDocument(), JavaANTCodeDocument::JavaANTCodeDocument(), and setAttributesFromNode().

QString CodeDocument::getID  )  const
 

Get the value of m_ID.

Returns:
the value of m_ID

Definition at line 147 of file codedocument.cpp.

Referenced by CodeGenerator::addCodeDocument(), CodeGenerator::removeCodeDocument(), setAttributesOnNode(), and ClassifierCodeDocument::setAttributesOnNode().

void CodeDocument::setWriteOutCode bool  new_var  ) 
 

Set the value of m_writeOutCode Whether or not to write out this code document and any codeblocks, etc that it owns.

Parameters:
new_var the new value of m_writeOutCode

Definition at line 157 of file codedocument.cpp.

Referenced by setAttributesFromNode().

bool CodeDocument::getWriteOutCode  ) 
 

Get the value of m_writeOutCode Whether or not to write out this code document and any codeblocks, etc that it owns.

Returns:
the value of m_writeOutCode

Definition at line 167 of file codedocument.cpp.

Referenced by setAttributesOnNode(), and toString().

void CodeDocument::setHeader CodeComment header  ) 
 

Set a Header comment object.

Definition at line 174 of file codedocument.cpp.

CodeComment * CodeDocument::getHeader  ) 
 

Get the Header comment object.

Definition at line 181 of file codedocument.cpp.

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

bool CodeDocument::insertTextBlock TextBlock newBlock,
TextBlock existingBlock,
bool  after = true
[virtual]
 

Insert a new text block after the existing text block.

Returns false if it cannot insert the textblock.

Implements CodeGenObjectWithTextBlocks.

Definition at line 208 of file codedocument.cpp.

References findTextBlockByTag(), TextBlock::getTag(), getUniqueTag(), and TextBlock::setTag().

TextBlock * CodeDocument::findTextBlockByTag const QString &  tag,
bool  descendIntoChildren = false
 

Lookup a certain textblock by its tag value, returns NULL if it cant find the TextBlock with such a tag.

If descendIntoChildren is true, then any child hierarchical textblocks will also be searched for a match.

Definition at line 467 of file codedocument.cpp.

Referenced by ClassifierCodeDocument::addOperation(), getUniqueTag(), insertTextBlock(), ClassifierCodeDocument::removeOperation(), and CPPHeaderCodeDocument::updateContent().

QString CodeDocument::toString  )  [virtual]
 

create the string representation of this object.

Returns:
QString

Reimplemented in CPPMakefileCodeDocument.

Definition at line 300 of file codedocument.cpp.

References getHeader(), CodeGenObjectWithTextBlocks::getTextBlockList(), getWriteOutCode(), and TextBlock::toString().

Referenced by CodeGenerator::writeListedCodeDocsToFile().

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

Save the XMI representation of this object.

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 420 of file codedocument.cpp.

References setAttributesOnNode().

Referenced by CodeGenerator::saveToXMI().

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

load params from the appropriate XMI element node.

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 337 of file codedocument.cpp.

References setAttributesFromNode().

Referenced by CodeGenerator::loadFromXMI().

CodeBlock * CodeDocument::newCodeBlock  )  [virtual]
 

create a new CodeBlock object belonging to this CodeDocument.

Returns:
CodeBlock

Implements CodeGenObjectWithTextBlocks.

Definition at line 439 of file codedocument.cpp.

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

HierarchicalCodeBlock * CodeDocument::newHierarchicalCodeBlock  )  [virtual]
 

create a new HierarchicalCodeBlock object belonging to this CodeDocument.

Returns:
HierarchicalCodeBlock

Implements CodeGenObjectWithTextBlocks.

Reimplemented in JavaANTCodeDocument.

Definition at line 451 of file codedocument.cpp.

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

CodeBlockWithComments * CodeDocument::newCodeBlockWithComments  )  [virtual]
 

create a new CodeBlockWithComments object belonging to this CodeDocument.

Returns:
CodeBlockWithComments

Implements CodeGenObjectWithTextBlocks.

Definition at line 447 of file codedocument.cpp.

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

QString CodeDocument::getUniqueTag QString  prefix = QString("")  )  [virtual]
 

Returns:
QString
Parameters:
prefix 

Implements CodeGenObjectWithTextBlocks.

Definition at line 189 of file codedocument.cpp.

References findTextBlockByTag().

Referenced by insertTextBlock().

QString CodeDocument::cleanName const QString &  name  ) 
 

a little utility method to make life easier for the code document programmer

Returns:
the value of m_dialog

Definition at line 271 of file codedocument.cpp.

References CodeGenerator::cleanName().

Referenced by CodeClassField::cleanName(), and CPPHeaderCodeDocument::updateContent().

void CodeDocument::setAttributesOnNode QDomDocument &  doc,
QDomElement &  docElement
[protected, virtual]
 

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

Reimplemented from CodeGenObjectWithTextBlocks.

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 344 of file codedocument.cpp.

References getFileExtension(), getFileName(), getHeader(), getID(), UMLObject::getID(), getWriteOutCode(), CodeComment::saveToXMI(), and CodeGenObjectWithTextBlocks::setAttributesOnNode().

Referenced by saveToXMI(), JavaANTCodeDocument::setAttributesOnNode(), and ClassifierCodeDocument::setAttributesOnNode().

void CodeDocument::setAttributesFromNode QDomElement &  root  )  [protected, virtual]
 

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

Reimplemented from CodeGenObjectWithTextBlocks.

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 375 of file codedocument.cpp.

References UMLDoc::findObjectById(), UMLDoc::findUMLObject(), UMLApp::getDocument(), getHeader(), CodeComment::loadFromXMI(), CodeGenObjectWithTextBlocks::setAttributesFromNode(), setFileExtension(), setFileName(), setID(), and setWriteOutCode().

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