umbrello 25.04.1
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:
CodeBlock TextBlock CodeClassFieldDeclarationBlock CodeMethodBlock HierarchicalCodeBlock CPPHeaderCodeClassFieldDeclarationBlock CPPSourceCodeClassFieldDeclarationBlock DCodeClassFieldDeclarationBlock JavaCodeClassFieldDeclarationBlock RubyCodeClassFieldDeclarationBlock CodeAccessorMethod CodeOperation OwnedHierarchicalCodeBlock XMLElementCodeBlock

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

◆ ~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

◆ saveToXMI()

void CodeBlockWithComments::saveToXMI ( QXmlStreamWriter &  writer)
virtual

◆ setAttributesFromNode()

void CodeBlockWithComments::setAttributesFromNode ( QDomElement &  root)
protectedvirtual

◆ setAttributesFromObject()

void CodeBlockWithComments::setAttributesFromObject ( TextBlock obj)
virtual

◆ setAttributesOnNode()

void CodeBlockWithComments::setAttributesOnNode ( QXmlStreamWriter &  writer)
protectedvirtual

◆ 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.

◆ toString()

QString CodeBlockWithComments::toString ( ) const
virtual
Returns
QString

Reimplemented from TextBlock.

Reimplemented in CodeMethodBlock, and HierarchicalCodeBlock.

Member Data Documentation

◆ m_comment

CodeComment* CodeBlockWithComments::m_comment
private

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