umbrello/umbrello
#include <codegenobjectwithtextblocks.h>
Public Member Functions | |
CodeGenObjectWithTextBlocks (CodeDocument *parent) | |
virtual | ~CodeGenObjectWithTextBlocks () |
CodeBlockWithComments * | addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate) |
CodeComment * | addOrUpdateTaggedCodeComment (const QString &tag="", const QString &text="", int indentationLevel=0) |
virtual bool | addTextBlock (TextBlock *add_object) |
CodeGenObjectWithTextBlocks * | findParentObjectForTaggedTextBlock (const QString &tag) |
TextBlock * | findTextBlockByTag (const QString &tag) |
virtual CodeBlockWithComments * | getCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel) |
virtual HierarchicalCodeBlock * | getHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel) |
TextBlockList * | getTextBlockList () const |
virtual QString | getUniqueTag (const QString &prefix="")=0 |
virtual bool | insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after)=0 |
virtual CodeBlock * | newCodeBlock ()=0 |
virtual CodeBlockWithComments * | newCodeBlockWithComments ()=0 |
virtual HierarchicalCodeBlock * | newHierarchicalCodeBlock ()=0 |
virtual bool | removeTextBlock (TextBlock *remove_object) |
Protected Member Functions | |
virtual TextBlock * | findCodeClassFieldTextBlockByTag (const QString &tag)=0 |
virtual void | loadChildTextBlocksFromNode (QDomElement &root) |
virtual void | resetTextBlocks () |
virtual void | setAttributesFromNode (QDomElement &element) |
void | setAttributesFromObject (CodeGenObjectWithTextBlocks *obj) |
virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &elem) |
Protected Attributes | |
QMap< QString, TextBlock * > | m_textBlockTagMap |
TextBlockList | m_textblockVector |
Detailed Description
This abstract class is for code generator objects which 'own' text blocks.
Definition at line 31 of file codegenobjectwithtextblocks.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
- Parameters
-
parent parent code document
Definition at line 29 of file codegenobjectwithtextblocks.cpp.
|
virtual |
Destructor.
Definition at line 37 of file codegenobjectwithtextblocks.cpp.
Member Function Documentation
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
-
tag tag to find the text block text text to set ctext comment to set indentLevel indentation level forceUserBlockUpdate ...
- Returns
- codeblock/comment pointer to the object which was created/updated
Definition at line 287 of file codegenobjectwithtextblocks.cpp.
CodeComment * CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeComment | ( | const QString & | tag = "" , |
const QString & | text = "" , |
||
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
-
tag tag to find the text block text code comment to set indentationLevel indentation level
- Returns
- codeblock/comment pointer to the object which was created/updated.
Definition at line 246 of file codegenobjectwithtextblocks.cpp.
|
virtual |
Add a TextBlock object to the m_textblockVector List.
- Parameters
-
add_object text 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.
Definition at line 57 of file codegenobjectwithtextblocks.cpp.
|
protectedpure virtual |
Find specific text block belonging to code classfields.
Block may not presently be alocated t othe textblock list.
Implemented in CodeDocument, ClassifierCodeDocument, 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.
- Parameters
-
tag tag 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.
Definition at line 146 of file codegenobjectwithtextblocks.cpp.
TextBlock * CodeGenObjectWithTextBlocks::findTextBlockByTag | ( | const QString & | tag | ) |
Find the text block with a given tag.
- Parameters
-
tag the tag to search with
- Returns
- the found TextBlock object
Definition at line 126 of file codegenobjectwithtextblocks.cpp.
|
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
-
tag tag to find the text block comment comment indentLevel indentation level
- Returns
- CodeBlockWithComments object
Definition at line 217 of file codegenobjectwithtextblocks.cpp.
|
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
-
tag tag to find the text block comment comment indentLevel indentation level
- Returns
- HierarchicalCodeBlock object
Definition at line 183 of file codegenobjectwithtextblocks.cpp.
TextBlockList * CodeGenObjectWithTextBlocks::getTextBlockList | ( | ) | const |
Get the list of TextBlock objects held by m_textblockVector.
- Returns
- list of TextBlock objects held by m_textblockVector
Definition at line 46 of file codegenobjectwithtextblocks.cpp.
|
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.
- Parameters
-
root node from which to load the child text blocks
Reimplemented in JavaANTCodeDocument, JavaClassifierCodeDocument, CPPHeaderCodeDocument, DClassifierCodeDocument, and RubyClassifierCodeDocument.
Definition at line 441 of file codegenobjectwithtextblocks.cpp.
|
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.
- Parameters
-
remove_object the text block to be removed
- Returns
- success status
Reimplemented in HierarchicalCodeBlock.
Definition at line 95 of file codegenobjectwithtextblocks.cpp.
|
protectedvirtual |
Reset/clear the inventory text blocks held by this object.
Reimplemented in CodeDocument, JavaClassifierCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, RubyClassifierCodeDocument, and CPPHeaderCodeDocument.
Definition at line 333 of file codegenobjectwithtextblocks.cpp.
|
protectedvirtual |
Set the class attributes of this object from the passed element node.
- Parameters
-
root node from which to load the child text blocks
Reimplemented in ClassifierCodeDocument, CodeDocument, JavaANTCodeDocument, XMLElementCodeBlock, HierarchicalCodeBlock, and OwnedHierarchicalCodeBlock.
Definition at line 424 of file codegenobjectwithtextblocks.cpp.
|
protected |
Empty method.
Definition at line 390 of file codegenobjectwithtextblocks.cpp.
|
protectedvirtual |
Set attributes of the node that represents this class in the XMI document.
Reimplemented in ClassifierCodeDocument, CodeDocument, JavaANTCodeDocument, HierarchicalCodeBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.
Definition at line 406 of file codegenobjectwithtextblocks.cpp.
Member Data Documentation
|
protected |
Definition at line 95 of file codegenobjectwithtextblocks.h.
|
protected |
Definition at line 96 of file codegenobjectwithtextblocks.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.