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

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- File List
- File Members

codeaccessormethod.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 CODEACCESSORMETHOD_H
9#define CODEACCESSORMETHOD_H
10
11#include "codemethodblock.h"
12#include <QString>
13
14 class CodeClassField;
15 class QXmlStreamWriter;
16
17 class CodeAccessorMethod : public CodeMethodBlock
18{
19 friend class CodeClassField;
20 Q_OBJECT
21 public:
22
23 // some types of accessor methods that are possible:
24 // "GET" is to retrieve single-valued (primitive or Object) fields
25 // "SET" is to set single-valued (primitive or Object) fields
26 // "ADD" is to add a value to a multiple-valued field of either primitive or Object items
27 // "REMOVE" is to remove a value to a multiple-valued field of either primitive or Object items
28 // "LIST" is to retrieve the entire list of items in a multiple-valued field
29 enum AccessorType {GET=0, SET, ADD, REMOVE, LIST};
30
31 explicit CodeAccessorMethod(CodeClassField * field);
32 virtual ~CodeAccessorMethod();
33
34 CodeClassField * getParentClassField();
35
36 AccessorType getType();
37
38 void setType(AccessorType type);
39
40 // virtual UMLObject * getParentObject();
41
42 bool parentIsAttribute();
43
44 virtual void updateContent() = 0;
45
46 virtual void saveToXMI(QXmlStreamWriter& writer);
47 virtual void loadFromXMI(QDomElement & root);
48
49 virtual void setAttributesFromObject(TextBlock * obj);
50
51 protected:
52
53 virtual void release();
54
55 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
56
57 virtual void setAttributesFromNode(QDomElement & element);
58
59 virtual void updateMethodDeclaration() = 0;
60
61 void forceRelease();
62
63 private:
64
65 CodeClassField * m_parentclassfield;
66 AccessorType m_accessorType;
67
68 void initFields(CodeClassField * parentCF);
69
70};
71
72#endif // CODEACCESSORMETHOD_H
CodeAccessorMethod
Definition codeaccessormethod.h:18
CodeAccessorMethod::getParentClassField
CodeClassField * getParentClassField()
Definition codeaccessormethod.cpp:37
CodeAccessorMethod::getType
AccessorType getType()
Definition codeaccessormethod.cpp:61
CodeAccessorMethod::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition codeaccessormethod.cpp:167
CodeAccessorMethod::forceRelease
void forceRelease()
Definition codeaccessormethod.cpp:88
CodeAccessorMethod::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Definition codeaccessormethod.cpp:99
CodeAccessorMethod::CodeAccessorMethod
CodeAccessorMethod(CodeClassField *field)
Definition codeaccessormethod.cpp:20
CodeAccessorMethod::m_accessorType
AccessorType m_accessorType
Definition codeaccessormethod.h:66
CodeAccessorMethod::parentIsAttribute
bool parentIsAttribute()
Definition codeaccessormethod.cpp:42
CodeAccessorMethod::release
virtual void release()
Definition codeaccessormethod.cpp:80
CodeAccessorMethod::~CodeAccessorMethod
virtual ~CodeAccessorMethod()
Definition codeaccessormethod.cpp:29
CodeAccessorMethod::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition codeaccessormethod.cpp:107
CodeAccessorMethod::initFields
void initFields(CodeClassField *parentCF)
Definition codeaccessormethod.cpp:181
CodeAccessorMethod::updateMethodDeclaration
virtual void updateMethodDeclaration()=0
CodeAccessorMethod::updateContent
virtual void updateContent()=0
CodeAccessorMethod::m_parentclassfield
CodeClassField * m_parentclassfield
Definition codeaccessormethod.h:65
CodeAccessorMethod::setType
void setType(AccessorType type)
Definition codeaccessormethod.cpp:69
CodeAccessorMethod::AccessorType
AccessorType
Definition codeaccessormethod.h:29
CodeAccessorMethod::GET
@ GET
Definition codeaccessormethod.h:29
CodeAccessorMethod::REMOVE
@ REMOVE
Definition codeaccessormethod.h:29
CodeAccessorMethod::ADD
@ ADD
Definition codeaccessormethod.h:29
CodeAccessorMethod::SET
@ SET
Definition codeaccessormethod.h:29
CodeAccessorMethod::LIST
@ LIST
Definition codeaccessormethod.h:29
CodeAccessorMethod::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition codeaccessormethod.cpp:120
CodeAccessorMethod::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition codeaccessormethod.cpp:134
CodeClassField
Definition codeclassfield.h:26
CodeMethodBlock
Definition codemethodblock.h:26
TextBlock
Definition textblock.h:23
codemethodblock.h