umbrello/umbrello
#include <codedocument.h>
Public Member Functions | |
CodeDocument () | |
virtual | ~CodeDocument () |
QString | cleanName (const QString &name) |
TextBlock * | findTextBlockByTag (const QString &tag, bool descendIntoChildren=false) |
QString | getFileExtension () const |
QString | getFileName () const |
CodeComment * | getHeader () |
QString | getPackage () const |
virtual QString | getPath () |
virtual QString | getUniqueTag (const QString &prefix=QString()) |
bool | getWriteOutCode () |
QString | ID () const |
bool | insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after=true) |
virtual void | loadFromXMI (QDomElement &root) |
virtual CodeBlock * | newCodeBlock () |
virtual CodeBlockWithComments * | newCodeBlockWithComments () |
virtual HierarchicalCodeBlock * | newHierarchicalCodeBlock () |
virtual void | saveToXMI (QDomDocument &doc, QDomElement &root) |
void | setFileExtension (const QString &new_var) |
void | setFileName (const QString &new_var) |
void | setHeader (CodeComment *comment) |
void | setID (const QString &new_id) |
void | setPackage (UMLPackage *new_var) |
void | setWriteOutCode (bool new_var) |
virtual void | synchronize () |
virtual QString | toString () |
virtual void | updateContent () |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Public Member Functions inherited from CodeGenObjectWithTextBlocks | |
CodeGenObjectWithTextBlocks (CodeDocument *parent) | |
virtual | ~CodeGenObjectWithTextBlocks () |
CodeBlockWithComments * | addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate) |
CodeComment * | addOrUpdateTaggedCodeComment (const QString &tag=QString(), const QString &text=QString(), int indentationLevel=0) |
virtual bool | addTextBlock (TextBlock *add_object) |
CodeGenObjectWithTextBlocks * | findParentObjectForTaggedTextBlock (const QString &tag) |
TextBlock * | findTextBlockByTag (const QString &tag) |
virtual CodeBlockWithComments * | getCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel) |
virtual HierarchicalCodeBlock * | getHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel) |
TextBlockList * | getTextBlockList () const |
virtual bool | removeTextBlock (TextBlock *remove_object) |
Protected Member Functions | |
void | addChildTagToMap (const QString &tag, TextBlock *tb) |
virtual TextBlock * | findCodeClassFieldTextBlockByTag (const QString &tag) |
void | removeChildTagFromMap (const QString &tag) |
void | resetTextBlocks () |
virtual void | setAttributesFromNode (QDomElement &element) |
virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &blockElement) |
void | updateHeader () |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Member Functions inherited from CodeGenObjectWithTextBlocks | |
virtual void | loadChildTextBlocksFromNode (QDomElement &root) |
void | setAttributesFromObject (CodeGenObjectWithTextBlocks *obj) |
Friends | |
QDebug | operator<< (QDebug os, const CodeDocument &obj) |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Protected Attributes inherited from CodeGenObjectWithTextBlocks | |
QMap< QString, TextBlock * > | m_textBlockTagMap |
TextBlockList | m_textblockVector |
Properties inherited from QObject | |
objectName | |
Detailed Description
A document containing the code for one file.
"friend" status is needed for HBlock so it may call addChildTagToMap which is protected.
Definition at line 32 of file codedocument.h.
Constructor & Destructor Documentation
CodeDocument::CodeDocument | ( | ) |
Constructor.
Definition at line 29 of file codedocument.cpp.
|
virtual |
Destructor.
Definition at line 40 of file codedocument.cpp.
Member Function Documentation
Definition at line 490 of file codedocument.cpp.
A little utility method which calls CodeGenerator::cleanName.
- Parameters
-
name the cleanable name
- Returns
- the cleaned name
Definition at line 270 of file codedocument.cpp.
Have to implement this for CodeObjectWithTextBlocks.
Actually does not do anythying for a vannilla code document.
Implements CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument.
Definition at line 520 of file codedocument.cpp.
TextBlock * CodeDocument::findTextBlockByTag | ( | const QString & | tag, |
bool | descendIntoChildren = false |
||
) |
Lookup a certain textblock by its tag value, returns NULL if it cannot find the TextBlock with such a tag.
If descendIntoChildren is true, then any child hierarchical textblocks will also be searched for a match.
- Parameters
-
tag the tag to look for descendIntoChildren look down the hierarchy
- Returns
- the found text block
Definition at line 503 of file codedocument.cpp.
QString CodeDocument::getFileExtension | ( | ) | const |
Get the value of m_fileExtension.
- Returns
- the value of m_fileExtension
Definition at line 82 of file codedocument.cpp.
QString CodeDocument::getFileName | ( | ) | const |
Get the value of m_filename.
This name is the "complete" filename, meaning that it contains both the file name plus any extension (e.g. "file.cpp").
- Returns
- the value of m_filename
Definition at line 63 of file codedocument.cpp.
CodeComment * CodeDocument::getHeader | ( | ) |
Get the Header comment object.
- Returns
- the comment for the header
Definition at line 183 of file codedocument.cpp.
QString CodeDocument::getPackage | ( | ) | const |
Get the value of the package of this code document.
- Returns
- the value of m_pathName
Definition at line 123 of file codedocument.cpp.
|
virtual |
Get the value of the path to this code document.
- Returns
- the value of m_pathName
Reimplemented in JavaClassifierCodeDocument, DClassifierCodeDocument, RubyClassifierCodeDocument, CPPMakefileCodeDocument, and JavaANTCodeDocument.
Definition at line 100 of file codedocument.cpp.
Return a unique and currently unallocated text block tag for this document.
- Parameters
-
prefix the prefix to add
- Returns
- the just created unique tag
Implements CodeGenObjectWithTextBlocks.
Definition at line 193 of file codedocument.cpp.
bool CodeDocument::getWriteOutCode | ( | ) |
Get the value of m_writeOutCode.
Whether or not to write out this code document and any codeblocks, etc that it owns.
- Returns
- the value of m_writeOutCode
Definition at line 165 of file codedocument.cpp.
QString CodeDocument::ID | ( | ) | const |
|
virtual |
Insert a new text block after the existing text block.
Returns false if it cannot insert the textblock.
- Parameters
-
newBlock the text block to insert existingBlock the place where to insert after at the index of the existingBlock or after
- Returns
- the success status
Implements CodeGenObjectWithTextBlocks.
Definition at line 216 of file codedocument.cpp.
|
virtual |
Load params from the appropriate XMI element node.
- Parameters
-
root the starting point for loading
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
Definition at line 348 of file codedocument.cpp.
|
virtual |
Create a new CodeBlock object belonging to this CodeDocument.
- Returns
- the just created CodeBlock
Implements CodeGenObjectWithTextBlocks.
Definition at line 460 of file codedocument.cpp.
|
virtual |
Create a new CodeBlockWithComments object belonging to this CodeDocument.
- Returns
- the just created CodeBlockWithComments
Implements CodeGenObjectWithTextBlocks.
Definition at line 469 of file codedocument.cpp.
|
virtual |
Create a new HierarchicalCodeBlock object belonging to this CodeDocument.
- Returns
- the just created HierarchicalCodeBlock
Implements CodeGenObjectWithTextBlocks.
Reimplemented in JavaANTCodeDocument.
Definition at line 478 of file codedocument.cpp.
|
protected |
Definition at line 485 of file codedocument.cpp.
|
protectedvirtual |
Reset/clear our inventory of textblocks in this document.
Need to overload method to be able to clear the childTextBlockMap.
Reimplemented from CodeGenObjectWithTextBlocks.
Reimplemented in JavaClassifierCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, RubyClassifierCodeDocument, and CPPHeaderCodeDocument.
Definition at line 338 of file codedocument.cpp.
|
virtual |
Save the XMI representation of this object.
- Parameters
-
doc the xmi document root the starting point to append
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
Definition at line 437 of file codedocument.cpp.
|
protectedvirtual |
Set the class attributes of this object from the passed element node.
Reimplemented from CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
Definition at line 388 of file codedocument.cpp.
|
protectedvirtual |
Set attributes of the node that represents this class in the XMI document.
Reimplemented from CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
Definition at line 357 of file codedocument.cpp.
void CodeDocument::setFileExtension | ( | const QString & | new_var | ) |
Set the value of m_fileExtension.
- Parameters
-
new_var the new value of m_fileExtension
Definition at line 72 of file codedocument.cpp.
void CodeDocument::setFileName | ( | const QString & | new_var | ) |
Set the complete value (name plus any extension) of m_filename.
- Parameters
-
new_var the new value of m_filename
Definition at line 53 of file codedocument.cpp.
void CodeDocument::setHeader | ( | CodeComment * | comment | ) |
Set a Header comment object.
- Parameters
-
comment the comment for the header
Definition at line 174 of file codedocument.cpp.
void CodeDocument::setID | ( | const QString & | new_id | ) |
Set the value of m_ID.
- Parameters
-
new_id the new value of m_ID
Definition at line 134 of file codedocument.cpp.
void CodeDocument::setPackage | ( | UMLPackage * | new_var | ) |
Set the value of m_package.
- Parameters
-
new_var the new value of m_package
Definition at line 91 of file codedocument.cpp.
void CodeDocument::setWriteOutCode | ( | bool | new_var | ) |
Set the value of m_writeOutCode.
Whether or not to write out this code document and any codeblocks, etc that it owns.
- Parameters
-
new_var the new value of m_writeOutCode
Definition at line 154 of file codedocument.cpp.
|
virtual |
Cause this code document to synchronize to current generator policy.
Reimplemented in ClassifierCodeDocument.
Definition at line 329 of file codedocument.cpp.
|
virtual |
Create the string representation of this object.
- Returns
- the created string
Reimplemented in CPPMakefileCodeDocument.
Definition at line 302 of file codedocument.cpp.
|
virtual |
Update the content of this code document.
This is where you should lay out your code document structure of textblocks in the inheriting class, should it have any text in it. Vanilla code documents don't have much to do.. override this with a different version for your own documents.
Reimplemented in ClassifierCodeDocument, JavaClassifierCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, RubyClassifierCodeDocument, CPPMakefileCodeDocument, CPPHeaderCodeDocument, and JavaANTCodeDocument.
Definition at line 451 of file codedocument.cpp.
|
protected |
Update the header text of this codedocument (text and status of the head comment).
Definition at line 279 of file codedocument.cpp.
Friends And Related Function Documentation
|
friend |
Definition at line 526 of file codedocument.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.