umbrello: umbrello/codegenerators/cpp/cppcodegenerator.h Source File

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

cppcodegenerator.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 CPPCODEGENERATOR_H
13 #define CPPCODEGENERATOR_H
14
15 #include "codedocumentlist.h"
16 #include "codeviewerstate.h"
17 #include "advancedcodegenerator.h"
18 #include "cppmakecodedocument.h"
19 #include "umldoc.h"
20
21 #include <QString>
22
23 class CodeViewerDialog;
24 class CPPHeaderCodeDocument;
25
26 class CPPCodeGenerator : public AdvancedCodeGenerator
27 {
28 Q_OBJECT
29 public:
30
31 static const bool DEFAULT_BUILD_MAKEFILE;
32
33 CPPCodeGenerator();
34 virtual ~CPPCodeGenerator();
35
36 void setCreateProjectMakefile(bool buildIt);
37 bool getCreateProjectMakefile();
38
39 QString fixTypeName(const QString &name);
40
41 bool addHeaderCodeDocument (CPPHeaderCodeDocument * doc);
42 bool removeHeaderCodeDocument (CPPHeaderCodeDocument * remove_object);
43
44 Uml::ProgrammingLanguage::Enum language() const;
45
46 CodeDocument * newClassifierCodeDocument (UMLClassifier * classifier);
47 CPPHeaderCodeDocument * newHeaderClassifierCodeDocument (UMLClassifier * classifier);
48
49 virtual CodeViewerDialog * getCodeViewerDialog(QWidget* parent, CodeDocument * doc,
50 Settings::CodeViewerState & state);
51
52 virtual void writeCodeToFile();
53 virtual void writeCodeToFile(UMLClassifierList &list);
54
55 QStringList defaultDatatypes();
56
57 virtual void saveToXMI1 (QDomDocument & doc, QDomElement & root);
58
59 virtual QStringList reservedKeywords() const;
60
61 virtual void createDefaultStereotypes ();
62
63 void initFromParentDocument();
64
65 protected:
66
67 CPPMakefileCodeDocument * newMakefileCodeDocument ();
68
69 CPPHeaderCodeDocument * findHeaderCodeDocumentByClassifier (UMLClassifier * classifier);
70
71 private:
72
73 bool m_createMakefile;
74 CodeDocumentList m_headercodedocumentVector; //< a separate list for recording the header documents
75
76 public slots:
77
78 virtual void checkAddUMLObject (UMLObject * obj);
79 virtual void checkRemoveUMLObject (UMLObject * obj);
80
81 virtual void syncCodeToDocument ();
82 };
83
84 #endif // CPPCODEGENERATOR_H
advancedcodegenerator.h
AdvancedCodeGenerator
Definition: advancedcodegenerator.h:22
CPPCodeGenerator
Definition: cppcodegenerator.h:27
CPPCodeGenerator::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: cppcodegenerator.cpp:401
CPPCodeGenerator::newHeaderClassifierCodeDocument
CPPHeaderCodeDocument * newHeaderClassifierCodeDocument(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:287
CPPCodeGenerator::CPPCodeGenerator
CPPCodeGenerator()
Definition: cppcodegenerator.cpp:36
CPPCodeGenerator::language
Uml::ProgrammingLanguage::Enum language() const
Definition: cppcodegenerator.cpp:61
CPPCodeGenerator::newClassifierCodeDocument
CodeDocument * newClassifierCodeDocument(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:275
CPPCodeGenerator::defaultDatatypes
QStringList defaultDatatypes()
Definition: cppcodegenerator.cpp:392
CPPCodeGenerator::removeHeaderCodeDocument
bool removeHeaderCodeDocument(CPPHeaderCodeDocument *remove_object)
Definition: cppcodegenerator.cpp:115
CPPCodeGenerator::m_headercodedocumentVector
CodeDocumentList m_headercodedocumentVector
Definition: cppcodegenerator.h:74
CPPCodeGenerator::setCreateProjectMakefile
void setCreateProjectMakefile(bool buildIt)
Definition: cppcodegenerator.cpp:70
CPPCodeGenerator::findHeaderCodeDocumentByClassifier
CPPHeaderCodeDocument * findHeaderCodeDocumentByClassifier(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:264
CPPCodeGenerator::checkRemoveUMLObject
virtual void checkRemoveUMLObject(UMLObject *obj)
Definition: cppcodegenerator.cpp:368
CPPCodeGenerator::DEFAULT_BUILD_MAKEFILE
static const bool DEFAULT_BUILD_MAKEFILE
Definition: cppcodegenerator.h:31
CPPCodeGenerator::getCodeViewerDialog
virtual CodeViewerDialog * getCodeViewerDialog(QWidget *parent, CodeDocument *doc, Settings::CodeViewerState &state)
Definition: cppcodegenerator.cpp:136
CPPCodeGenerator::writeCodeToFile
virtual void writeCodeToFile()
Definition: cppcodegenerator.cpp:227
CPPCodeGenerator::getCreateProjectMakefile
bool getCreateProjectMakefile()
Definition: cppcodegenerator.cpp:83
CPPCodeGenerator::initFromParentDocument
void initFromParentDocument()
Definition: cppcodegenerator.cpp:307
CPPCodeGenerator::fixTypeName
QString fixTypeName(const QString &name)
Definition: cppcodegenerator.cpp:173
CPPCodeGenerator::~CPPCodeGenerator
virtual ~CPPCodeGenerator()
Definition: cppcodegenerator.cpp:50
CPPCodeGenerator::checkAddUMLObject
virtual void checkAddUMLObject(UMLObject *obj)
Definition: cppcodegenerator.cpp:341
CPPCodeGenerator::syncCodeToDocument
virtual void syncCodeToDocument()
Definition: cppcodegenerator.cpp:209
CPPCodeGenerator::saveToXMI1
virtual void saveToXMI1(QDomDocument &doc, QDomElement &root)
Definition: cppcodegenerator.cpp:184
CPPCodeGenerator::m_createMakefile
bool m_createMakefile
Definition: cppcodegenerator.h:73
CPPCodeGenerator::addHeaderCodeDocument
bool addHeaderCodeDocument(CPPHeaderCodeDocument *doc)
Definition: cppcodegenerator.cpp:93
CPPCodeGenerator::newMakefileCodeDocument
CPPMakefileCodeDocument * newMakefileCodeDocument()
Definition: cppcodegenerator.cpp:298
CPPCodeGenerator::createDefaultStereotypes
virtual void createDefaultStereotypes()
Definition: cppcodegenerator.cpp:409
CPPHeaderCodeDocument
Definition: cppheadercodedocument.h:36
CPPMakefileCodeDocument
Definition: cppmakecodedocument.h:24
CodeDocument
Definition: codedocument.h:33
CodeViewerDialog
Definition: codeviewerdialog.h:28
Settings::CodeViewerState
configurable params for the code viewer tool
Definition: codeviewerstate.h:20
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
codedocumentlist.h
CodeDocumentList
QList< CodeDocument * > CodeDocumentList
Definition: codedocumentlist.h:17
codeviewerstate.h
cppmakecodedocument.h
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
umldoc.h