umbrello: umbrello/codegenerators/vala/valawriter.h Source File

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

valawriter.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) 2009-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 //
12 // C++ Interface: valawriter
13 //
14
15 #ifndef VALAWRITER_H
16 #define VALAWRITER_H
17
18 #include "classifierlistitem.h"
19 #include "simplecodegenerator.h"
20 #include "umlassociationlist.h"
21 #include "umlattributelist.h"
22 #include "umloperationlist.h"
23
28 class ValaWriter : public SimpleCodeGenerator
29 {
30 Q_OBJECT
31 public:
32 ValaWriter();
33 virtual ~ValaWriter();
34
35 virtual void writeClass(UMLClassifier *c);
36
37 virtual Uml::ProgrammingLanguage::Enum language() const;
38
39 virtual QStringList reservedKeywords() const;
40
41 QStringList defaultDatatypes();
42
43 private:
44
46 QString m_container_indent;
47
49 UMLPackageList m_seenIncludes;
50
52 int m_unnamedRoles;
53
54 void writeRealizationsRecursive(UMLClassifier *currentClass,
55 UMLAssociationList *realizations,
56 QTextStream &cs);
57
58 void writeOperations(UMLClassifier *c, QTextStream &cs);
59 void writeOperations(UMLOperationList opList,
60 QTextStream &cs,
61 bool interface = false,
62 bool isOverride = false,
63 bool generateErrorStub = false);
64
65 void writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs);
66
67 void writeAttributes(UMLClassifier *c, QTextStream &cs);
68 void writeAttributes(UMLAttributeList &atList, QTextStream &cs);
69
70 void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs);
71
72 void writeAttribute(const QString& doc,
73 Uml::Visibility::Enum visibility,
74 bool isStatic,
75 const QString& typeName,
76 const QString& name,
77 const QString& initialValue,
78 bool asProperty,
79 QTextStream &cs);
80
81 QString makeLocalTypeName(UMLClassifierListItem *cl);
82
83 };
84
85 #endif
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
UMLAttributeList
Definition: umlattributelist.h:27
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
ValaWriter
Definition: valawriter.h:29
ValaWriter::writeAttributes
void writeAttributes(UMLClassifier *c, QTextStream &cs)
Definition: valawriter.cpp:639
ValaWriter::m_unnamedRoles
int m_unnamedRoles
Counts associations without a role name for giving a default name.
Definition: valawriter.h:52
ValaWriter::writeAttribute
void writeAttribute(const QString &doc, Uml::Visibility::Enum visibility, bool isStatic, const QString &typeName, const QString &name, const QString &initialValue, bool asProperty, QTextStream &cs)
Definition: valawriter.cpp:759
ValaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: valawriter.cpp:840
ValaWriter::defaultDatatypes
QStringList defaultDatatypes()
Definition: valawriter.cpp:128
ValaWriter::writeRealizationsRecursive
void writeRealizationsRecursive(UMLClassifier *currentClass, UMLAssociationList *realizations, QTextStream &cs)
Definition: valawriter.cpp:475
ValaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: valawriter.cpp:184
ValaWriter::writeAssociatedAttributes
void writeAssociatedAttributes(UMLAssociationList &associated, UMLClassifier *c, QTextStream &cs)
Definition: valawriter.cpp:715
ValaWriter::m_seenIncludes
UMLPackageList m_seenIncludes
Collection of included namespaces, to skip them from variable types.
Definition: valawriter.h:49
ValaWriter::writeOverridesRecursive
void writeOverridesRecursive(UMLClassifierList *superclasses, QTextStream &cs)
Definition: valawriter.cpp:438
ValaWriter::makeLocalTypeName
QString makeLocalTypeName(UMLClassifierListItem *cl)
Definition: valawriter.cpp:824
ValaWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: valawriter.cpp:849
ValaWriter::ValaWriter
ValaWriter()
Definition: valawriter.cpp:111
ValaWriter::~ValaWriter
virtual ~ValaWriter()
Definition: valawriter.cpp:120
ValaWriter::m_container_indent
QString m_container_indent
Adds extra indenting if the class is in a container (namespace).
Definition: valawriter.h:46
ValaWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &cs)
Definition: valawriter.cpp:370
classifierlistitem.h
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
visibility
Definition: visibility.py:1
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
umlattributelist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
umloperationlist.h
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17