umbrello: umbrello/codegenerators/python/pythonwriter.h Source File

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

pythonwriter.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) 2002 Vincent Decorges <vincent.decorges@eivd.ch> *
8 * copyright (C) 2003-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef PYTHONWRITER_H
13 #define PYTHONWRITER_H
14
15 #include "simplecodegenerator.h"
16 #include "umlattributelist.h"
17 #include "umloperationlist.h"
18
26 class PythonWriter : public SimpleCodeGenerator
27 {
28 Q_OBJECT
29 public:
30
31 PythonWriter();
32 virtual ~PythonWriter();
33
34 virtual void writeClass(UMLClassifier *c);
35
36 virtual Uml::ProgrammingLanguage::Enum language() const;
37
38 virtual QStringList reservedKeywords() const;
39
40 QStringList defaultDatatypes();
41
42 private:
43
44 void writeAttributes(UMLAttributeList atList, QTextStream &py);
45
46 void writeOperations(UMLClassifier *c, QTextStream &h);
47 void writeOperations(const QString& classname, UMLOperationList &opList,
48 QTextStream &h, Uml::Visibility::Enum access);
49
50 bool m_bNeedPass;
51 };
52
53 #endif //PYTHONWRITER
UMLObject::package
QString package(const QString &separator=QString(), bool includeRoot=false)
Definition: umlobject.cpp:577
umlattributelist.h
pythonwriter.h
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
SimpleCodeGenerator::m_indentation
QString m_indentation
Definition: simplecodegenerator.h:85
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:288
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
PythonWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: pythonwriter.cpp:440
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
umloperationlist.h
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Definition: codegenerator.cpp:407
PythonWriter::m_bNeedPass
bool m_bNeedPass
True as long as no "pass" has been written.
Definition: pythonwriter.h:59
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
PythonWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &h)
Definition: pythonwriter.cpp:321
includes
Definition: includes.h:3
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Definition: codegenerator.cpp:549
operation.h
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Definition: classifierlistitem.cpp:112
PythonWriter::writeAttributes
void writeAttributes(UMLAttributeList atList, QTextStream &py)
Definition: pythonwriter.cpp:302
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Definition: codegenerator.cpp:622
Uml::ProgrammingLanguage::Python
@ Python
Definition: basictypes.h:303
association.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
PythonWriter::PythonWriter
PythonWriter()
Definition: pythonwriter.cpp:168
PythonWriter::defaultDatatypes
QStringList defaultDatatypes()
Definition: pythonwriter.cpp:448
PythonWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: pythonwriter.cpp:180
CodeGenerator::forceDoc
bool forceDoc() const
Definition: codegenerator.cpp:765
CodeGenerator::formatSourceCode
static QString formatSourceCode(const QString &code, const QString &indentation)
Definition: codegenerator.cpp:743
Uml::Visibility::Public
@ Public
Definition: basictypes.h:77
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
attribute.h
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:87
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Definition: basictypes.cpp:124
CodeGenerator::formatDoc
static QString formatDoc(const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80)
Definition: codegenerator.cpp:712
uDebug
#define uDebug()
Definition: debug_utils.h:122
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:436
PythonWriter
Definition: pythonwriter.h:27
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17
PythonWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: pythonwriter.cpp:469
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
Uml::Visibility::Enum
Enum
Definition: basictypes.h:76
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
classifier.h
UMLOperation
Definition: operation.h:25
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
simplecodegenerator.h
Uml::Visibility::Private
@ Private
Definition: basictypes.h:78
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:775
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:79
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
reserved_words
static const char * reserved_words[]
Definition: pythonwriter.cpp:30
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Definition: simplecodegenerator.cpp:91
umldoc.h
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Definition: codegenerator.cpp:523
PythonWriter::~PythonWriter
virtual ~PythonWriter()
Definition: pythonwriter.cpp:172
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:507
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33