umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CodeGenObjectWithTextBlocks Class Referenceabstract

#include <codegenobjectwithtextblocks.h>

Inheritance diagram for CodeGenObjectWithTextBlocks:
Collaboration diagram for CodeGenObjectWithTextBlocks:

Public Member Functions

 CodeGenObjectWithTextBlocks (CodeDocument *parent)
 
virtual ~CodeGenObjectWithTextBlocks ()
 
virtual bool addTextBlock (TextBlock *add_object)
 
virtual bool removeTextBlock (TextBlock *remove_object)
 
virtual bool insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after)=0
 
TextBlockListgetTextBlockList () const
 
virtual HierarchicalCodeBlockgetHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel)
 
virtual CodeBlockWithCommentsgetCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel)
 
CodeCommentaddOrUpdateTaggedCodeComment (const QString &tag=QString(), const QString &text=QString(), int indentationLevel=0)
 
CodeBlockWithCommentsaddOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate)
 
TextBlockfindTextBlockByTag (const QString &tag)
 
virtual QString getUniqueTag (const QString &prefix=QString())=0
 
virtual CodeBlocknewCodeBlock ()=0
 
virtual CodeBlockWithCommentsnewCodeBlockWithComments ()=0
 
virtual HierarchicalCodeBlocknewHierarchicalCodeBlock ()=0
 
CodeGenObjectWithTextBlocksfindParentObjectForTaggedTextBlock (const QString &tag)
 

Protected Member Functions

virtual void setAttributesOnNode (QXmlStreamWriter &writer)
 
virtual void setAttributesFromNode (QDomElement &element)
 
void setAttributesFromObject (CodeGenObjectWithTextBlocks *obj)
 
virtual void loadChildTextBlocksFromNode (QDomElement &root)
 
virtual void resetTextBlocks ()
 
virtual TextBlockfindCodeClassFieldTextBlockByTag (const QString &tag)=0
 

Protected Attributes

QMap< QString, TextBlock * > m_textBlockTagMap
 
TextBlockList m_textblockVector
 

Private Attributes

CodeDocumentm_pCodeDoc
 

Detailed Description

This abstract class is for code generator objects which 'own' text blocks.

Constructor & Destructor Documentation

◆ CodeGenObjectWithTextBlocks()

CodeGenObjectWithTextBlocks::CodeGenObjectWithTextBlocks ( CodeDocument parent)
explicit

Constructor

Parameters
parentparent code document

◆ ~CodeGenObjectWithTextBlocks()

CodeGenObjectWithTextBlocks::~CodeGenObjectWithTextBlocks ( )
virtual

Destructor

Here is the call graph for this function:

Member Function Documentation

◆ addOrUpdateTaggedCodeBlockWithComments()

CodeBlockWithComments * CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments ( const QString &  tag,
const QString &  text,
const QString &  ctext,
int  indentLevel,
bool  forceUserBlockUpdate 
)

Allows the user to either add a code block with comments to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate.

Parameters
tagtag to find the text block
texttext to set
ctextcomment to set
indentLevelindentation level
forceUserBlockUpdate...
Returns
codeblock/comment pointer to the object which was created/updated
Here is the call graph for this function:

◆ addOrUpdateTaggedCodeComment()

CodeComment * CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment ( const QString &  tag = QString(),
const QString &  text = QString(),
int  indentationLevel = 0 
)

Allows the user to add a code comment to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate.

Parameters
tagtag to find the text block
textcode comment to set
indentationLevelindentation level
Returns
codeblock/comment pointer to the object which was created/updated.
Here is the call graph for this function:

◆ addTextBlock()

bool CodeGenObjectWithTextBlocks::addTextBlock ( TextBlock add_object)
virtual

Add a TextBlock object to the m_textblockVector List.

Parameters
add_objecttext block to add
Returns
boolean value where false means not added because an TextBlock object with that tag already exists in this document.

Reimplemented in HierarchicalCodeBlock.

Here is the call graph for this function:

◆ findCodeClassFieldTextBlockByTag()

virtual TextBlock * CodeGenObjectWithTextBlocks::findCodeClassFieldTextBlockByTag ( const QString &  tag)
protectedpure virtual

Find specific text block belonging to code classfields. Block may not presently be allocated to the textblock list.

Implemented in ClassifierCodeDocument, CodeDocument, and HierarchicalCodeBlock.

◆ findParentObjectForTaggedTextBlock()

CodeGenObjectWithTextBlocks * CodeGenObjectWithTextBlocks::findParentObjectForTaggedTextBlock ( const QString &  tag)

Find the direct parent for a given textblock. This may be any object which holds text blocks, e.g. a CodeGenObjectWithTextBlocks. IMPORTANT: this will only search for a parent from the viewpoint of this object and down into its Hierarchical codeblocks. This means you should start any search from the parent document of the text block. This method NOT meant for casual usage.

Parameters
tagtag to find the text block
Returns
parent object. Could return null if the textblock is missing from the branch of the document tree being examined.
Here is the call graph for this function:

◆ findTextBlockByTag()

TextBlock * CodeGenObjectWithTextBlocks::findTextBlockByTag ( const QString &  tag)

Find the text block with a given tag.

Parameters
tagthe tag to search with
Returns
the found TextBlock object

◆ getCodeBlockWithComments()

CodeBlockWithComments * CodeGenObjectWithTextBlocks::getCodeBlockWithComments ( const QString &  tag,
const QString &  comment,
int  indentLevel 
)
virtual

Will get a codeblockwithcomments from the document with given tag. If the codeblock doesn't exist, then it will create it at the end of the document textBlock list and pass back a reference.

Parameters
tagtag to find the text block
commentcomment
indentLevelindentation level
Returns
CodeBlockWithComments object
Here is the call graph for this function:

◆ getHierarchicalCodeBlock()

HierarchicalCodeBlock * CodeGenObjectWithTextBlocks::getHierarchicalCodeBlock ( const QString &  tag,
const QString &  comment,
int  indentLevel 
)
virtual

Will get a hierarchicalcodeblock from the document with given tag. IF the codeblock doesn't exist, then it will create it at the end of the document textBlock list and pass back a reference.

Parameters
tagtag to find the text block
commentcomment
indentLevelindentation level
Returns
HierarchicalCodeBlock object
Here is the call graph for this function:

◆ getTextBlockList()

TextBlockList * CodeGenObjectWithTextBlocks::getTextBlockList ( ) const

Get the list of TextBlock objects held by m_textblockVector

Returns
list of TextBlock objects held by m_textblockVector

◆ getUniqueTag()

virtual QString CodeGenObjectWithTextBlocks::getUniqueTag ( const QString &  prefix = QString())
pure virtual
Returns
QString
Parameters
prefix

Implemented in HierarchicalCodeBlock, and CodeDocument.

◆ insertTextBlock()

virtual bool CodeGenObjectWithTextBlocks::insertTextBlock ( TextBlock newBlock,
TextBlock existingBlock,
bool  after 
)
pure virtual

Insert a new text block before/after the existing text block. Returns false if it cannot insert the textblock.

Implemented in CodeDocument, and HierarchicalCodeBlock.

◆ loadChildTextBlocksFromNode()

void CodeGenObjectWithTextBlocks::loadChildTextBlocksFromNode ( QDomElement &  root)
protectedvirtual

Load text blocks. In this vanilla version, we only load comments and codeblocks as they are the only instanciatable (vanilla) things this method should be overridden if this class is inherited by some other class that is concrete and takes children derived from codeblock/codecomment/hierarchicalcb/ownedhiercodeblock.

Parameters
rootnode from which to load the child text blocks

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

Here is the call graph for this function:

◆ newCodeBlock()

virtual CodeBlock * CodeGenObjectWithTextBlocks::newCodeBlock ( )
pure virtual

Virtual methods that return a new code document objects.

Implemented in CodeDocument, and HierarchicalCodeBlock.

◆ newCodeBlockWithComments()

virtual CodeBlockWithComments * CodeGenObjectWithTextBlocks::newCodeBlockWithComments ( )
pure virtual

Implemented in CodeDocument, and HierarchicalCodeBlock.

◆ newHierarchicalCodeBlock()

virtual HierarchicalCodeBlock * CodeGenObjectWithTextBlocks::newHierarchicalCodeBlock ( )
pure virtual

◆ removeTextBlock()

bool CodeGenObjectWithTextBlocks::removeTextBlock ( TextBlock remove_object)
virtual

Remove a TextBlock object from m_textblockVector list.

Parameters
remove_objectthe text block to be removed
Returns
success status

Reimplemented in HierarchicalCodeBlock.

Here is the call graph for this function:

◆ resetTextBlocks()

void CodeGenObjectWithTextBlocks::resetTextBlocks ( )
protectedvirtual

Reset/clear the inventory text blocks held by this object.

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

◆ setAttributesFromNode()

void CodeGenObjectWithTextBlocks::setAttributesFromNode ( QDomElement &  root)
protectedvirtual

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

Parameters
rootnode from which to load the child text blocks

Reimplemented in ClassifierCodeDocument, CodeDocument, HierarchicalCodeBlock, JavaANTCodeDocument, OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.

Here is the call graph for this function:

◆ setAttributesFromObject()

void CodeGenObjectWithTextBlocks::setAttributesFromObject ( CodeGenObjectWithTextBlocks obj)
protected

Empty method.

◆ setAttributesOnNode()

void CodeGenObjectWithTextBlocks::setAttributesOnNode ( QXmlStreamWriter &  writer)
protectedvirtual

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

Reimplemented in ClassifierCodeDocument, CodeDocument, HierarchicalCodeBlock, JavaANTCodeDocument, OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.

Here is the call graph for this function:

Member Data Documentation

◆ m_pCodeDoc

CodeDocument* CodeGenObjectWithTextBlocks::m_pCodeDoc
private

◆ m_textBlockTagMap

QMap<QString, TextBlock *> CodeGenObjectWithTextBlocks::m_textBlockTagMap
protected

◆ m_textblockVector

TextBlockList CodeGenObjectWithTextBlocks::m_textblockVector
protected

The documentation for this class was generated from the following files: