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 Attributes | List of all members
CodeBlockWithComments Class Reference

#include <codeblockwithcomments.h>

Inheritance diagram for CodeBlockWithComments:
Collaboration diagram for CodeBlockWithComments:

Public Member Functions

 CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
 
virtual ~CodeBlockWithComments ()
 
void setComment (CodeComment *object)
 
CodeCommentgetComment () const
 
virtual QString toString () const
 
void setOverallIndentationLevel (int level)
 
virtual void saveToXMI (QXmlStreamWriter &writer)
 
virtual void loadFromXMI (QDomElement &root)
 
virtual void setAttributesFromObject (TextBlock *obj)
 
- 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 ()
 

Protected Member Functions

virtual void setAttributesOnNode (QXmlStreamWriter &writer)
 
virtual void setAttributesFromNode (QDomElement &element)
 
- Protected Member Functions inherited from TextBlock
void setCanDelete (bool canDelete)
 
virtual void release ()
 

Private Attributes

CodeCommentm_comment
 

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)
 

Detailed Description

class CodeBlockWithComments A very common type of text block in any type of code.

Constructor & Destructor Documentation

◆ CodeBlockWithComments()

CodeBlockWithComments::CodeBlockWithComments ( CodeDocument parent,
const QString &  body = QString(),
const QString &  comment = QString() 
)
explicit

Basic Constructor

Here is the call graph for this function:

◆ ~CodeBlockWithComments()

CodeBlockWithComments::~CodeBlockWithComments ( )
virtual

Empty Destructor

Member Function Documentation

◆ getComment()

CodeComment * CodeBlockWithComments::getComment ( ) const

Get the Comment object.

◆ loadFromXMI()

void CodeBlockWithComments::loadFromXMI ( QDomElement &  root)
virtual

Load params from the appropriate XMI element node.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ saveToXMI()

void CodeBlockWithComments::saveToXMI ( QXmlStreamWriter &  writer)
virtual

Save the XMI representation of this object

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, JavaClassDeclarationBlock, RubyClassDeclarationBlock, XMLElementCodeBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ setAttributesFromNode()

void CodeBlockWithComments::setAttributesFromNode ( QDomElement &  root)
protectedvirtual

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

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, DCodeAccessorMethod, HierarchicalCodeBlock, JavaCodeAccessorMethod, OwnedHierarchicalCodeBlock, RubyCodeAccessorMethod, and XMLElementCodeBlock.

Here is the call graph for this function:

◆ setAttributesFromObject()

void CodeBlockWithComments::setAttributesFromObject ( TextBlock obj)
virtual

Set the class attributes from a passed object.

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, CPPHeaderClassDeclarationBlock, DClassDeclarationBlock, HierarchicalCodeBlock, and OwnedHierarchicalCodeBlock.

Here is the call graph for this function:

◆ setAttributesOnNode()

void CodeBlockWithComments::setAttributesOnNode ( QXmlStreamWriter &  writer)
protectedvirtual

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

Reimplemented from CodeBlock.

Reimplemented in CodeAccessorMethod, CodeClassFieldDeclarationBlock, CodeMethodBlock, CodeOperation, DCodeAccessorMethod, HierarchicalCodeBlock, JavaCodeAccessorMethod, OwnedHierarchicalCodeBlock, RubyCodeAccessorMethod, and XMLElementCodeBlock.

Here is the call graph for this function:

◆ setComment()

void CodeBlockWithComments::setComment ( CodeComment object)

Set the Comment object.

◆ setOverallIndentationLevel()

void CodeBlockWithComments::setOverallIndentationLevel ( int  level)

A utility method that causes the comment and body of the code block to have the same indentation level.

Here is the call graph for this function:

◆ toString()

QString CodeBlockWithComments::toString ( ) const
virtual
Returns
QString

Reimplemented from TextBlock.

Reimplemented in CodeMethodBlock, and HierarchicalCodeBlock.

Here is the call graph for this function:

Member Data Documentation

◆ m_comment

CodeComment* CodeBlockWithComments::m_comment
private

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