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

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

dwriter.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2007 Jari-Matti Mäkelä <jmjm@iki.fi>
5 SPDX-FileCopyrightText: 2008-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef DWRITER_H
9#define DWRITER_H
10
11#include "simplecodegenerator.h"
12#include "umloperationlist.h"
13#include "umlattributelist.h"
14#include "umlassociationlist.h"
15
16 class UMLOperation;
17
28 class DWriter : public SimpleCodeGenerator
29{
30 public:
31
32 DWriter();
33 virtual ~DWriter();
34
35 virtual void writeClass(UMLClassifier *c);
36
37 virtual Uml::ProgrammingLanguage::Enum language() const;
38
39 QStringList defaultDatatypes() const;
40
41 private:
42
46 void writeModuleDecl(UMLClassifier *c, QTextStream &d);
47
51 void writeModuleImports(UMLClassifier *c, QTextStream &d);
52
57 void writeClassDecl(UMLClassifier *c, QTextStream &d);
58
62 void writeConstructor(UMLClassifier *c, QTextStream &d);
63
69 static bool compareDMethod(UMLOperation *op1, UMLOperation *op2);
70
76 static bool dMethodInList(UMLOperation *umlOp, UMLOperationList &opl);
77
86 void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList,
87 UMLOperationList &toBeImplementedOpList, bool noClassInPath = true);
88
94 void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl);
95
101 void writeOperations(UMLClassifier *c, QTextStream &j);
102
108 void writeOperations(UMLOperationList &list, QTextStream &j);
109
115 void writeAttributes(UMLClassifier *c, QTextStream &j);
116
122 void writeProtectionMod(Uml::Visibility::Enum visibility, QTextStream &d);
123
131 void writeAttributeDecl(Uml::Visibility::Enum visibility, UMLAttributeList &atlist, QTextStream &d);
132
140 void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot,
141 UMLAttributeList &atpriv, QTextStream &d);
142
146 void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &d);
147
151 void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi,
152 QString doc, Uml::Visibility::Enum visib, QTextStream &d);
153
157 void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &d);
158
162 void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass,
163 QTextStream &d);
164
170 void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi,
171 QString description, Uml::Visibility::Enum visib, Uml::Changeability::Enum change,
172 QTextStream &d);
173
177 void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
178 QString fieldName, QString description,
179 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
180 bool isFinal, QTextStream &d);
181
185 void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
186 QString fieldName, QString description,
187 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
188 QTextStream &d);
189
193 void writeComment(const QString &text, const QString &indent, QTextStream &d, bool dDocStyle=false);
194
198 void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &d);
199
203 QString getUMLObjectName(UMLObject *obj);
204
208 QString deCapitaliseFirstLetter(const QString& str);
209
213 QString pluralize(const QString& string);
214
218 QString unPluralize(const QString& str);
219
223 QString fixTypeName(const QString& string);
224
228 QString fixInitialStringDeclValue(const QString& val, const QString& type);
229
233 void writeBlankLine(QTextStream& d);
234
235 QString startline;
236 bool isInterface;
237
238};
239
240#endif // DWRITER_H
DWriter
Definition dwriter.h:29
DWriter::writeComment
void writeComment(const QString &text, const QString &indent, QTextStream &d, bool dDocStyle=false)
Definition dwriter.cpp:436
DWriter::writeProtectionMod
void writeProtectionMod(Uml::Visibility::Enum visibility, QTextStream &d)
Definition dwriter.cpp:372
DWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &j)
Definition dwriter.cpp:826
DWriter::writeAttributeDecl
void writeAttributeDecl(Uml::Visibility::Enum visibility, UMLAttributeList &atlist, QTextStream &d)
Definition dwriter.cpp:377
DWriter::isInterface
bool isInterface
whether or not this concept is an interface
Definition dwriter.h:236
DWriter::writeClassDecl
void writeClassDecl(UMLClassifier *c, QTextStream &d)
Definition dwriter.cpp:280
DWriter::writeConstructor
void writeConstructor(UMLClassifier *c, QTextStream &d)
Definition dwriter.cpp:690
DWriter::writeAssociationRoleMethod
void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi, QString description, Uml::Visibility::Enum visib, Uml::Changeability::Enum change, QTextStream &d)
Definition dwriter.cpp:593
DWriter::fixInitialStringDeclValue
QString fixInitialStringDeclValue(const QString &val, const QString &type)
Definition dwriter.cpp:941
DWriter::deCapitaliseFirstLetter
QString deCapitaliseFirstLetter(const QString &str)
Definition dwriter.cpp:960
DWriter::writeAttributeDecls
void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, UMLAttributeList &atpriv, QTextStream &d)
Definition dwriter.cpp:413
DWriter::defaultDatatypes
QStringList defaultDatatypes() const
Definition dwriter.cpp:729
DWriter::writeModuleDecl
void writeModuleDecl(UMLClassifier *c, QTextStream &d)
Definition dwriter.cpp:54
DWriter::writeDocumentation
void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &d)
Definition dwriter.cpp:469
DWriter::writeAssociationDecls
void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &d)
Definition dwriter.cpp:486
DWriter::writeBlankLine
void writeBlankLine(QTextStream &d)
Definition dwriter.cpp:987
DWriter::startline
QString startline
a , used at the end of each line
Definition dwriter.h:235
DWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition dwriter.cpp:709
DWriter::writeSingleAttributeAccessorMethods
void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, QString fieldName, QString description, Uml::Visibility::Enum visibility, Uml::Changeability::Enum change, bool isFinal, QTextStream &d)
Definition dwriter.cpp:660
DWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition dwriter.cpp:48
DWriter::getSuperImplementedOperations
void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath=true)
Definition dwriter.cpp:793
DWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition dwriter.cpp:98
DWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, QString doc, Uml::Visibility::Enum visib, QTextStream &d)
Definition dwriter.cpp:521
DWriter::~DWriter
virtual ~DWriter()
Definition dwriter.cpp:40
DWriter::unPluralize
QString unPluralize(const QString &str)
Definition dwriter.cpp:972
DWriter::writeAssociationMethods
void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &d)
Definition dwriter.cpp:559
DWriter::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition dwriter.cpp:955
DWriter::writeModuleImports
void writeModuleImports(UMLClassifier *c, QTextStream &d)
Definition dwriter.cpp:62
DWriter::writeAttributes
void writeAttributes(UMLClassifier *c, QTextStream &j)
DWriter::DWriter
DWriter()
Definition dwriter.cpp:31
DWriter::dMethodInList
static bool dMethodInList(UMLOperation *umlOp, UMLOperationList &opl)
Definition dwriter.cpp:783
DWriter::compareDMethod
static bool compareDMethod(UMLOperation *op1, UMLOperation *op2)
Definition dwriter.cpp:761
DWriter::writeAttributeMethods
void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &d)
Definition dwriter.cpp:422
DWriter::getInterfacesOperationsToBeImplemented
void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl)
Definition dwriter.cpp:814
DWriter::pluralize
QString pluralize(const QString &string)
Definition dwriter.cpp:967
DWriter::writeVectorAttributeAccessorMethods
void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, QString fieldName, QString description, Uml::Visibility::Enum visibility, Uml::Changeability::Enum change, QTextStream &d)
Definition dwriter.cpp:610
SimpleCodeGenerator
Definition simplecodegenerator.h:30
SimpleCodeGenerator::indent
QString indent()
Definition simplecodegenerator.cpp:69
UMLAttributeList
Definition umlattributelist.h:21
UMLClassifier
Information for a non-graphical Concept/Class.
Definition classifier.h:35
UMLObject
The base class for UML objects.
Definition umlobject.h:70
UMLOperation
Definition operation.h:20
description
static const char description[]
Definition main.cpp:32
Uml::Changeability::Enum
Enum
Definition basictypes.h:202
Uml::ID::Type
std::string Type
Definition basictypes.h:371
Uml::ProgrammingLanguage::Enum
Enum
Definition basictypes.h:291
Uml::Visibility::Enum
Enum
Definition basictypes.h:45
visibility
Definition visibility.py:1
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition umlassociationlist.h:14
umlattributelist.h
umloperationlist.h
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition umloperationlist.h:14