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 | Private Member Functions | Private Attributes | Friends | List of all members
HierarchicalCodeBlock Class Reference

#include <hierarchicalcodeblock.h>

Inheritance diagram for HierarchicalCodeBlock:
Collaboration diagram for HierarchicalCodeBlock:

Public Member Functions

 HierarchicalCodeBlock (CodeDocument *doc, const QString &startString=QString(), const QString &endString=QString(), const QString &comment=QString())
 
virtual ~HierarchicalCodeBlock ()
 
void setEndText (const QString &new_var)
 
QString getEndText () const
 
bool addTextBlock (TextBlock *add_object)
 
bool insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after=true)
 
bool removeTextBlock (TextBlock *remove_object)
 
void setStartText (const QString &text)
 
QString getStartText () const
 
virtual void saveToXMI (QXmlStreamWriter &writer)
 
virtual void loadFromXMI (QDomElement &root)
 
virtual QString toString () const
 
QString getUniqueTag ()
 
QString getUniqueTag (const QString &prefix)
 
void addCodeClassFieldMethods (CodeClassFieldList &list)
 
virtual CodeBlocknewCodeBlock ()
 
virtual CodeBlockWithCommentsnewCodeBlockWithComments ()
 
virtual HierarchicalCodeBlocknewHierarchicalCodeBlock ()
 
- Public Member Functions inherited from CodeBlockWithComments
 CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
 
virtual ~CodeBlockWithComments ()
 
void setComment (CodeComment *object)
 
CodeCommentgetComment () const
 
void setOverallIndentationLevel (int level)
 
- Public Member Functions inherited from CodeBlock
 CodeBlock (CodeDocument *parent, const QString &body=QString())
 
virtual ~CodeBlock ()
 
void setContentType (ContentType new_var)
 
ContentType contentType () const
 
- Public Member Functions inherited from TextBlock
 TextBlock (CodeDocument *parent, const QString &text=QString())
 
virtual ~TextBlock ()
 
void setText (const QString &text)
 
QString getText () const
 
void appendText (const QString &text)
 
void setTag (const QString &value)
 
QString getTag () const
 
CodeDocumentgetParentDocument () const
 
void setWriteOutText (bool write)
 
bool getWriteOutText () const
 
void setIndentationLevel (int level)
 
int getIndentationLevel () const
 
QString getIndentationString (int level=0) const
 
virtual QString unformatText (const QString &text, const QString &indent=QString())
 
bool canDelete () const
 
virtual QString getNewEditorLine (int amount=0)
 
virtual int firstEditableLine ()
 
virtual int lastEditableLine ()
 
- Public Member Functions inherited from CodeGenObjectWithTextBlocks
 CodeGenObjectWithTextBlocks (CodeDocument *parent)
 
virtual ~CodeGenObjectWithTextBlocks ()
 
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)
 
CodeGenObjectWithTextBlocksfindParentObjectForTaggedTextBlock (const QString &tag)
 

Protected Member Functions

virtual void release ()
 
virtual void setAttributesOnNode (QXmlStreamWriter &writer)
 
virtual void setAttributesFromNode (QDomElement &element)
 
virtual void setAttributesFromObject (TextBlock *obj)
 
TextBlockfindCodeClassFieldTextBlockByTag (const QString &tag)
 
- Protected Member Functions inherited from TextBlock
void setCanDelete (bool canDelete)
 
- Protected Member Functions inherited from CodeGenObjectWithTextBlocks
void setAttributesFromObject (CodeGenObjectWithTextBlocks *obj)
 
virtual void loadChildTextBlocksFromNode (QDomElement &root)
 
virtual void resetTextBlocks ()
 

Private Member Functions

QString childTextBlocksToString () const
 
void initAttributes ()
 

Private Attributes

QString m_startText
 
QString m_endText
 

Friends

class CodeGenObjectWithTextBlocks
 

Additional Inherited Members

- Public Types inherited from CodeBlock
enum  ContentType { AutoGenerated =0 , UserGenerated }
 
- Static Public Member Functions inherited from CodeBlock
static QString enumToString (const ContentType &val)
 
- Static Public Member Functions inherited from TextBlock
static QString getIndentation ()
 
static QString getNewLineEndingChars ()
 
static QString formatMultiLineText (const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true)
 
static QString encodeText (const QString &text, const QString &endLine)
 
static QString decodeText (const QString &text, const QString &endLine)
 
- Protected Attributes inherited from CodeGenObjectWithTextBlocks
QMap< QString, TextBlock * > m_textBlockTagMap
 
TextBlockList m_textblockVector
 

Constructor & Destructor Documentation

◆ HierarchicalCodeBlock()

HierarchicalCodeBlock::HierarchicalCodeBlock ( CodeDocument doc,
const QString &  start = QString(),
const QString &  endString = QString(),
const QString &  comment = QString() 
)
explicit

Constructor

Here is the call graph for this function:

◆ ~HierarchicalCodeBlock()

HierarchicalCodeBlock::~HierarchicalCodeBlock ( )
virtual

Empty Destructor

Member Function Documentation

◆ addCodeClassFieldMethods()

void HierarchicalCodeBlock::addCodeClassFieldMethods ( CodeClassFieldList list)

Utility method to add accessormethods in this object

Here is the call graph for this function:

◆ addTextBlock()

bool HierarchicalCodeBlock::addTextBlock ( TextBlock add_object)
virtual

Add a TextBlock object to the m_textblockVector List

Reimplemented from CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ childTextBlocksToString()

QString HierarchicalCodeBlock::childTextBlocksToString ( ) const
private
Here is the call graph for this function:

◆ findCodeClassFieldTextBlockByTag()

TextBlock * HierarchicalCodeBlock::findCodeClassFieldTextBlockByTag ( const QString &  tag)
protectedvirtual

look for specific text blocks which belong to code classfields

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ getEndText()

QString HierarchicalCodeBlock::getEndText ( ) const

Get the value of m_endText

Returns
the value of m_endText

◆ getStartText()

QString HierarchicalCodeBlock::getStartText ( ) const
Returns
QString

◆ getUniqueTag() [1/2]

QString HierarchicalCodeBlock::getUniqueTag ( )

return a unique, and currently unallocated, text block tag for this hblock

Here is the call graph for this function:

◆ getUniqueTag() [2/2]

QString HierarchicalCodeBlock::getUniqueTag ( const QString &  prefix)
virtual

return a unique, and currently unallocated, text block tag for this hblock

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ initAttributes()

void HierarchicalCodeBlock::initAttributes ( )
private
Here is the call graph for this function:

◆ insertTextBlock()

bool HierarchicalCodeBlock::insertTextBlock ( TextBlock newBlock,
TextBlock existingBlock,
bool  after = true 
)
virtual

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

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ loadFromXMI()

void HierarchicalCodeBlock::loadFromXMI ( QDomElement &  root)
virtual

load params from the appropriate XMI element node.

Reimplemented from CodeBlockWithComments.

Reimplemented in CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ newCodeBlock()

CodeBlock * HierarchicalCodeBlock::newCodeBlock ( )
virtual

Virtual methods that return a new code document objects.

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ newCodeBlockWithComments()

CodeBlockWithComments * HierarchicalCodeBlock::newCodeBlockWithComments ( )
virtual

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ newHierarchicalCodeBlock()

HierarchicalCodeBlock * HierarchicalCodeBlock::newHierarchicalCodeBlock ( )
virtual

Implements CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ release()

void HierarchicalCodeBlock::release ( )
protectedvirtual

causes the text block to release all of its connections and any other text blocks that it 'owns'. needed to be called prior to deletion of the textblock.

Reimplemented from TextBlock.

Reimplemented in OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ removeTextBlock()

bool HierarchicalCodeBlock::removeTextBlock ( TextBlock remove_object)
virtual

Remove a TextBlock object from m_textblockVector List returns boolean - true if successful

Reimplemented from CodeGenObjectWithTextBlocks.

Here is the call graph for this function:

◆ saveToXMI()

void HierarchicalCodeBlock::saveToXMI ( QXmlStreamWriter &  writer)
virtual

Save the XMI representation of this object

Reimplemented from CodeBlockWithComments.

Reimplemented in CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ setAttributesFromNode()

void HierarchicalCodeBlock::setAttributesFromNode ( QDomElement &  root)
protectedvirtual

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

Reimplemented from CodeBlockWithComments.

Reimplemented in OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.

Here is the call graph for this function:

◆ setAttributesFromObject()

void HierarchicalCodeBlock::setAttributesFromObject ( TextBlock obj)
protectedvirtual

set the class attributes from a passed object

Reimplemented from CodeBlockWithComments.

Reimplemented in CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ setAttributesOnNode()

void HierarchicalCodeBlock::setAttributesOnNode ( QXmlStreamWriter &  writer)
protectedvirtual

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

Reimplemented from CodeBlockWithComments.

Reimplemented in OwnedHierarchicalCodeBlock, and XMLElementCodeBlock.

Here is the call graph for this function:

◆ setEndText()

void HierarchicalCodeBlock::setEndText ( const QString &  new_var)

Set the value of m_endText

Parameters
new_varthe new value of m_endText

◆ setStartText()

void HierarchicalCodeBlock::setStartText ( const QString &  text)
Parameters
text

◆ toString()

QString HierarchicalCodeBlock::toString ( ) const
virtual
Returns
QString

Reimplemented from CodeBlockWithComments.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ CodeGenObjectWithTextBlocks

friend class CodeGenObjectWithTextBlocks
friend

Member Data Documentation

◆ m_endText

QString HierarchicalCodeBlock::m_endText
private

◆ m_startText

QString HierarchicalCodeBlock::m_startText
private

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