• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
CodeBlock Class Reference

#include <codeblock.h>

Inheritance diagram for CodeBlock:
Inheritance graph
[legend]

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)
 
- Public Member Functions inherited from TextBlock
 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 Public Member Functions inherited from TextBlock
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)
 
- Protected Member Functions inherited from TextBlock
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

enum CodeBlock::ContentType

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

CodeBlock::CodeBlock ( CodeDocument *  doc,
const QString &  body = QString() 
)
explicit

Constructor.

Parameters
docthe documentation text
bodythe body text

Definition at line 24 of file codeblock.cpp.

CodeBlock::~CodeBlock ( )
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.

QString CodeBlock::enumToString ( const ContentType &  val)
static

Return a string representation of ContentType.

Parameters
valthe enum value of the ContentType
Returns
the string representation of the enum

Definition at line 127 of file codeblock.cpp.

void CodeBlock::loadFromXMI ( QDomElement &  root)
virtual

Load params from the appropriate XMI element node.

Parameters
rootthe 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.

void CodeBlock::saveToXMI ( QDomDocument &  doc,
QDomElement &  root 
)
virtual

Save the XMI representation of this object.

Parameters
docthe xmi document
rootthe 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.

void CodeBlock::setAttributesFromNode ( QDomElement &  elem)
protectedvirtual

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

Parameters
elemthe 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.

void CodeBlock::setAttributesFromObject ( TextBlock *  obj)
virtual

Set the class attributes from a passed object.

Parameters
objtext 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.

void CodeBlock::setAttributesOnNode ( QDomDocument &  doc,
QDomElement &  blockElement 
)
protectedvirtual

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

Parameters
docthe xmi document
blockElementthe 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_varthe new value of m_contentType

Definition at line 43 of file codeblock.cpp.

Friends And Related Function Documentation

QDebug operator<< ( QDebug  str,
const CodeBlock &  obj 
)
friend

Definition at line 137 of file codeblock.cpp.


The documentation for this class was generated from the following files:
  • codeblock.h
  • codeblock.cpp
This file is part of the KDE documentation.
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.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal