umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

dclassifiercodedocument.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2007 Jari-Matti Mäkelä <jmjm@iki.fi> *
8 * copyright (C) 2008-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef DCLASSIFIERCODEDOCUMENT_H
13 #define DCLASSIFIERCODEDOCUMENT_H
14
15 #include "codeclassfieldlist.h"
16 #include "classifiercodedocument.h"
17 #include "classifier.h"
18 #include "hierarchicalcodeblock.h"
19 #include "dcodeclassfield.h"
20 #include "dcodeoperation.h"
21
22 #include <QString>
23
24 class DClassDeclarationBlock;
25 class DCodeGenerationPolicy;
26
36 class DClassifierCodeDocument : public ClassifierCodeDocument
37 {
38 Q_OBJECT
39 public:
40
41 explicit DClassifierCodeDocument(UMLClassifier * classifier);
42 virtual ~DClassifierCodeDocument();
43
44 // CodeDocumentDialog getDialog();
45
46 DCodeGenerationPolicy * getDPolicy();
47
48 QString getDClassName(const QString &name);
49
50 QString getPath();
51
52 bool addCodeOperation(CodeOperation * op);
53
54 void updateContent();
55
56 protected:
57
58 void resetTextBlocks();
59
60 virtual void loadChildTextBlocksFromNode(QDomElement & root);
61
62 void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, DClassDeclarationBlock * codeBlock);
63
64 bool forceDoc();
65
66 private:
67
68 DClassDeclarationBlock * classDeclCodeBlock;
69 HierarchicalCodeBlock * constructorBlock;
70 HierarchicalCodeBlock * operationsBlock;
71
72 /*
73 QString fileName; // Just for our convenience in creating code
74 QString endLine; // characters for ending line. Just for our convenience in creating code
75 QString DClassName;
76 */
77 void init();
78 DClassDeclarationBlock * getClassDecl();
79
80 };
81
82 #endif // DCLASSIFIERCODEDOCUMENT_H
CodeClassField::Composition
@ Composition
Definition: codeclassfield.h:34
UMLObject::package
QString package(const QString &separator=QString(), bool includeRoot=false)
Definition: umlobject.cpp:578
DCodeComment
Definition: dcodecomment.h:26
ClassifierCodeDocument::parentIsInterface
bool parentIsInterface()
Definition: classifiercodedocument.cpp:418
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
CodeDocument::resetTextBlocks
void resetTextBlocks()
Definition: codedocument.cpp:338
CodeDocument::newHierarchicalCodeBlock
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock()
Definition: codedocument.cpp:478
CodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblock.cpp:91
CodeGenObjectWithTextBlocks::addOrUpdateTaggedCodeBlockWithComments
CodeBlockWithComments * addOrUpdateTaggedCodeBlockWithComments(const QString &tag, const QString &text, const QString &ctext, int indentLevel, bool forceUserBlockUpdate)
Definition: codegenobjectwithtextblocks.cpp:280
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1324
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
dcodecomment.h
codeclassfieldlist.h
CodeClassField::parentIsAttribute
bool parentIsAttribute() const
Definition: codeclassfield.cpp:127
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Definition: codegenerator.cpp:549
hierarchicalcodeblock.h
DClassifierCodeDocument::addCodeOperation
bool addCodeOperation(CodeOperation *op)
Definition: dclassifiercodedocument.cpp:116
CodeComment
Definition: codecomment.h:24
TextBlock::setWriteOutText
void setWriteOutText(bool write)
Definition: textblock.cpp:131
DClassifierCodeDocument
Definition: dclassifiercodedocument.h:37
DClassifierCodeDocument::DClassifierCodeDocument
DClassifierCodeDocument(UMLClassifier *classifier)
Definition: dclassifiercodedocument.cpp:32
dclassdeclarationblock.h
DClassifierCodeDocument::~DClassifierCodeDocument
virtual ~DClassifierCodeDocument()
Definition: dclassifiercodedocument.cpp:41
CodeDocument::setFileExtension
void setFileExtension(const QString &new_var)
Definition: codedocument.cpp:72
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Definition: codegenerator.cpp:622
DCodeOperation
Definition: dcodeoperation.h:22
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2283
DClassifierCodeDocument::getPath
QString getPath()
Definition: dclassifiercodedocument.cpp:69
CodeGenObjectWithTextBlocks::addTextBlock
virtual bool addTextBlock(TextBlock *add_object)
Definition: codegenobjectwithtextblocks.cpp:57
DClassifierCodeDocument::getDPolicy
DCodeGenerationPolicy * getDPolicy()
Definition: dclassifiercodedocument.cpp:46
dcodeclassfield.h
ClassifierCodeDocument::declareClassFields
void declareClassFields(CodeClassFieldList &list, CodeGenObjectWithTextBlocks *parent)
Definition: classifiercodedocument.cpp:378
CodeClassField::Aggregation
@ Aggregation
Definition: codeclassfield.h:34
UMLPackageListIt
QListIterator< UMLPackage * > UMLPackageListIt
Definition: umlpackagelist.h:20
CodeClassField::PlainAssociation
@ PlainAssociation
Definition: codeclassfield.h:34
CodeClassField::Attribute
@ Attribute
Definition: codeclassfield.h:34
CodeBlockWithComments::getComment
CodeComment * getComment() const
Definition: codeblockwithcomments.cpp:47
TextBlock::setTag
void setTag(const QString &value)
Definition: textblock.cpp:121
DCodeGenerationPolicy::getAutoGenerateAssocAccessors
bool getAutoGenerateAssocAccessors()
Definition: dcodegenerationpolicy.cpp:82
dcodeoperation.h
CodeClassField
Definition: codeclassfield.h:30
ClassifierCodeDocument::hasObjectVectorClassFields
bool hasObjectVectorClassFields()
Definition: classifiercodedocument.cpp:124
CodeGenPolicyExt
Definition: codegenpolicyext.h:28
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
dcodegenerator.h
DClassifierCodeDocument::updateContent
void updateContent()
Definition: dclassifiercodedocument.cpp:279
CodeBlock
Definition: codeblock.h:21
ClassifierCodeDocument
Definition: classifiercodedocument.h:33
CodeDocument::getPackage
QString getPackage() const
Definition: codedocument.cpp:123
HierarchicalCodeBlock::addCodeClassFieldMethods
void addCodeClassFieldMethods(CodeClassFieldList &list)
Definition: hierarchicalcodeblock.cpp:215
CodeOperation::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeoperation.cpp:83
DClassDeclarationBlock
Definition: dclassdeclarationblock.h:21
dcodeclassfielddeclarationblock.h
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1268
Codegen_Utils::capitalizeFirstLetter
QString capitalizeFirstLetter(const QString &string)
Definition: codegen_utils.cpp:430
DClassifierCodeDocument::forceDoc
bool forceDoc()
Definition: dclassifiercodedocument.cpp:63
ClassifierCodeDocument::hasClassFields
bool hasClassFields()
Definition: classifiercodedocument.cpp:151
UMLOperation::isLifeOperation
bool isLifeOperation()
Definition: operation.cpp:414
DClassifierCodeDocument::operationsBlock
HierarchicalCodeBlock * operationsBlock
Definition: dclassifiercodedocument.h:70
UMLDoc::findObjectById
UMLObject * findObjectById(Uml::ID::Type id)
Definition: umldoc.cpp:1038
ClassifierCodeDocument::findCodeClassFieldTextBlockByTag
TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)
Definition: classifiercodedocument.cpp:771
ClassifierCodeDocument::getSpecificClassFields
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType)
Definition: classifiercodedocument.cpp:54
DClassifierCodeDocument::addOrUpdateCodeClassFieldMethodsInCodeBlock
void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, DClassDeclarationBlock *codeBlock)
HierarchicalCodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: hierarchicalcodeblock.cpp:269
uWarning
#define uWarning()
Definition: debug_utils.h:124
DCodeGenerationPolicy::getAutoGenerateAttribAccessors
bool getAutoGenerateAttribAccessors()
Definition: dcodegenerationpolicy.cpp:73
classifiercodedocument.h
ClassifierCodeDocument::synchronize
virtual void synchronize()
Definition: classifiercodedocument.cpp:480
CodeBlockWithComments::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblockwithcomments.cpp:97
DClassDeclarationBlock::updateContent
void updateContent()
Definition: dclassdeclarationblock.cpp:50
codegenerationpolicy.h
CodeGenerationPolicy
Definition: codegenerationpolicy.h:30
uDebug
#define uDebug()
Definition: debug_utils.h:122
CodeGenerationPolicy::getCodeVerboseDocumentComments
bool getCodeVerboseDocumentComments() const
Definition: codegenerationpolicy.cpp:152
HierarchicalCodeBlock::addTextBlock
bool addTextBlock(TextBlock *add_object)
Definition: hierarchicalcodeblock.cpp:93
CodeClassField::setWriteOutMethods
void setWriteOutMethods(bool val)
Definition: codeclassfield.cpp:211
ClassifierCodeDocument::getCodeClassFieldList
CodeClassFieldList * getCodeClassFieldList()
Definition: classifiercodedocument.cpp:266
dclassifiercodedocument.h
CodeBlockWithComments
Definition: codeblockwithcomments.h:24
DClassifierCodeDocument::classDeclCodeBlock
DClassDeclarationBlock * classDeclCodeBlock
Definition: dclassifiercodedocument.h:68
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
DClassifierCodeDocument::constructorBlock
HierarchicalCodeBlock * constructorBlock
Definition: dclassifiercodedocument.h:69
DClassifierCodeDocument::getClassDecl
DClassDeclarationBlock * getClassDecl()
Definition: dclassifiercodedocument.cpp:247
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17
CodeDocument::newCodeBlock
virtual CodeBlock * newCodeBlock()
Definition: codedocument.cpp:460
CodeBlock::contentType
ContentType contentType() const
Definition: codeblock.cpp:54
CodeBlock::AutoGenerated
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
CodeGenObjectWithTextBlocks::getHierarchicalCodeBlock
virtual HierarchicalCodeBlock * getHierarchicalCodeBlock(const QString &tag, const QString &comment, int indentLevel)
Definition: codegenobjectwithtextblocks.cpp:177
DClassifierCodeDocument::init
void init()
Definition: dclassifiercodedocument.cpp:93
ClassifierCodeDocument::getParentClassifier
UMLClassifier * getParentClassifier()
Definition: classifiercodedocument.cpp:275
HierarchicalCodeBlock
Definition: hierarchicalcodeblock.h:23
DClassifierCodeDocument::loadChildTextBlocksFromNode
virtual void loadChildTextBlocksFromNode(QDomElement &root)
Definition: dclassifiercodedocument.cpp:133
classifier.h
CodeOperation::getParentOperation
UMLOperation * getParentOperation()
Definition: codeoperation.cpp:64
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:25
CodeOperation
Definition: codeoperation.h:24
CodeDocument::getFileName
QString getFileName() const
Definition: codedocument.cpp:63
UMLApp::policyExt
CodeGenPolicyExt * policyExt() const
Definition: uml.cpp:2299
uml.h
DClassDeclarationBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: dclassdeclarationblock.cpp:31
CodeGenerationPolicy::getNewLineEndingChars
QString getNewLineEndingChars() const
Definition: codegenerationpolicy.cpp:253
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
CodeDocument::newCodeBlockWithComments
virtual CodeBlockWithComments * newCodeBlockWithComments()
Definition: codedocument.cpp:469
UMLObject::isUMLDatatype
bool isUMLDatatype()
Definition: umlobject.h:206
CodeComment::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codecomment.cpp:42
DCodeGenerationPolicy
Definition: dcodegenerationpolicy.h:23
CodeClassFieldList
QList< CodeClassField * > CodeClassFieldList
Definition: codeclassfieldlist.h:17
TextBlock
Definition: textblock.h:25
ClassifierCodeDocument::parentIsClass
bool parentIsClass()
Definition: classifiercodedocument.cpp:410
DClassifierCodeDocument::resetTextBlocks
void resetTextBlocks()
Definition: dclassifiercodedocument.cpp:261
CodeGenerationPolicy::getAutoGenerateConstructors
bool getAutoGenerateConstructors()
Definition: codegenerationpolicy.cpp:365
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
DClassifierCodeDocument::getDClassName
QString getDClassName(const QString &name)
Definition: dclassifiercodedocument.cpp:87
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
codegen_utils.h
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33