umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <codegenobjectwithtextblocks.h>
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 |
TextBlockList * | getTextBlockList () const |
virtual HierarchicalCodeBlock * | getHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel) |
virtual CodeBlockWithComments * | getCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel) |
CodeComment * | addOrUpdateTaggedCodeComment (const QString &tag=QString(), const QString &text=QString(), int indentationLevel=0) |
CodeBlockWithComments * | addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate) |
TextBlock * | findTextBlockByTag (const QString &tag) |
virtual QString | getUniqueTag (const QString &prefix=QString())=0 |
virtual CodeBlock * | newCodeBlock ()=0 |
virtual CodeBlockWithComments * | newCodeBlockWithComments ()=0 |
virtual HierarchicalCodeBlock * | newHierarchicalCodeBlock ()=0 |
CodeGenObjectWithTextBlocks * | findParentObjectForTaggedTextBlock (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 TextBlock * | findCodeClassFieldTextBlockByTag (const QString &tag)=0 |
Protected Attributes | |
QMap< QString, TextBlock * > | m_textBlockTagMap |
TextBlockList | m_textblockVector |
Private Attributes | |
CodeDocument * | m_pCodeDoc |
This abstract class is for code generator objects which 'own' text blocks.
|
explicit |
Constructor
parent | parent code document |
|
virtual |
Destructor
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.
tag | tag to find the text block |
text | text to set |
ctext | comment to set |
indentLevel | indentation level |
forceUserBlockUpdate | ... |
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.
tag | tag to find the text block |
text | code comment to set |
indentationLevel | indentation level |
|
virtual |
Add a TextBlock object to the m_textblockVector List.
add_object | text block to add |
Reimplemented in HierarchicalCodeBlock.
|
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.
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.
tag | tag to find the text block |
TextBlock * CodeGenObjectWithTextBlocks::findTextBlockByTag | ( | const QString & | tag | ) |
Find the text block with a given tag.
tag | the tag to search with |
|
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.
tag | tag to find the text block |
comment | comment |
indentLevel | indentation level |
|
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.
tag | tag to find the text block |
comment | comment |
indentLevel | indentation level |
TextBlockList * CodeGenObjectWithTextBlocks::getTextBlockList | ( | ) | const |
|
pure virtual |
|
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.
|
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.
root | node from which to load the child text blocks |
Reimplemented in CPPHeaderCodeDocument, DClassifierCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.
|
pure virtual |
Virtual methods that return a new code document objects.
Implemented in CodeDocument, and HierarchicalCodeBlock.
|
pure virtual |
Implemented in CodeDocument, and HierarchicalCodeBlock.
|
pure virtual |
Implemented in CodeDocument, HierarchicalCodeBlock, and JavaANTCodeDocument.
|
virtual |
Remove a TextBlock object from m_textblockVector list.
remove_object | the text block to be removed |
Reimplemented in HierarchicalCodeBlock.
|
protectedvirtual |
Reset/clear the inventory text blocks held by this object.
Reimplemented in CodeDocument, CPPHeaderCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.
|
protectedvirtual |
Set the class attributes of this object from the passed element node.
root | node from which to load the child text blocks |
Reimplemented in ClassifierCodeDocument, CodeDocument, HierarchicalCodeBlock, JavaANTCodeDocument, OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.
|
protected |
Empty method.
|
protectedvirtual |
Set attributes of the node that represents this class in the XMI document.
Reimplemented in ClassifierCodeDocument, CodeDocument, HierarchicalCodeBlock, JavaANTCodeDocument, OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.
|
private |
|
protected |
|
protected |