• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

CodeDocument Class Reference

#include <codedocument.h>

Inheritance diagram for CodeDocument:

Inheritance graph
[legend]

List of all members.


Detailed Description

A document containing the code for one file.

"friend" status is needed for HBlock so it may call addChildTagToMap which is protected.

Definition at line 41 of file codedocument.h.


Public Member Functions

 CodeDocument ()
virtual ~CodeDocument ()
void setFileExtension (const QString &new_var)
QString getFileExtension () const
void setFileName (const QString &new_var)
QString getFileName () const
void setPackage (UMLPackage *new_var)
QString getPackage () const
virtual QString getPath ()
void setID (const QString &new_id)
QString getID () const
void setWriteOutCode (bool new_var)
bool getWriteOutCode ()
void setHeader (CodeComment *comment)
CodeComment * getHeader ()
bool insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after=true)
TextBlock * findTextBlockByTag (const QString &tag, bool descendIntoChildren=false)
virtual QString toString ()
virtual void saveToXMI (QDomDocument &doc, QDomElement &root)
virtual void loadFromXMI (QDomElement &root)
virtual CodeBlock * newCodeBlock ()
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock ()
virtual CodeBlockWithComments * newCodeBlockWithComments ()
virtual QString getUniqueTag (const QString &prefix=QString(""))
QString cleanName (const QString &name)
virtual void synchronize ()
virtual void updateContent ()

Protected Member Functions

virtual void setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement)
virtual void setAttributesFromNode (QDomElement &element)
void addChildTagToMap (const QString &tag, TextBlock *tb)
void removeChildTagFromMap (const QString &tag)
void updateHeader ()
void resetTextBlocks ()
virtual TextBlock * findCodeClassFieldTextBlockByTag (const QString &tag)

Friends

class HierarchicalCodeBlock
QTextStream & operator<< (QTextStream &os, const CodeDocument &obj)

Constructor & Destructor Documentation

CodeDocument::CodeDocument (  ) 

Empty Constructor.

Definition at line 31 of file codedocument.cpp.

CodeDocument::~CodeDocument (  )  [virtual]

Empty Destructor.

Definition at line 36 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 56 of file codedocument.cpp.

QString CodeDocument::getFileExtension (  )  const

Get the value of m_fileExtension.

Returns:
the value of m_fileExtension

Definition at line 62 of file codedocument.cpp.

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 46 of file codedocument.cpp.

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 51 of file codedocument.cpp.

void CodeDocument::setPackage ( UMLPackage *  new_var  ) 

Set the value of m_package.

Parameters:
new_var the new value of m_package

Definition at line 67 of file codedocument.cpp.

QString CodeDocument::getPackage (  )  const

Get the value of the package of this code document.

Returns:
the value of m_pathName

Definition at line 90 of file codedocument.cpp.

QString CodeDocument::getPath (  )  [virtual]

Get the value of the path to this code document.

Returns:
the value of m_pathName

Reimplemented in CPPMakefileCodeDocument, DClassifierCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.

Definition at line 72 of file codedocument.cpp.

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 97 of file codedocument.cpp.

QString CodeDocument::getID (  )  const

Get the value of m_ID.

Returns:
the value of m_ID

Definition at line 102 of file codedocument.cpp.

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 107 of file codedocument.cpp.

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 112 of file codedocument.cpp.

void CodeDocument::setHeader ( CodeComment *  comment  ) 

Set a Header comment object.

Parameters:
comment the comment for the header

Definition at line 117 of file codedocument.cpp.

CodeComment * CodeDocument::getHeader (  ) 

Get the Header comment object.

Returns:
the comment for the header

Definition at line 122 of file codedocument.cpp.

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.

Parameters:
newBlock the text block to insert
existingBlock the place where to insert
after at the index of the existingBlock or after
Returns:
the success status

Implements CodeGenObjectWithTextBlocks.

Definition at line 142 of file codedocument.cpp.

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

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

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

Parameters:
tag the tag to look for
descendIntoChildren look down the hierarchy
Returns:
the found text block

Definition at line 377 of file codedocument.cpp.

QString CodeDocument::toString (  )  [virtual]

Create the string representation of this object.

Returns:
the created string

Reimplemented in CPPMakefileCodeDocument.

Definition at line 226 of file codedocument.cpp.

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

Save the XMI representation of this object.

Parameters:
doc the xmi document
root the starting point to append

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 335 of file codedocument.cpp.

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

Load params from the appropriate XMI element node.

Parameters:
root the starting point for loading

Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.

Definition at line 262 of file codedocument.cpp.

CodeBlock * CodeDocument::newCodeBlock (  )  [virtual]

Create a new CodeBlock object belonging to this CodeDocument.

Returns:
the just created CodeBlock

Implements CodeGenObjectWithTextBlocks.

Definition at line 350 of file codedocument.cpp.

HierarchicalCodeBlock * CodeDocument::newHierarchicalCodeBlock (  )  [virtual]

Create a new HierarchicalCodeBlock object belonging to this CodeDocument.

Returns:
the just created HierarchicalCodeBlock

Implements CodeGenObjectWithTextBlocks.

Reimplemented in JavaANTCodeDocument.

Definition at line 360 of file codedocument.cpp.

CodeBlockWithComments * CodeDocument::newCodeBlockWithComments (  )  [virtual]

Create a new CodeBlockWithComments object belonging to this CodeDocument.

Returns:
the just created CodeBlockWithComments

Implements CodeGenObjectWithTextBlocks.

Definition at line 355 of file codedocument.cpp.

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

Return a unique and currently unallocated text block tag for this document.

Parameters:
prefix the prefix to add
Returns:
the just created unique tag

Implements CodeGenObjectWithTextBlocks.

Definition at line 127 of file codedocument.cpp.

QString CodeDocument::cleanName ( const QString &  name  ) 

A little utility method which calls CodeGenerator::cleanName.

Get the value of m_dialog.

Parameters:
name the cleanable name
Returns:
the cleaned name

the value of m_dialog

Definition at line 201 of file codedocument.cpp.

void CodeDocument::synchronize (  )  [virtual]

Cause this code document to synchronize to current generator policy.

Reimplemented in ClassifierCodeDocument.

Definition at line 250 of file codedocument.cpp.

void CodeDocument::updateContent (  )  [virtual]

Update the content of this code document.

This is where you should lay out your code document structure of textblocks in the inheriting class, should it have any text in it.

Reimplemented in ClassifierCodeDocument, CPPHeaderCodeDocument, CPPMakefileCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.

Definition at line 345 of file codedocument.cpp.

void CodeDocument::setAttributesOnNode ( QDomDocument &  doc,
QDomElement &  blockElement 
) [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 267 of file codedocument.cpp.

void CodeDocument::setAttributesFromNode ( QDomElement &  element  )  [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 293 of file codedocument.cpp.

void CodeDocument::addChildTagToMap ( const QString &  tag,
TextBlock *  tb 
) [protected]

Definition at line 372 of file codedocument.cpp.

void CodeDocument::removeChildTagFromMap ( const QString &  tag  )  [protected]

Definition at line 367 of file codedocument.cpp.

void CodeDocument::updateHeader (  )  [protected]

Update the header text of this codedocument.

Definition at line 207 of file codedocument.cpp.

void CodeDocument::resetTextBlocks (  )  [protected, virtual]

Reset/clear our inventory of textblocks in this document.

Reimplemented from CodeGenObjectWithTextBlocks.

Reimplemented in CPPHeaderCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.

Definition at line 256 of file codedocument.cpp.

TextBlock * CodeDocument::findCodeClassFieldTextBlockByTag ( const QString &  tag  )  [protected, virtual]

Have to implement this for CodeObjectWithTextBlocks.

Actually does not do anythying for a vannilla code document.

Implements CodeGenObjectWithTextBlocks.

Reimplemented in ClassifierCodeDocument.

Definition at line 404 of file codedocument.cpp.


Friends And Related Function Documentation

friend class HierarchicalCodeBlock [friend]

Reimplemented in ClassifierCodeDocument.

Definition at line 43 of file codedocument.h.

QTextStream& operator<< ( QTextStream &  os,
const CodeDocument &  obj 
) [friend]

Definition at line 410 of file codedocument.cpp.


The documentation for this class was generated from the following files:
  • codedocument.h
  • codedocument.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kate
  •     kate
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal