umbrello/umbrello
#include <codeblock.h>

Public Types | |
enum | ContentType { AutoGenerated =0, UserGenerated } |
Public Member Functions | |
CodeBlock (CodeDocument *parent, const QString &body=QString()) | |
virtual | ~CodeBlock () |
ContentType | contentType () const |
virtual void | loadFromXMI (QDomElement &root) |
virtual void | saveToXMI (QDomDocument &doc, QDomElement &root) |
virtual void | setAttributesFromObject (TextBlock *obj) |
void | setContentType (ContentType new_var) |
![]() | |
TextBlock (CodeDocument *parent, const QString &text=QString()) | |
virtual | ~TextBlock () |
void | appendText (const QString &text) |
bool | canDelete () const |
virtual int | firstEditableLine () |
int | getIndentationLevel () const |
QString | getIndentationString (int level=0) const |
virtual QString | getNewEditorLine (int amount=0) |
CodeDocument * | getParentDocument () const |
QString | getTag () const |
QString | getText () const |
bool | getWriteOutText () const |
virtual int | lastEditableLine () |
void | setIndentationLevel (int level) |
void | setTag (const QString &value) |
void | setText (const QString &text) |
void | setWriteOutText (bool write) |
virtual QString | toString () const |
virtual QString | unformatText (const QString &text, const QString &indent=QString()) |
Static Public Member Functions | |
static QString | enumToString (const ContentType &val) |
![]() | |
static QString | decodeText (const QString &text, const QString &endLine) |
static QString | encodeText (const QString &text, const QString &endLine) |
static QString | formatMultiLineText (const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true) |
static QString | getIndentation () |
static QString | getNewLineEndingChars () |
Protected Member Functions | |
virtual void | setAttributesFromNode (QDomElement &element) |
virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement) |
![]() | |
virtual void | release () |
void | setCanDelete (bool canDelete) |
Friends | |
QDebug | operator<< (QDebug str, const CodeBlock &obj) |
Detailed Description
A "chunk" of code within the code document.
Definition at line 20 of file codeblock.h.
Member Enumeration Documentation
Describes the creation of the content.
Enumerator | |
---|---|
AutoGenerated |
the content was generated by code generation itself |
UserGenerated |
the content was entered by the user |
Definition at line 27 of file codeblock.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
- Parameters
-
doc the documentation text body the body text
Definition at line 24 of file codeblock.cpp.
|
virtual |
Empty Destructor.
Definition at line 33 of file codeblock.cpp.
Member Function Documentation
CodeBlock::ContentType CodeBlock::contentType | ( | ) | const |
Get the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.
- Returns
- the value of m_contentType
Definition at line 54 of file codeblock.cpp.
|
static |
Return a string representation of ContentType.
- Parameters
-
val the enum value of the ContentType
- Returns
- the string representation of the enum
Definition at line 127 of file codeblock.cpp.
|
virtual |
Load params from the appropriate XMI element node.
- Parameters
-
root the starting point to load from
Implements TextBlock.
Reimplemented in OwnedHierarchicalCodeBlock, CodeAccessorMethod, HierarchicalCodeBlock, RubyClassDeclarationBlock, CodeClassFieldDeclarationBlock, CPPHeaderClassDeclarationBlock, XMLElementCodeBlock, CodeBlockWithComments, CodeOperation, DClassDeclarationBlock, and JavaClassDeclarationBlock.
Definition at line 91 of file codeblock.cpp.
|
virtual |
Save the XMI representation of this object.
- Parameters
-
doc the xmi document root the starting point to append
Implements TextBlock.
Reimplemented in OwnedHierarchicalCodeBlock, CodeAccessorMethod, HierarchicalCodeBlock, CodeClassFieldDeclarationBlock, RubyClassDeclarationBlock, CPPHeaderClassDeclarationBlock, CodeBlockWithComments, CodeOperation, XMLElementCodeBlock, DClassDeclarationBlock, and JavaClassDeclarationBlock.
Definition at line 64 of file codeblock.cpp.
|
protectedvirtual |
Set the class attributes of this object from the passed element node.
- Parameters
-
elem the xmi element from which to load
Reimplemented from TextBlock.
Reimplemented in CodeMethodBlock, XMLElementCodeBlock, HierarchicalCodeBlock, OwnedHierarchicalCodeBlock, CodeAccessorMethod, CodeOperation, CodeClassFieldDeclarationBlock, DCodeAccessorMethod, JavaCodeAccessorMethod, CodeBlockWithComments, and RubyCodeAccessorMethod.
Definition at line 101 of file codeblock.cpp.
|
virtual |
Set the class attributes from a passed object.
- Parameters
-
obj text block from which the attributes are taken
Reimplemented from TextBlock.
Reimplemented in CodeMethodBlock, HierarchicalCodeBlock, OwnedHierarchicalCodeBlock, DClassDeclarationBlock, CodeAccessorMethod, CPPHeaderClassDeclarationBlock, CodeOperation, CodeBlockWithComments, and CodeClassFieldDeclarationBlock.
Definition at line 113 of file codeblock.cpp.
|
protectedvirtual |
Set attributes of the node that represents this class in the XMI document.
- Parameters
-
doc the xmi document blockElement the xmi element holding the attributes
Reimplemented from TextBlock.
Reimplemented in CodeMethodBlock, HierarchicalCodeBlock, XMLElementCodeBlock, OwnedHierarchicalCodeBlock, CodeAccessorMethod, CodeOperation, CodeClassFieldDeclarationBlock, CodeBlockWithComments, DCodeAccessorMethod, JavaCodeAccessorMethod, and RubyCodeAccessorMethod.
Definition at line 78 of file codeblock.cpp.
void CodeBlock::setContentType | ( | ContentType | new_var | ) |
Set the value of m_contentType specifies whether the content (text) of this object was generated by the code generator or was supplied by the user.
- Parameters
-
new_var the new value of m_contentType
Definition at line 43 of file codeblock.cpp.
Friends And Related Function Documentation
Definition at line 137 of file codeblock.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.