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

tclwriter.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 Rene Meyer <rene.meyer@sturmit.de> *
8 * copyright (C) 2006-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef TCLWRITER_H
13 #define TCLWRITER_H
14
15 #include "simplecodegenerator.h"
16 #include "umloperationlist.h"
17 #include "umlattributelist.h"
18 #include "umlassociationlist.h"
19
20 #include <QStringList>
21
22 class QFile;
23 class QTextStream;
24
31 class TclWriter : public SimpleCodeGenerator
32 {
33 public:
34
35 TclWriter();
36 virtual ~TclWriter();
37
38 virtual void writeClass(UMLClassifier * c);
39
40 virtual Uml::ProgrammingLanguage::Enum language() const;
41
42 virtual QStringList reservedKeywords() const;
43
44 private:
45
46 void writeHeaderFile(UMLClassifier * c, QFile & file);
47 void writeSourceFile(UMLClassifier * c, QFile & file);
48
49 void writeCode(const QString &text);
50 void writeComm(const QString &text);
51 void writeDocu(const QString &text);
52
53 void writeConstructorDecl();
54 void writeDestructorDecl();
55
56 void writeAttributeDecl(UMLClassifier * c, Uml::Visibility::Enum visibility, bool writeStatic);
57
58 void writeAssociationIncl(UMLAssociationList list,
59 Uml::ID::Type myId, const QString &type);
60 void writeAssociationDecl(UMLAssociationList associations,
61 Uml::Visibility::Enum permit, Uml::ID::Type id,
62 const QString &type);
63
64 void writeAssociationRoleDecl(const QString &fieldClassName,
65 const QString &roleName, const QString &multi,
66 const QString &doc, const QString &docname);
67
68 void writeInitAttributeHeader(UMLClassifier * c);
69 void writeInitAttributeSource(UMLClassifier* c);
70
71 void writeConstructorHeader();
72 void writeConstructorSource(UMLClassifier * c);
73
74 void writeDestructorHeader();
75 void writeDestructorSource();
76
77 void writeOperationHeader(UMLClassifier * c,
78 Uml::Visibility::Enum permitScope);
79 void writeOperationSource(UMLClassifier * c,
80 Uml::Visibility::Enum permitScope);
81
82 void writeAttributeSource(UMLClassifier * c);
83
84 void writeAssociationSource(UMLAssociationList associations,
85 Uml::ID::Type id);
86 void writeAssociationRoleSource(const QString &fieldClassName,
87 const QString &roleName,
88 const QString &multi);
89
90 void writeUse(UMLClassifier * c);
91
92 QString getUMLObjectName(UMLObject * obj);
93
94 QString fixTypeName(const QString &string);
95
96 QTextStream* mStream;
97 QString mNamespace;
98 QString mClassGlobal;
99 QStringList ObjectFieldVariables;
100 QStringList VectorFieldVariables;
101
102 };
103
104 #endif // TCLWRITER_H
UMLObject::package
QString package(const QString &separator=QString(), bool includeRoot=false)
Definition: umlobject.cpp:578
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
umlattributelist.h
TclWriter::writeDestructorDecl
void writeDestructorDecl()
template.h
TclWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(const QString &fieldClassName, const QString &roleName, const QString &multi, const QString &doc, const QString &docname)
Definition: tclwriter.cpp:582
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
TclWriter::writeConstructorHeader
void writeConstructorHeader()
Definition: tclwriter.cpp:461
TclWriter::writeAttributeSource
void writeAttributeSource(UMLClassifier *c)
Definition: tclwriter.cpp:819
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
UMLClassifier::isInterface
bool isInterface() const
Definition: classifier.cpp:118
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
reserved_words
static const char * reserved_words[]
Definition: tclwriter.cpp:33
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
TclWriter::writeDestructorHeader
void writeDestructorHeader()
Definition: tclwriter.cpp:481
umloperationlist.h
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Definition: codegenerator.cpp:407
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
tclwriter.h
UMLTemplate::getTypeName
virtual QString getTypeName() const
Definition: template.cpp:80
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Definition: codegenerator.cpp:549
TclWriter::writeHeaderFile
void writeHeaderFile(UMLClassifier *c, QFile &file)
Definition: tclwriter.cpp:165
TclWriter::writeAssociationRoleSource
void writeAssociationRoleSource(const QString &fieldClassName, const QString &roleName, const QString &multi)
Definition: tclwriter.cpp:870
UMLClassifier::getFilteredList
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Definition: classifier.cpp:998
TclWriter::writeAssociationDecl
void writeAssociationDecl(UMLAssociationList associations, Uml::Visibility::Enum permit, Uml::ID::Type id, const QString &type)
Definition: tclwriter.cpp:537
operation.h
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
Uml::ProgrammingLanguage::Tcl
@ Tcl
Definition: basictypes.h:289
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Definition: classifierlistitem.cpp:112
TclWriter::writeDestructorSource
void writeDestructorSource()
Definition: tclwriter.cpp:487
Uml::RoleType::A
@ A
Definition: basictypes.h:239
TclWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: tclwriter.cpp:96
association.h
SimpleCodeGenerator::fileName_
QString fileName_
Definition: simplecodegenerator.h:52
UMLObject::isStatic
bool isStatic() const
Definition: umlobject.cpp:366
UMLClassifier::getTemplateList
UMLTemplateList getTemplateList() const
Definition: classifier.cpp:1148
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
model_utils.h
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:76
UMLObject::isAbstract
bool isAbstract() const
Definition: umlobject.cpp:348
SimpleCodeGenerator::m_indentLevel
int m_indentLevel
Definition: simplecodegenerator.h:77
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
TclWriter::writeConstructorDecl
void writeConstructorDecl()
TclWriter::~TclWriter
virtual ~TclWriter()
Definition: tclwriter.cpp:88
UMLObject::ot_EnumLiteral
@ ot_EnumLiteral
Definition: umlobject.h:94
CodeGenerator::formatSourceCode
static QString formatSourceCode(const QString &code, const QString &indentation)
Definition: codegenerator.cpp:743
UMLClassifier::getAttributeListStatic
UMLAttributeList getAttributeListStatic(Uml::Visibility::Enum scope) const
Definition: classifier.cpp:487
umlclassifierlistitemlist.h
TclWriter::writeConstructorSource
void writeConstructorSource(UMLClassifier *c)
Definition: tclwriter.cpp:468
Uml::Visibility::Public
@ Public
Definition: basictypes.h:60
TclWriter::writeInitAttributeSource
void writeInitAttributeSource(UMLClassifier *c)
Definition: tclwriter.cpp:636
UMLClassifier::hasAssociations
bool hasAssociations()
Definition: classifier.cpp:1255
SimpleCodeGenerator::hasAbstractOps
bool hasAbstractOps(UMLClassifier *c)
Definition: simplecodegenerator.cpp:270
classifierlistitem.h
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
Definition: moc_codegenerator.cpp:161
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
TclWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: tclwriter.cpp:937
UMLCanvasObject::getSpecificAssocs
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Definition: umlcanvasobject.cpp:61
SimpleCodeGenerator::className_
QString className_
Definition: simplecodegenerator.h:51
a
QString a
Definition: petalnode.cpp:18
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:78
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Definition: basictypes.cpp:107
TclWriter::writeAssociationIncl
void writeAssociationIncl(UMLAssociationList list, Uml::ID::Type myId, const QString &type)
Definition: tclwriter.cpp:406
UMLClassifier::hasAttributes
bool hasAttributes()
Definition: classifier.cpp:1266
Uml::AssociationType::Association
@ Association
Definition: basictypes.h:110
TclWriter::writeUse
void writeUse(UMLClassifier *c)
Definition: tclwriter.cpp:438
uDebug
#define uDebug()
Definition: debug_utils.h:122
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
TclWriter::writeOperationHeader
void writeOperationHeader(UMLClassifier *c, Uml::Visibility::Enum permitScope)
Definition: tclwriter.cpp:678
Uml::RoleType::B
@ B
Definition: basictypes.h:240
TclWriter::writeInitAttributeHeader
void writeInitAttributeHeader(UMLClassifier *c)
Definition: tclwriter.cpp:624
TclWriter::mStream
QTextStream * mStream
current output stream
Definition: tclwriter.h:96
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
visibility
Definition: visibility.py:1
TclWriter::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition: tclwriter.cpp:928
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:436
TclWriter::mNamespace
QString mNamespace
namespace information
Definition: tclwriter.h:97
TclWriter::writeComm
void writeComm(const QString &text)
Definition: tclwriter.cpp:383
TclWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: tclwriter.cpp:105
TclWriter::ObjectFieldVariables
QStringList ObjectFieldVariables
Definition: tclwriter.h:99
TclWriter::writeAttributeDecl
void writeAttributeDecl(UMLClassifier *c, Uml::Visibility::Enum visibility, bool writeStatic)
Definition: tclwriter.cpp:499
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
UMLClassifierListItemList
Definition: umlclassifierlistitemlist.h:27
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
Definition: moc_codegenerator.cpp:154
classifier.h
UMLOperation
Definition: operation.h:25
UMLObject::ot_Enum
@ ot_Enum
Definition: umlobject.h:88
TclWriter::VectorFieldVariables
QStringList VectorFieldVariables
Definition: tclwriter.h:100
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
umlassociationlist.h
UMLAssociation
Sets up association information.
Definition: association.h:33
TclWriter::writeOperationSource
void writeOperationSource(UMLClassifier *c, Uml::Visibility::Enum permitScope)
Definition: tclwriter.cpp:753
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
TclWriter::TclWriter
TclWriter()
Definition: tclwriter.cpp:80
TclWriter::writeDocu
void writeDocu(const QString &text)
Definition: tclwriter.cpp:394
TclWriter::writeSourceFile
void writeSourceFile(UMLClassifier *c, QFile &file)
Definition: tclwriter.cpp:334
TclWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition: tclwriter.cpp:917
UMLTemplateList
QList< UMLTemplate * > UMLTemplateList
Definition: umltemplatelist.h:18
UMLTemplate
Sets up template information.
Definition: template.h:27
simplecodegenerator.h
Uml::Visibility::Private
@ Private
Definition: basictypes.h:61
TclWriter::writeCode
void writeCode(const QString &text)
Definition: tclwriter.cpp:375
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:775
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:62
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
umltemplatelist.h
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Definition: simplecodegenerator.cpp:91
codegen_utils.h
umldoc.h
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Definition: codegenerator.cpp:523
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:507
TclWriter::writeAssociationSource
void writeAssociationSource(UMLAssociationList associations, Uml::ID::Type id)
Definition: tclwriter.cpp:831
TclWriter::mClassGlobal
QString mClassGlobal
information about current classifier
Definition: tclwriter.h:98
TclWriter
Definition: tclwriter.h:32