umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <codedocument.h>
Public Member Functions | |
CodeDocument () | |
virtual | ~CodeDocument () |
void | setFileExtension (const QString &new_var) |
QString | getFileExtension () const |
void | setFileName (const QString &new_var) |
QString | getFileName () const |
void | setPackage (UMLPackage *new_var) |
QString | getPackage () const |
virtual QString | getPath () const |
void | setID (const QString &new_id) |
QString | ID () const |
void | setWriteOutCode (bool new_var) |
bool | getWriteOutCode () const |
void | setHeader (CodeComment *comment) |
CodeComment * | getHeader () const |
bool | insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after=true) |
TextBlock * | findTextBlockByTag (const QString &tag, bool descendIntoChildren=false) const |
virtual QString | toString () const |
virtual void | saveToXMI (QXmlStreamWriter &writer) |
virtual void | loadFromXMI (QDomElement &root) |
virtual CodeBlock * | newCodeBlock () |
virtual HierarchicalCodeBlock * | newHierarchicalCodeBlock () |
virtual CodeBlockWithComments * | newCodeBlockWithComments () |
virtual QString | getUniqueTag (const QString &prefix=QString()) |
QString | cleanName (const QString &name) |
virtual void | synchronize () |
virtual void | updateContent () |
![]() | |
CodeGenObjectWithTextBlocks (CodeDocument *parent) | |
virtual | ~CodeGenObjectWithTextBlocks () |
virtual bool | addTextBlock (TextBlock *add_object) |
virtual bool | removeTextBlock (TextBlock *remove_object) |
TextBlockList * | getTextBlockList () const |
virtual HierarchicalCodeBlock * | getHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel) |
virtual CodeBlockWithComments * | getCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel) |
CodeComment * | addOrUpdateTaggedCodeComment (const QString &tag=QString(), const QString &text=QString(), int indentationLevel=0) |
CodeBlockWithComments * | addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate) |
TextBlock * | findTextBlockByTag (const QString &tag) |
CodeGenObjectWithTextBlocks * | findParentObjectForTaggedTextBlock (const QString &tag) |
Protected Member Functions | |
virtual void | setAttributesOnNode (QXmlStreamWriter &writer) |
virtual void | setAttributesFromNode (QDomElement &element) |
void | addChildTagToMap (const QString &tag, TextBlock *tb) |
void | removeChildTagFromMap (const QString &tag) |
void | updateHeader () |
void | resetTextBlocks () |
virtual TextBlock * | findCodeClassFieldTextBlockByTag (const QString &tag) |
![]() | |
void | setAttributesFromObject (CodeGenObjectWithTextBlocks *obj) |
virtual void | loadChildTextBlocksFromNode (QDomElement &root) |
Private Attributes | |
int | m_lastTagIndex |
QString | m_filename |
QString | m_fileExtension |
QString | m_ID |
QString | m_pathName |
UMLPackage * | m_package |
bool | m_writeOutCode |
CodeComment * | m_header |
QMap< QString, TextBlock * > | m_childTextBlockTagMap |
Friends | |
class | HierarchicalCodeBlock |
QDebug | operator<< (QDebug os, const CodeDocument &obj) |
Additional Inherited Members | |
![]() | |
QMap< QString, TextBlock * > | m_textBlockTagMap |
TextBlockList | m_textblockVector |
A document containing the code for one file. "friend" status is needed for HBlock so it may call addChildTagToMap which is protected.
CodeDocument::CodeDocument | ( | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
QString CodeDocument::cleanName | ( | const QString & | name | ) |
A little utility method which calls CodeGenerator::cleanName.
name | the cleanable name |
|
protectedvirtual |
Have to implement this for CodeObjectWithTextBlocks. Actually does not do anything for a vanilla code document.
Implements CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument.
TextBlock * CodeDocument::findTextBlockByTag | ( | const QString & | tag, |
bool | descendIntoChildren = false |
||
) | const |
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.
tag | the tag to look for |
descendIntoChildren | look down the hierarchy |
QString CodeDocument::getFileExtension | ( | ) | const |
Get the value of m_fileExtension.
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").
CodeComment * CodeDocument::getHeader | ( | ) | const |
Get the Header comment object.
QString CodeDocument::getPackage | ( | ) | const |
Get the value of the package of this code document.
|
virtual |
Get the value of the path to this code document.
Reimplemented in CPPMakefileCodeDocument, DClassifierCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.
|
virtual |
Return a unique and currently unallocated text block tag for this document.
prefix | the prefix to add |
Implements CodeGenObjectWithTextBlocks.
bool CodeDocument::getWriteOutCode | ( | ) | const |
Get the value of m_writeOutCode. Whether or not to write out this code document and any codeblocks, etc that it owns.
QString CodeDocument::ID | ( | ) | const |
Get the value of m_ID.
|
virtual |
Insert a new text block after the existing text block. Returns false if it cannot insert the textblock.
newBlock | the text block to insert |
existingBlock | the place where to insert |
after | at the index of the existingBlock or after |
Implements CodeGenObjectWithTextBlocks.
|
virtual |
Load params from the appropriate XMI element node.
root | the starting point for loading |
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
|
virtual |
Create a new CodeBlock object belonging to this CodeDocument.
Implements CodeGenObjectWithTextBlocks.
|
virtual |
Create a new CodeBlockWithComments object belonging to this CodeDocument.
Implements CodeGenObjectWithTextBlocks.
|
virtual |
Create a new HierarchicalCodeBlock object belonging to this CodeDocument.
Implements CodeGenObjectWithTextBlocks.
Reimplemented in JavaANTCodeDocument.
|
protected |
|
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 CPPHeaderCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument.
|
virtual |
Save the XMI representation of this object.
writer | QXmlStreamWriter serialization target |
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
|
protectedvirtual |
Set the class attributes of this object from the passed element node.
Reimplemented from CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
|
protectedvirtual |
Set attributes of the node that represents this class in the XMI document.
Reimplemented from CodeGenObjectWithTextBlocks.
Reimplemented in ClassifierCodeDocument, and JavaANTCodeDocument.
void CodeDocument::setFileExtension | ( | const QString & | new_var | ) |
Set the value of m_fileExtension.
new_var | the new value of m_fileExtension |
void CodeDocument::setFileName | ( | const QString & | new_var | ) |
Set the complete value (name plus any extension) of m_filename.
new_var | the new value of m_filename |
void CodeDocument::setHeader | ( | CodeComment * | comment | ) |
Set a Header comment object.
comment | the comment for the header |
void CodeDocument::setID | ( | const QString & | new_id | ) |
Set the value of m_ID.
new_id | the new value of m_ID |
void CodeDocument::setPackage | ( | UMLPackage * | new_var | ) |
Set the value of m_package.
new_var | the new value of m_package |
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.
new_var | the new value of m_writeOutCode |
|
virtual |
Cause this code document to synchronize to current generator policy.
Reimplemented in ClassifierCodeDocument.
|
virtual |
Create the string representation of this object.
Reimplemented in CPPMakefileCodeDocument.
|
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 CPPHeaderCodeDocument, CPPMakefileCodeDocument, CPPSourceCodeDocument, DClassifierCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, RubyClassifierCodeDocument, and ClassifierCodeDocument.
|
protected |
Update the header text of this codedocument (text and status of the head comment).
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |