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

cppcodegenerationpolicy.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 CPPCODEGENERATIONPOLICY_H
13 #define CPPCODEGENERATIONPOLICY_H
14
15 #include "codegenpolicyext.h"
16 #include "codegenerationpolicy.h"
17
18 #include <QString>
19
20 class CodeGenerationPolicyPage;
21
22 class CPPCodeGenerationPolicy : public CodeGenPolicyExt
23 {
24 Q_OBJECT
25 public:
26
27 static const char * DEFAULT_VECTOR_METHOD_APPEND;
28 static const char * DEFAULT_VECTOR_METHOD_REMOVE;
29 static const char * DEFAULT_VECTOR_METHOD_INIT;
30 static const char * DEFAULT_OBJECT_METHOD_INIT;
31
32 CPPCodeGenerationPolicy();
33 virtual ~CPPCodeGenerationPolicy();
34
35 void setAccessorsAreInline(bool var);
36 bool getAccessorsAreInline();
37
38 void setOperationsAreInline(bool var);
39 bool getOperationsAreInline();
40
41 void setDestructorsAreVirtual(bool var);
42 bool getDestructorsAreVirtual();
43
44 void setPackageIsNamespace(bool var);
45 bool getPackageIsNamespace();
46
47 void setAutoGenerateAccessors(bool var);
48 bool getAutoGenerateAccessors();
49
50 void setAccessorsArePublic(bool var);
51 bool getAccessorsArePublic();
52
53 void setGetterWithGetPrefix(bool var);
54 bool getGetterWithGetPrefix();
55
56 void setRemovePrefixFromAccessorMethods(bool var);
57 bool getRemovePrefixFromAccessorMethods();
58
59 bool getAccessorMethodsStartWithUpperCase();
60 void setAccessorMethodsStartWithUpperCase(bool var);
61
67 void setStringClassName(const QString &value);
68 QString getStringClassName();
69 void setStringClassNameInclude(const QString &value);
70 QString getStringClassNameInclude();
71 void setVectorClassName(const QString &value);
72 QString getVectorClassName();
73 void setVectorClassNameInclude(const QString &value);
74 QString getVectorClassNameInclude();
75
76 void setClassMemberPrefix(const QString &value);
77 QString getClassMemberPrefix();
78
79 void setDocToolTag(const QString &value);
80 QString getDocToolTag();
81
82 void setStringIncludeIsGlobal (bool value);
83 bool stringIncludeIsGlobal ();
84
85 void setVectorIncludeIsGlobal (bool value);
86 bool vectorIncludeIsGlobal ();
87
91 QString getVectorMethodAppend(const QString & variableName = QString(), const QString & itemClassName = QString());
92 QString getVectorMethodRemove(const QString & variableName = QString(), const QString & itemClassName = QString());
93 QString getVectorMethodInit(const QString & variableName = QString(), const QString & itemClassName = QString());
94
95 QString getObjectMethodInit(const QString & variableName = QString(), const QString & itemClassName = QString());
96
97 virtual void setDefaults (CPPCodeGenerationPolicy * cppclone, bool emitUpdateSignal = true);
98 virtual void setDefaults(bool emitUpdateSignal = true);
99
100 CodeGenerationPolicyPage * createPage (QWidget *parent = 0, const char * name = 0);
101
102 protected:
103 void init();
104
105 private:
106
107 QString m_vectorMethodAppendBase;
108 QString m_vectorMethodRemoveBase;
109 QString m_vectorMethodInitBase;
110 QString m_objectMethodInitBase;
111
112 };
113
114 #endif // CPPCODEGENERATIONPOLICY_H
CPPCodeGenerationPolicy::getDocToolTag
QString getDocToolTag()
Definition: cppcodegenerationpolicy.cpp:256
CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_APPEND
static const char * DEFAULT_VECTOR_METHOD_APPEND
Definition: cppcodegenerationpolicy.h:27
CPPCodeGenerationPolicy::getPackageIsNamespace
bool getPackageIsNamespace()
Definition: cppcodegenerationpolicy.cpp:171
Settings::CodeGenerationState::CPPCodeGenerationState::accessorMethodsStartWithUpperCase
bool accessorMethodsStartWithUpperCase
Definition: optionstate.h:210
cppcodegenerationpolicypage.h
UmbrelloSettings::vectorClassNameInclude
static QString vectorClassNameInclude()
Definition: umbrellosettings.h:2236
CPPCodeGenerationPolicy::getVectorClassName
QString getVectorClassName()
Definition: cppcodegenerationpolicy.cpp:205
CPPCodeGenerationPolicy::DEFAULT_OBJECT_METHOD_INIT
static const char * DEFAULT_OBJECT_METHOD_INIT
Definition: cppcodegenerationpolicy.h:30
CPPCodeGenerationPolicy::setStringClassNameInclude
void setStringClassNameInclude(const QString &value)
Definition: cppcodegenerationpolicy.cpp:221
CPPCodeGenerationPolicy::setDocToolTag
void setDocToolTag(const QString &value)
Definition: cppcodegenerationpolicy.cpp:250
Settings::CodeGenerationState::CPPCodeGenerationState::inlineOps
bool inlineOps
Definition: optionstate.h:196
CPPCodeGenerationPolicy::~CPPCodeGenerationPolicy
virtual ~CPPCodeGenerationPolicy()
Definition: cppcodegenerationpolicy.cpp:43
CPPCodeGenerationPolicy::setGetterWithGetPrefix
void setGetterWithGetPrefix(bool var)
Definition: cppcodegenerationpolicy.cpp:124
CPPCodeGenerationPolicy::getVectorMethodInit
QString getVectorMethodInit(const QString &variableName=QString(), const QString &itemClassName=QString())
Definition: cppcodegenerationpolicy.cpp:321
Settings::CodeGenerationState::CPPCodeGenerationState::publicAccessors
bool publicAccessors
Definition: optionstate.h:198
Settings::CodeGenerationState::CPPCodeGenerationState::classMemberPrefix
QString classMemberPrefix
Definition: optionstate.h:204
CPPCodeGenerationPolicy::vectorIncludeIsGlobal
bool vectorIncludeIsGlobal()
Definition: cppcodegenerationpolicy.cpp:274
CPPCodeGenerationPolicy::m_vectorMethodAppendBase
QString m_vectorMethodAppendBase
Definition: cppcodegenerationpolicy.h:107
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2283
UmbrelloSettings::stringClassNameInclude
static QString stringClassNameInclude()
Definition: umbrellosettings.h:2152
umbrellosettings.h
CPPCodeGenerationPolicy::setAccessorMethodsStartWithUpperCase
void setAccessorMethodsStartWithUpperCase(bool var)
Definition: cppcodegenerationpolicy.cpp:146
CPPCodeGenerationPolicy::setStringIncludeIsGlobal
void setStringIncludeIsGlobal(bool value)
Definition: cppcodegenerationpolicy.cpp:283
UmbrelloSettings::vectorClassName
static QString vectorClassName()
Definition: umbrellosettings.h:2208
UmbrelloSettings::stringIncludeIsGlobal
static bool stringIncludeIsGlobal()
Definition: umbrellosettings.h:2180
UmbrelloSettings::classMemberPrefix
static QString classMemberPrefix()
Definition: umbrellosettings.h:1984
CPPCodeGenerationPolicy::setVectorClassNameInclude
void setVectorClassNameInclude(const QString &value)
Definition: cppcodegenerationpolicy.cpp:233
UmbrelloSettings::accessorMethodsStartWithUpperCase
static bool accessorMethodsStartWithUpperCase()
Definition: umbrellosettings.h:2376
Settings::CodeGenerationState::CPPCodeGenerationState::autoGenAccessors
bool autoGenAccessors
Definition: optionstate.h:194
CPPCodeGenerationPolicy::getGetterWithGetPrefix
bool getGetterWithGetPrefix()
Definition: cppcodegenerationpolicy.cpp:130
CPPCodeGenerationPolicy::setVectorClassName
void setVectorClassName(const QString &value)
Definition: cppcodegenerationpolicy.cpp:227
UmbrelloSettings::stringClassName
static QString stringClassName()
Definition: umbrellosettings.h:2124
CPPCodeGenerationPolicy::setVectorIncludeIsGlobal
void setVectorIncludeIsGlobal(bool value)
Definition: cppcodegenerationpolicy.cpp:293
CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_REMOVE
static const char * DEFAULT_VECTOR_METHOD_REMOVE
Definition: cppcodegenerationpolicy.h:28
CPPCodeGenerationPolicy::createPage
CodeGenerationPolicyPage * createPage(QWidget *parent=0, const char *name=0)
Definition: cppcodegenerationpolicy.cpp:434
CPPCodeGenerationPolicyPage::CPPCodeGenerationPolicyPage
CPPCodeGenerationPolicyPage(QWidget *parent=0, const char *name=0, CPPCodeGenerationPolicy *policy=0)
Definition: cppcodegenerationpolicypage.cpp:27
CodeGenerationPolicy::emitModifiedCodeContentSig
void emitModifiedCodeContentSig()
Definition: codegenerationpolicy.cpp:420
CodeGenPolicyExt
Definition: codegenpolicyext.h:28
CPPCodeGenerationPolicy
Definition: cppcodegenerationpolicy.h:23
CPPCodeGenerationPolicy::setClassMemberPrefix
void setClassMemberPrefix(const QString &value)
Definition: cppcodegenerationpolicy.cpp:239
UmbrelloSettings::packageIsNamespace
static bool packageIsNamespace()
Definition: umbrellosettings.h:2068
UmbrelloSettings::getterWithGetPrefix
static bool getterWithGetPrefix()
Definition: umbrellosettings.h:2320
CPPCodeGenerationPolicy::getStringClassName
QString getStringClassName()
Definition: cppcodegenerationpolicy.cpp:195
optionstate.h
Settings::CodeGenerationState::CPPCodeGenerationState::stringClassName
QString stringClassName
Definition: optionstate.h:199
Settings::OptionState::codeGenerationState
CodeGenerationState codeGenerationState
Definition: optionstate.h:331
UmbrelloSettings::publicAccessors
static bool publicAccessors()
Definition: umbrellosettings.h:2096
Settings::optionState
OptionState & optionState()
Definition: optionstate.cpp:362
CPPCodeGenerationPolicy::getAccessorsAreInline
bool getAccessorsAreInline()
Definition: cppcodegenerationpolicy.cpp:81
Settings::CodeGenerationState::CPPCodeGenerationState::packageIsNamespace
bool packageIsNamespace
Definition: optionstate.h:197
CPPCodeGenerationPolicy::setAccessorsAreInline
void setAccessorsAreInline(bool var)
Definition: cppcodegenerationpolicy.cpp:71
Settings::CodeGenerationState::CPPCodeGenerationState::stringClassNameInclude
QString stringClassNameInclude
Definition: optionstate.h:200
CPPCodeGenerationPolicy::getStringClassNameInclude
QString getStringClassNameInclude()
Definition: cppcodegenerationpolicy.cpp:200
CPPCodeGenerationPolicy::setPackageIsNamespace
void setPackageIsNamespace(bool var)
Definition: cppcodegenerationpolicy.cpp:161
CPPCodeGenerationPolicy::setRemovePrefixFromAccessorMethods
void setRemovePrefixFromAccessorMethods(bool var)
Definition: cppcodegenerationpolicy.cpp:135
Settings::CodeGenerationState::CPPCodeGenerationState::docToolTag
QString docToolTag
Definition: optionstate.h:205
CPPCodeGenerationPolicy::getDestructorsAreVirtual
bool getDestructorsAreVirtual()
Definition: cppcodegenerationpolicy.cpp:119
UmbrelloSettings::virtualDestructors
static bool virtualDestructors()
Definition: umbrellosettings.h:2292
CPPCodeGenerationPolicy::getRemovePrefixFromAccessorMethods
bool getRemovePrefixFromAccessorMethods()
Definition: cppcodegenerationpolicy.cpp:141
CPPCodeGenerationPolicy::getVectorClassNameInclude
QString getVectorClassNameInclude()
Definition: cppcodegenerationpolicy.cpp:210
codegenerationpolicy.h
UmbrelloSettings::removePrefixFromAccessorMethods
static bool removePrefixFromAccessorMethods()
Definition: umbrellosettings.h:2348
UmbrelloSettings::vectorIncludeIsGlobal
static bool vectorIncludeIsGlobal()
Definition: umbrellosettings.h:2264
CPPCodeGenerationPolicy::m_vectorMethodRemoveBase
QString m_vectorMethodRemoveBase
Definition: cppcodegenerationpolicy.h:108
CodeGenerationPolicyPage
Definition: codegenerationpolicypage.h:31
CPPCodeGenerationPolicy::getClassMemberPrefix
QString getClassMemberPrefix()
Definition: cppcodegenerationpolicy.cpp:245
CPPCodeGenerationPolicy::setOperationsAreInline
void setOperationsAreInline(bool var)
Definition: cppcodegenerationpolicy.cpp:90
Settings::CodeGenerationState::CPPCodeGenerationState::getterWithGetPrefix
bool getterWithGetPrefix
Definition: optionstate.h:208
CPPCodeGenerationPolicy::setStringClassName
void setStringClassName(const QString &value)
Definition: cppcodegenerationpolicy.cpp:215
CPPCodeGenerationPolicy::getObjectMethodInit
QString getObjectMethodInit(const QString &variableName=QString(), const QString &itemClassName=QString())
Definition: cppcodegenerationpolicy.cpp:339
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
Settings::CodeGenerationState::CPPCodeGenerationState::removePrefixFromAccessorMethods
bool removePrefixFromAccessorMethods
Definition: optionstate.h:209
CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_INIT
static const char * DEFAULT_VECTOR_METHOD_INIT
Definition: cppcodegenerationpolicy.h:29
cppcodegenerationpolicy.h
UmbrelloSettings::inlineOps
static bool inlineOps()
Definition: umbrellosettings.h:2040
CPPCodeGenerationPolicy::getOperationsAreInline
bool getOperationsAreInline()
Definition: cppcodegenerationpolicy.cpp:100
Settings::OptionState
Definition: optionstate.h:314
Settings::CodeGenerationState::CPPCodeGenerationState::inlineAccessors
bool inlineAccessors
Definition: optionstate.h:195
Settings::CodeGenerationState::CPPCodeGenerationState::vectorClassNameInclude
QString vectorClassNameInclude
Definition: optionstate.h:203
Settings::CodeGenerationState::cppCodeGenerationState
CPPCodeGenerationState cppCodeGenerationState
Definition: optionstate.h:253
CPPCodeGenerationPolicy::stringIncludeIsGlobal
bool stringIncludeIsGlobal()
Definition: cppcodegenerationpolicy.cpp:265
uml.h
Settings::CodeGenerationState::CPPCodeGenerationState::vectorIncludeIsGlobal
bool vectorIncludeIsGlobal
Definition: optionstate.h:206
CPPCodeGenerationPolicy::init
void init()
Definition: cppcodegenerationpolicy.cpp:442
CPPCodeGenerationPolicy::CPPCodeGenerationPolicy
CPPCodeGenerationPolicy()
Definition: cppcodegenerationpolicy.cpp:35
codegenpolicyext.h
CPPCodeGenerationPolicy::m_objectMethodInitBase
QString m_objectMethodInitBase
Definition: cppcodegenerationpolicy.h:110
UmbrelloSettings::autoGenAccessors
static bool autoGenAccessors()
Definition: umbrellosettings.h:1956
CPPCodeGenerationPolicy::setAccessorsArePublic
void setAccessorsArePublic(bool var)
Definition: cppcodegenerationpolicy.cpp:51
Settings::CodeGenerationState::CPPCodeGenerationState::stringIncludeIsGlobal
bool stringIncludeIsGlobal
Definition: optionstate.h:201
CPPCodeGenerationPolicy::getAccessorMethodsStartWithUpperCase
bool getAccessorMethodsStartWithUpperCase()
Definition: cppcodegenerationpolicy.cpp:152
CPPCodeGenerationPolicy::m_vectorMethodInitBase
QString m_vectorMethodInitBase
Definition: cppcodegenerationpolicy.h:109
CPPCodeGenerationPolicy::setAutoGenerateAccessors
void setAutoGenerateAccessors(bool var)
Definition: cppcodegenerationpolicy.cpp:180
CPPCodeGenerationPolicy::getVectorMethodRemove
QString getVectorMethodRemove(const QString &variableName=QString(), const QString &itemClassName=QString())
Definition: cppcodegenerationpolicy.cpp:310
CPPCodeGenerationPolicy::getAutoGenerateAccessors
bool getAutoGenerateAccessors()
Definition: cppcodegenerationpolicy.cpp:190
Settings::CodeGenerationState::CPPCodeGenerationState::virtualDestructors
bool virtualDestructors
Definition: optionstate.h:207
CPPCodeGenerationPolicy::getVectorMethodAppend
QString getVectorMethodAppend(const QString &variableName=QString(), const QString &itemClassName=QString())
Definition: cppcodegenerationpolicy.cpp:299
UmbrelloSettings::inlineAccessors
static bool inlineAccessors()
Definition: umbrellosettings.h:2012
CPPCodeGenerationPolicy::setDestructorsAreVirtual
void setDestructorsAreVirtual(bool var)
Definition: cppcodegenerationpolicy.cpp:109
CPPCodeGenerationPolicy::getAccessorsArePublic
bool getAccessorsArePublic()
Definition: cppcodegenerationpolicy.cpp:62
UmbrelloSettings::docToolTag
static QString docToolTag()
Definition: umbrellosettings.h:2404
CPPCodeGenerationPolicy::setDefaults
virtual void setDefaults(CPPCodeGenerationPolicy *cppclone, bool emitUpdateSignal=true)
Definition: cppcodegenerationpolicy.cpp:355
Settings::CodeGenerationState::CPPCodeGenerationState::vectorClassName
QString vectorClassName
Definition: optionstate.h:202