umbrello: umbrello/codegenerators/ruby/rubyclassifiercodedocument.h Source File

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

rubyclassifiercodedocument.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) 2005 *
8 * Richard Dale <Richard_Dale@tipitina.demon.co.uk> *
9 * copyright (C) 2006-2020 *
10 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
11 ***************************************************************************/
12
13 #ifndef RUBYCLASSIFIERCODEDOCUMENT_H
14 #define RUBYCLASSIFIERCODEDOCUMENT_H
15
16 #include "codeclassfieldlist.h"
17 #include "classifiercodedocument.h"
18 #include "classifier.h"
19 #include "hierarchicalcodeblock.h"
20 #include "rubycodeclassfield.h"
21 #include "rubycodeoperation.h"
22
23 #include <QString>
24
25 class RubyClassDeclarationBlock;
26 class RubyCodeGenerationPolicy;
27
36 class RubyClassifierCodeDocument : public ClassifierCodeDocument
37 {
38 Q_OBJECT
39 public:
40
41 explicit RubyClassifierCodeDocument(UMLClassifier * classifier);
42 virtual ~RubyClassifierCodeDocument();
43
44 //CodeDocumentDialog getDialog();
45
46 RubyCodeGenerationPolicy * getRubyPolicy();
47
48 QString getRubyClassName(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, RubyClassDeclarationBlock * codeBlock);
63
64 bool forceDoc();
65
66 private:
67
68 RubyClassDeclarationBlock * classDeclCodeBlock;
69 HierarchicalCodeBlock * constructorBlock;
70 HierarchicalCodeBlock * operationsBlock;
71
72 HierarchicalCodeBlock * publicBlock;
73 HierarchicalCodeBlock * privateBlock;
74 HierarchicalCodeBlock * protectedBlock;
75
76 // HierarchicalCodeBlock * namespaceBlock;
77
78 HierarchicalCodeBlock * pubConstructorBlock;
79 HierarchicalCodeBlock * protConstructorBlock;
80 HierarchicalCodeBlock * privConstructorBlock;
81
82 HierarchicalCodeBlock * pubOperationsBlock;
83 HierarchicalCodeBlock * privOperationsBlock;
84 HierarchicalCodeBlock * protOperationsBlock;
85
86 void init();
87 RubyClassDeclarationBlock * getClassDecl();
88
89 };
90
91 #endif // RUBYCLASSIFIERCODEDOCUMENT_H
CodeClassField::Composition
@ Composition
Definition: codeclassfield.h:34
rubyclassdeclarationblock.h
RubyClassifierCodeDocument::resetTextBlocks
void resetTextBlocks()
Definition: rubyclassifiercodedocument.cpp:295
RubyClassifierCodeDocument::privateBlock
HierarchicalCodeBlock * privateBlock
Definition: rubyclassifiercodedocument.h:73
RubyCodeOperation
Definition: rubycodeoperation.h:23
RubyClassifierCodeDocument::protectedBlock
HierarchicalCodeBlock * protectedBlock
Definition: rubyclassifiercodedocument.h:74
ClassifierCodeDocument::parentIsInterface
bool parentIsInterface()
Definition: classifiercodedocument.cpp:418
rubycodeclassfield.h
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
CodeDocument::resetTextBlocks
void resetTextBlocks()
Definition: codedocument.cpp:338
RubyClassifierCodeDocument::pubOperationsBlock
HierarchicalCodeBlock * pubOperationsBlock
Definition: rubyclassifiercodedocument.h:82
RubyClassifierCodeDocument::protConstructorBlock
HierarchicalCodeBlock * protConstructorBlock
Definition: rubyclassifiercodedocument.h:79
CodeDocument::newHierarchicalCodeBlock
virtual HierarchicalCodeBlock * newHierarchicalCodeBlock()
Definition: codedocument.cpp:478
CodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblock.cpp:91
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1323
HierarchicalCodeBlock::setStartText
void setStartText(const QString &text)
Definition: hierarchicalcodeblock.cpp:199
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
rubycodeoperation.h
UMLOperation::isConstructorOperation
bool isConstructorOperation()
Definition: operation.cpp:369
RubyClassifierCodeDocument::addCodeOperation
bool addCodeOperation(CodeOperation *op)
Definition: rubyclassifiercodedocument.cpp:124
CodeComment
Definition: codecomment.h:24
TextBlock::setWriteOutText
void setWriteOutText(bool write)
Definition: textblock.cpp:131
RubyClassDeclarationBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: rubyclassdeclarationblock.cpp:44
CodeDocument::setFileExtension
void setFileExtension(const QString &new_var)
Definition: codedocument.cpp:72
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2274
RubyClassifierCodeDocument::getRubyPolicy
RubyCodeGenerationPolicy * getRubyPolicy()
Definition: rubyclassifiercodedocument.cpp:49
CodeGenObjectWithTextBlocks::addTextBlock
virtual bool addTextBlock(TextBlock *add_object)
Definition: codegenobjectwithtextblocks.cpp:57
RubyClassifierCodeDocument::constructorBlock
HierarchicalCodeBlock * constructorBlock
Definition: rubyclassifiercodedocument.h:69
CodeClassField::Aggregation
@ Aggregation
Definition: codeclassfield.h:34
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
CodeClassField
Definition: codeclassfield.h:30
RubyClassifierCodeDocument::RubyClassifierCodeDocument
RubyClassifierCodeDocument(UMLClassifier *classifier)
Definition: rubyclassifiercodedocument.cpp:33
RubyClassifierCodeDocument::publicBlock
HierarchicalCodeBlock * publicBlock
Definition: rubyclassifiercodedocument.h:72
CodeGenPolicyExt
Definition: codegenpolicyext.h:28
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
RubyClassifierCodeDocument::privConstructorBlock
HierarchicalCodeBlock * privConstructorBlock
Definition: rubyclassifiercodedocument.h:80
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
rubyclassifiercodedocument.h
rubycodecomment.h
Uml::Visibility::Public
@ Public
Definition: basictypes.h:77
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1285
Codegen_Utils::capitalizeFirstLetter
QString capitalizeFirstLetter(const QString &string)
Definition: codegen_utils.cpp:438
RubyClassifierCodeDocument::addOrUpdateCodeClassFieldMethodsInCodeBlock
void addOrUpdateCodeClassFieldMethodsInCodeBlock(CodeClassFieldList &list, RubyClassDeclarationBlock *codeBlock)
ClassifierCodeDocument::hasClassFields
bool hasClassFields()
Definition: classifiercodedocument.cpp:151
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
UMLDoc::findObjectById
UMLObject * findObjectById(Uml::ID::Type id)
Definition: umldoc.cpp:1036
ClassifierCodeDocument::findCodeClassFieldTextBlockByTag
TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)
Definition: classifiercodedocument.cpp:771
ClassifierCodeDocument::getSpecificClassFields
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType)
Definition: classifiercodedocument.cpp:54
RubyClassifierCodeDocument::classDeclCodeBlock
RubyClassDeclarationBlock * classDeclCodeBlock
Definition: rubyclassifiercodedocument.h:68
HierarchicalCodeBlock::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: hierarchicalcodeblock.cpp:269
RubyClassifierCodeDocument::~RubyClassifierCodeDocument
virtual ~RubyClassifierCodeDocument()
Definition: rubyclassifiercodedocument.cpp:42
uWarning
#define uWarning()
Definition: debug_utils.h:124
RubyClassifierCodeDocument::operationsBlock
HierarchicalCodeBlock * operationsBlock
Definition: rubyclassifiercodedocument.h:70
UMLApp::generator
CodeGenerator * generator() const
Definition: uml.cpp:2337
classifiercodedocument.h
ClassifierCodeDocument::synchronize
virtual void synchronize()
Definition: classifiercodedocument.cpp:480
CodeBlockWithComments::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codeblockwithcomments.cpp:97
CodeGenerationPolicy
Definition: codegenerationpolicy.h:30
uDebug
#define uDebug()
Definition: debug_utils.h:122
CodeGenerationPolicy::getCodeVerboseDocumentComments
bool getCodeVerboseDocumentComments() const
Definition: codegenerationpolicy.cpp:152
RubyClassifierCodeDocument::init
void init()
Definition: rubyclassifiercodedocument.cpp:94
HierarchicalCodeBlock::addTextBlock
bool addTextBlock(TextBlock *add_object)
Definition: hierarchicalcodeblock.cpp:93
RubyClassifierCodeDocument::getRubyClassName
QString getRubyClassName(const QString &name)
Definition: rubyclassifiercodedocument.cpp:87
CodeClassField::setWriteOutMethods
void setWriteOutMethods(bool val)
Definition: codeclassfield.cpp:211
RubyClassDeclarationBlock::updateContent
void updateContent()
Definition: rubyclassdeclarationblock.cpp:52
ClassifierCodeDocument::getCodeClassFieldList
CodeClassFieldList * getCodeClassFieldList()
Definition: classifiercodedocument.cpp:266
CodeBlockWithComments
Definition: codeblockwithcomments.h:24
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
RubyClassifierCodeDocument::loadChildTextBlocksFromNode
virtual void loadChildTextBlocksFromNode(QDomElement &root)
Definition: rubyclassifiercodedocument.cpp:166
CodeDocument::newCodeBlock
virtual CodeBlock * newCodeBlock()
Definition: codedocument.cpp:460
UniqueID::gen
Uml::ID::Type gen()
Definition: uniqueid.cpp:34
CodeGenObjectWithTextBlocks::getHierarchicalCodeBlock
virtual HierarchicalCodeBlock * getHierarchicalCodeBlock(const QString &tag, const QString &comment, int indentLevel)
Definition: codegenobjectwithtextblocks.cpp:177
RubyClassifierCodeDocument::forceDoc
bool forceDoc()
Uml::Visibility::Enum
Enum
Definition: basictypes.h:76
RubyCodeGenerationPolicy
Definition: rubycodegenerationpolicy.h:24
ClassifierCodeDocument::getParentClassifier
UMLClassifier * getParentClassifier()
Definition: classifiercodedocument.cpp:275
HierarchicalCodeBlock
Definition: hierarchicalcodeblock.h:23
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:2290
uml.h
RubyClassifierCodeDocument::getClassDecl
RubyClassDeclarationBlock * getClassDecl()
Definition: rubyclassifiercodedocument.cpp:281
RubyClassifierCodeDocument::pubConstructorBlock
HierarchicalCodeBlock * pubConstructorBlock
Definition: rubyclassifiercodedocument.h:78
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
RubyClassifierCodeDocument
Definition: rubyclassifiercodedocument.h:37
CodeComment::loadFromXMI1
virtual void loadFromXMI1(QDomElement &root)
Definition: codecomment.cpp:42
RubyCodeGenerator
Definition: rubycodegenerator.h:28
CodeClassFieldList
QList< CodeClassField * > CodeClassFieldList
Definition: codeclassfieldlist.h:17
TextBlock
Definition: textblock.h:25
CodeGenerator
Definition: codegenerator.h:57
RubyClassifierCodeDocument::protOperationsBlock
HierarchicalCodeBlock * protOperationsBlock
Definition: rubyclassifiercodedocument.h:84
Uml::Visibility::Private
@ Private
Definition: basictypes.h:78
rubycodeclassfielddeclarationblock.h
RubyClassDeclarationBlock
Definition: rubyclassdeclarationblock.h:22
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:79
CodeGenerationPolicy::getAutoGenerateConstructors
bool getAutoGenerateConstructors()
Definition: codegenerationpolicy.cpp:365
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
rubycodegenerator.h
RubyCodeComment
Definition: rubycodecomment.h:28
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
RubyClassifierCodeDocument::updateContent
void updateContent()
Definition: rubyclassifiercodedocument.cpp:313
codegen_utils.h
RubyClassifierCodeDocument::privOperationsBlock
HierarchicalCodeBlock * privOperationsBlock
Definition: rubyclassifiercodedocument.h:83
RubyClassifierCodeDocument::getPath
QString getPath()
Definition: rubyclassifiercodedocument.cpp:69