umbrello: umbrello/codegenerators/simplecodegenerator.h Source File

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

simplecodegenerator.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) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
8 * copyright (C) 2004-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef SIMPLECODEGENERATOR_H
13 #define SIMPLECODEGENERATOR_H
14
15 #include "basictypes.h"
16 #include "codegenerator.h"
17
18 #include <QMap>
19 #include <QString>
20 #include <QStringList>
21
22
33 class SimpleCodeGenerator : public CodeGenerator
34 {
35 Q_OBJECT
36 public:
37
38 explicit SimpleCodeGenerator(bool createDirHierarchyForPackages = true);
39 virtual ~SimpleCodeGenerator();
40
41 void writeCodeToFile(UMLClassifierList & concepts);
42 void writeCodeToFile();
43
48 virtual void writeClass(UMLClassifier *c) = 0;
49
50 protected:
51 QString className_;
52 QString fileName_;
53
54 QString findFileName(UMLPackage* concept, const QString &ext);
55 QString overwritableName(UMLPackage* concept, const QString &name, const QString &ext);
56 bool hasDefaultValueAttr(UMLClassifier *c);
57 bool hasAbstractOps(UMLClassifier *c);
58
59 QString indent();
60
65 QMap<UMLPackage*, QString> m_fileMap;
66
73 bool m_createDirHierarchyForPackages;
74
75 // old attributes writers will look for
76 QString m_indentation;
77 int m_indentLevel;
78 QString m_endl;
79
80 virtual void initFromParentDocument();
81
82 public slots:
83 virtual void syncCodeToDocument();
84
85 };
86
87 #endif // SIMPLECODEGENERATOR_H
basictypes.h
CodeGenerator
Definition: codegenerator.h:58
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
SimpleCodeGenerator::m_indentLevel
int m_indentLevel
Definition: simplecodegenerator.h:77
SimpleCodeGenerator::m_createDirHierarchyForPackages
bool m_createDirHierarchyForPackages
Definition: simplecodegenerator.h:73
SimpleCodeGenerator::initFromParentDocument
virtual void initFromParentDocument()
Definition: simplecodegenerator.cpp:318
SimpleCodeGenerator::hasAbstractOps
bool hasAbstractOps(UMLClassifier *c)
Definition: simplecodegenerator.cpp:270
SimpleCodeGenerator::className_
QString className_
Definition: simplecodegenerator.h:51
SimpleCodeGenerator::fileName_
QString fileName_
Definition: simplecodegenerator.h:52
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:78
SimpleCodeGenerator::m_indentation
QString m_indentation
Definition: simplecodegenerator.h:76
SimpleCodeGenerator::~SimpleCodeGenerator
virtual ~SimpleCodeGenerator()
Definition: simplecodegenerator.cpp:68
SimpleCodeGenerator::SimpleCodeGenerator
SimpleCodeGenerator(bool createDirHierarchyForPackages=true)
Definition: simplecodegenerator.cpp:48
SimpleCodeGenerator::m_fileMap
QMap< UMLPackage *, QString > m_fileMap
Definition: simplecodegenerator.h:65
SimpleCodeGenerator::writeCodeToFile
void writeCodeToFile()
Definition: simplecodegenerator.cpp:283
SimpleCodeGenerator::overwritableName
QString overwritableName(UMLPackage *concept, const QString &name, const QString &ext)
Definition: simplecodegenerator.cpp:167
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:76
SimpleCodeGenerator::syncCodeToDocument
virtual void syncCodeToDocument()
Definition: simplecodegenerator.cpp:307
SimpleCodeGenerator::writeClass
virtual void writeClass(UMLClassifier *c)=0
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Definition: simplecodegenerator.cpp:91
SimpleCodeGenerator::hasDefaultValueAttr
bool hasDefaultValueAttr(UMLClassifier *c)
Definition: simplecodegenerator.cpp:255
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33
codegenerator.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17