2
/***************************************************************************
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* copyright (C) 2007 Jari-Matti Mäkelä <jmjm@iki.fi> *
10
* Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
11
***************************************************************************/
13
#ifndef DCODEGENERATOR_H
14
#define DCODEGENERATOR_H
17
#include "../codeviewerstate.h"
18
#include "../codegenerator.h"
19
#include "../codeblockwithcomments.h"
20
#include "../umldoc.h"
22
#include "dclassifiercodedocument.h"
24
#include "dcodegenerationpolicy.h"
26
class CodeViewerDialog;
28
class DCodeGenerator : public CodeGenerator
37
DCodeGenerator (QDomElement & element);
42
virtual ~DCodeGenerator ( );
48
// Public attribute accessor methods
52
* A utility method to get the dCodeGenerationPolicy()->getAutoGenerateAttribAccessors() value.
54
bool getAutoGenerateAttribAccessors( );
57
* A utility method to get the dCodeGenerationPolicy()->getAutoGenerateAssocAccessors() value.
59
bool getAutoGenerateAssocAccessors( );
62
* Get the list variable class name to use. For D, we have set this to "Vector".
64
static QString getListFieldClassName();
66
/** Get the editing dialog for this code document
68
virtual CodeViewerDialog * getCodeViewerDialog( QWidget* parent, CodeDocument * doc,
69
Settings::CodeViewerState state);
74
// general purpose function we may reuse for all types of D code documents
75
static QString capitalizeFirstLetter(const QString &string);
78
* Utility function for getting the d code generation policy.
80
DCodeGenerationPolicy * getDPolicy();
83
* @return ClassifierCodeDocument
86
CodeDocument * newClassifierCodeDocument (UMLClassifier * classifier);
89
Uml::Programming_Language getLanguage();
92
* Adds D's primitives as datatypes
94
virtual QStringList defaultDatatypes();
97
* IF the type is "string" we need to declare it as
98
* the D Object "String" (there is no string primative in D).
99
* Same thing again for "bool" to "boolean".
101
static QString fixTypeName(const QString &string);
104
* get list of reserved keywords
106
virtual const QStringList reservedKeywords() const;
110
/** create the codeblock that will represent the class declaration
111
* for this classifier
113
CodeBlockWithComments * createClassDecl ( UMLClassifier *c, DClassifierCodeDocument * doc);
120
#endif // DCODEGENERATOR_H