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 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
5 SPDX-FileCopyrightText: 2004-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef CPPCODEGENERATOR_H
9#define CPPCODEGENERATOR_H
10
11#include "codedocumentlist.h"
12#include "codeviewerstate.h"
13#include "advancedcodegenerator.h"
14#include "cppmakecodedocument.h"
15#include "umldoc.h"
16
17#include <QString>
18
19class CodeViewerDialog;
20class CPPHeaderCodeDocument;
21
22 class CPPCodeGenerator : public AdvancedCodeGenerator
23{
24 Q_OBJECT
25public:
26
27 static const bool DEFAULT_BUILD_MAKEFILE;
28
29 CPPCodeGenerator();
30 virtual ~CPPCodeGenerator();
31
32 void setCreateProjectMakefile(bool buildIt);
33 bool getCreateProjectMakefile();
34
35 QString fixTypeName(const QString &name);
36
37 bool addHeaderCodeDocument (CPPHeaderCodeDocument * doc);
38 bool removeHeaderCodeDocument (CPPHeaderCodeDocument * remove_object);
39
40 Uml::ProgrammingLanguage::Enum language() const;
41
42 CodeDocument * newClassifierCodeDocument (UMLClassifier * classifier);
43 CPPHeaderCodeDocument * newHeaderClassifierCodeDocument (UMLClassifier * classifier);
44
45 virtual CodeViewerDialog * getCodeViewerDialog(QWidget* parent, CodeDocument * doc,
46 Settings::CodeViewerState & state);
47
48 virtual void writeCodeToFile();
49 virtual void writeCodeToFile(UMLClassifierList &list);
50
51 QStringList defaultDatatypes() const;
52
53 virtual void saveToXMI1(QXmlStreamWriter& writer);
54
55 virtual QStringList reservedKeywords() const;
56
57 virtual void createDefaultStereotypes ();
58
59 void initFromParentDocument();
60
61protected:
62
63 CPPMakefileCodeDocument * newMakefileCodeDocument ();
64
65 CPPHeaderCodeDocument * findHeaderCodeDocumentByClassifier (UMLClassifier * classifier);
66
67private:
68
69 bool m_createMakefile;
70 CodeDocumentList m_headercodedocumentVector; //< a separate list for recording the header documents
71
72public slots:
73
74 virtual void checkAddUMLObject (UMLObject * obj);
75 virtual void checkRemoveUMLObject (UMLObject * obj);
76
77 virtual void syncCodeToDocument ();
78};
79
80#endif // CPPCODEGENERATOR_H
advancedcodegenerator.h
AdvancedCodeGenerator
Definition: advancedcodegenerator.h:18
CPPCodeGenerator
Definition: cppcodegenerator.h:23
CPPCodeGenerator::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: cppcodegenerator.cpp:397
CPPCodeGenerator::newHeaderClassifierCodeDocument
CPPHeaderCodeDocument * newHeaderClassifierCodeDocument(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:283
CPPCodeGenerator::CPPCodeGenerator
CPPCodeGenerator()
Definition: cppcodegenerator.cpp:32
CPPCodeGenerator::language
Uml::ProgrammingLanguage::Enum language() const
Definition: cppcodegenerator.cpp:57
CPPCodeGenerator::defaultDatatypes
QStringList defaultDatatypes() const
Definition: cppcodegenerator.cpp:388
CPPCodeGenerator::newClassifierCodeDocument
CodeDocument * newClassifierCodeDocument(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:271
CPPCodeGenerator::removeHeaderCodeDocument
bool removeHeaderCodeDocument(CPPHeaderCodeDocument *remove_object)
Definition: cppcodegenerator.cpp:111
CPPCodeGenerator::m_headercodedocumentVector
CodeDocumentList m_headercodedocumentVector
Definition: cppcodegenerator.h:70
CPPCodeGenerator::setCreateProjectMakefile
void setCreateProjectMakefile(bool buildIt)
Definition: cppcodegenerator.cpp:66
CPPCodeGenerator::findHeaderCodeDocumentByClassifier
CPPHeaderCodeDocument * findHeaderCodeDocumentByClassifier(UMLClassifier *classifier)
Definition: cppcodegenerator.cpp:260
CPPCodeGenerator::checkRemoveUMLObject
virtual void checkRemoveUMLObject(UMLObject *obj)
Definition: cppcodegenerator.cpp:364
CPPCodeGenerator::DEFAULT_BUILD_MAKEFILE
static const bool DEFAULT_BUILD_MAKEFILE
Definition: cppcodegenerator.h:27
CPPCodeGenerator::getCodeViewerDialog
virtual CodeViewerDialog * getCodeViewerDialog(QWidget *parent, CodeDocument *doc, Settings::CodeViewerState &state)
Definition: cppcodegenerator.cpp:132
CPPCodeGenerator::writeCodeToFile
virtual void writeCodeToFile()
Definition: cppcodegenerator.cpp:223
CPPCodeGenerator::getCreateProjectMakefile
bool getCreateProjectMakefile()
Definition: cppcodegenerator.cpp:79
CPPCodeGenerator::initFromParentDocument
void initFromParentDocument()
Definition: cppcodegenerator.cpp:303
CPPCodeGenerator::fixTypeName
QString fixTypeName(const QString &name)
Definition: cppcodegenerator.cpp:169
CPPCodeGenerator::~CPPCodeGenerator
virtual ~CPPCodeGenerator()
Definition: cppcodegenerator.cpp:46
CPPCodeGenerator::checkAddUMLObject
virtual void checkAddUMLObject(UMLObject *obj)
Definition: cppcodegenerator.cpp:337
CPPCodeGenerator::syncCodeToDocument
virtual void syncCodeToDocument()
Definition: cppcodegenerator.cpp:205
CPPCodeGenerator::saveToXMI1
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: cppcodegenerator.cpp:180
CPPCodeGenerator::m_createMakefile
bool m_createMakefile
Definition: cppcodegenerator.h:69
CPPCodeGenerator::addHeaderCodeDocument
bool addHeaderCodeDocument(CPPHeaderCodeDocument *doc)
Definition: cppcodegenerator.cpp:89
CPPCodeGenerator::newMakefileCodeDocument
CPPMakefileCodeDocument * newMakefileCodeDocument()
Definition: cppcodegenerator.cpp:294
CPPCodeGenerator::createDefaultStereotypes
virtual void createDefaultStereotypes()
Definition: cppcodegenerator.cpp:405
CPPHeaderCodeDocument
Definition: cppheadercodedocument.h:32
CPPMakefileCodeDocument
Definition: cppmakecodedocument.h:20
CodeDocument
Definition: codedocument.h:30
CodeViewerDialog
Definition: codeviewerdialog.h:23
Settings::CodeViewerState
configurable params for the code viewer tool
Definition: codeviewerstate.h:15
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
codedocumentlist.h
CodeDocumentList
QList< CodeDocument * > CodeDocumentList
Definition: codedocumentlist.h:12
codeviewerstate.h
cppmakecodedocument.h
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:291
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:12
umldoc.h