umbrello: umbrello/codegenerators/codeparameter.h Source File

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

codeparameter.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 CODEPARAMETER_H
13 #define CODEPARAMETER_H
14
15 #include "basictypes.h"
16 #include "codecomment.h"
17
18 class ClassifierCodeDocument;
19 class UMLObject;
20 class QXmlStreamWriter;
21
26 class CodeParameter : public QObject
27 {
28 Q_OBJECT
29 public:
30
31 CodeParameter(ClassifierCodeDocument* doc, UMLObject* parentObj);
32 virtual ~CodeParameter();
33
34 ClassifierCodeDocument* getParentDocument();
35
36 UMLObject* getParentObject();
37
38 bool getAbstract();
39
40 bool getStatic();
41
42 QString getName() const;
43
44 virtual QString getTypeName();
45
46 Uml::Visibility::Enum getVisibility() const;
47
48 virtual void setInitialValue(const QString &new_var);
49 virtual QString getInitialValue();
50
51 void setComment(CodeComment* comment);
52 CodeComment* getComment();
53
54 // the id of this parameter is the same as the parent UMLObject id.
55 QString ID();
56
57 virtual void updateContent() = 0;
58
59 protected:
60
61 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
62 virtual void setAttributesFromNode(QDomElement& element);
63
64 private:
65
66 ClassifierCodeDocument* m_parentDocument;
67 UMLObject* m_parentObject;
68 CodeComment* m_comment;
69 QString m_initialValue;
70
71 void initFields(ClassifierCodeDocument* doc, UMLObject* obj);
72
73 public slots:
74
75 void syncToParent();
76
77 };
78
79 #endif // CODEPARAMETER_H
basictypes.h
ClassifierCodeDocument
Definition: classifiercodedocument.h:33
CodeComment
Definition: codecomment.h:24
CodeParameter
Definition: codeparameter.h:27
CodeParameter::getParentDocument
ClassifierCodeDocument * getParentDocument()
Definition: codeparameter.cpp:136
CodeParameter::initFields
void initFields(ClassifierCodeDocument *doc, UMLObject *obj)
Definition: codeparameter.cpp:279
CodeParameter::m_parentObject
UMLObject * m_parentObject
Definition: codeparameter.h:67
CodeParameter::getInitialValue
virtual QString getInitialValue()
Definition: codeparameter.cpp:112
CodeParameter::setComment
void setComment(CodeComment *comment)
Definition: codeparameter.cpp:120
CodeParameter::getAbstract
bool getAbstract()
Definition: codeparameter.cpp:50
CodeParameter::m_parentDocument
ClassifierCodeDocument * m_parentDocument
Definition: codeparameter.h:66
CodeParameter::m_comment
CodeComment * m_comment
Definition: codeparameter.h:68
CodeParameter::m_initialValue
QString m_initialValue
initial value of this code parameter
Definition: codeparameter.h:69
CodeParameter::setInitialValue
virtual void setInitialValue(const QString &new_var)
Definition: codeparameter.cpp:102
CodeParameter::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeparameter.cpp:195
CodeParameter::getName
QString getName() const
Definition: codeparameter.cpp:70
CodeParameter::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: codeparameter.cpp:169
CodeParameter::CodeParameter
CodeParameter(ClassifierCodeDocument *doc, UMLObject *parentObj)
Definition: codeparameter.cpp:32
CodeParameter::ID
QString ID()
Definition: codeparameter.cpp:151
CodeParameter::syncToParent
void syncToParent()
Definition: codeparameter.cpp:272
CodeParameter::getTypeName
virtual QString getTypeName()
Definition: codeparameter.cpp:81
CodeParameter::getStatic
bool getStatic()
Definition: codeparameter.cpp:60
CodeParameter::~CodeParameter
virtual ~CodeParameter()
Definition: codeparameter.cpp:42
CodeParameter::getVisibility
Uml::Visibility::Enum getVisibility() const
Definition: codeparameter.cpp:92
CodeParameter::getComment
CodeComment * getComment()
Definition: codeparameter.cpp:128
CodeParameter::getParentObject
UMLObject * getParentObject()
Definition: codeparameter.cpp:144
CodeParameter::updateContent
virtual void updateContent()=0
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
codecomment.h
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59