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

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

- File List
- File Members

classifiercodedocument.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 CLASSIFIERCODEDOCUMENT_H
9#define CLASSIFIERCODEDOCUMENT_H
10
11#include "umlclassifier.h"
12#include "codeaccessormethod.h"
13#include "codedocument.h"
14#include "codeoperation.h"
15#include "codeclassfield.h"
16#include "codeclassfieldlist.h"
17#include "umlassociationlist.h"
18
19#include <QMap>
20#include <QList>
21#include <QString>
22
23
28 class ClassifierCodeDocument : public CodeDocument
29{
30 friend class HierarchicalCodeBlock;
31 Q_OBJECT
32 public:
33
34 // Constructors/Destructors
35
36 explicit ClassifierCodeDocument(UMLClassifier * parent);
37 virtual ~ClassifierCodeDocument();
38
39 bool addCodeClassField(CodeClassField * add_object);
40
41 bool removeCodeClassField(CodeClassField * remove_object);
42
43 CodeClassFieldList* getCodeClassFieldList();
44
45 // some Utility methods
46
47 bool parentIsInterface() const;
48 bool parentIsClass() const;
49
50 bool hasAssociationClassFields() const;
51 bool hasAttributeClassFields() const;
52 bool hasObjectVectorClassFields() const;
53 bool hasClassFields() const;
54
55 QList<const CodeOperation*> getCodeOperations() const;
56
57 CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType) const;
58 CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
59 bool isStatic) const;
60 CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
61 Uml::Visibility::Enum visibility) const;
62 CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType,
63 bool isStatic, Uml::Visibility::Enum visibility) const;
64
65 CodeClassField * findCodeClassFieldFromParentID (Uml::ID::Type id, int role_id = -1);
66
67 UMLClassifier * getParentClassifier() const;
68
69 void addCodeClassFieldMethods(CodeClassFieldList &list);
70
71 virtual void initCodeClassFields();
72
73 virtual void synchronize();
74
78 virtual bool addCodeOperation(CodeOperation *opBlock) = 0;
79
80 virtual void updateContent() = 0;
81
82 virtual void saveToXMI(QXmlStreamWriter& writer);
83 virtual void loadFromXMI(QDomElement &root);
84
85 protected:
86
87 void loadClassFieldsFromXMI(QDomElement &childElem);
88
89 virtual void setAttributesOnNode(QXmlStreamWriter& writer);
90 virtual void setAttributesFromNode(QDomElement &element);
91
92 TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag);
93
94 void declareClassFields(CodeClassFieldList &list, CodeGenObjectWithTextBlocks *parent);
95
96 void syncClassFields();
97 void syncNamesToParent();
98
99 private:
100
101 CodeClassFieldList m_classfieldVector;
102 UMLClassifier* m_parentclassifier;
103
104 void updateAssociationClassFields(UMLAssociationList &assocList);
105 void updateOperations();
106
111 QMap<UMLObject *, CodeClassField *> m_classFieldMap;
112
113 void init(UMLClassifier *classifier);
114
115 public Q_SLOTS:
116
117 void addAttributeClassField(UMLClassifierListItem *at, bool syncToParentIfAdded = true);
118 void addAssociationClassField(UMLAssociation *assoc, bool syncToParentIfAdded = true);
119 void removeAttributeClassField(UMLClassifierListItem *at);
120 void removeAssociationClassField(UMLAssociation *assoc);
121 void addOperation(UMLClassifierListItem *obj);
122 void removeOperation(UMLClassifierListItem *obj);
123 void syncToParent();
124
125};
126
127#endif // CLASSIFIERCODEDOCUMENT_H
ClassifierCodeDocument
Definition: classifiercodedocument.h:29
ClassifierCodeDocument::removeAssociationClassField
void removeAssociationClassField(UMLAssociation *assoc)
Definition: classifiercodedocument.cpp:251
ClassifierCodeDocument::addAssociationClassField
void addAssociationClassField(UMLAssociation *assoc, bool syncToParentIfAdded=true)
Definition: classifiercodedocument.cpp:578
ClassifierCodeDocument::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: classifiercodedocument.cpp:741
ClassifierCodeDocument::hasObjectVectorClassFields
bool hasObjectVectorClassFields() const
Definition: classifiercodedocument.cpp:128
ClassifierCodeDocument::removeAttributeClassField
void removeAttributeClassField(UMLClassifierListItem *at)
Definition: classifiercodedocument.cpp:244
ClassifierCodeDocument::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Definition: classifiercodedocument.cpp:728
ClassifierCodeDocument::updateOperations
void updateOperations()
Definition: classifiercodedocument.cpp:507
ClassifierCodeDocument::parentIsClass
bool parentIsClass() const
Definition: classifiercodedocument.cpp:414
ClassifierCodeDocument::getSpecificClassFields
CodeClassFieldList getSpecificClassFields(CodeClassField::ClassFieldType cfType) const
Definition: classifiercodedocument.cpp:53
ClassifierCodeDocument::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: classifiercodedocument.cpp:623
ClassifierCodeDocument::m_parentclassifier
UMLClassifier * m_parentclassifier
Definition: classifiercodedocument.h:102
ClassifierCodeDocument::updateContent
virtual void updateContent()=0
ClassifierCodeDocument::syncToParent
void syncToParent()
Definition: classifiercodedocument.cpp:534
ClassifierCodeDocument::addAttributeClassField
void addAttributeClassField(UMLClassifierListItem *at, bool syncToParentIfAdded=true)
Definition: classifiercodedocument.cpp:203
ClassifierCodeDocument::findCodeClassFieldTextBlockByTag
TextBlock * findCodeClassFieldTextBlockByTag(const QString &tag)
Definition: classifiercodedocument.cpp:763
ClassifierCodeDocument::hasAssociationClassFields
bool hasAssociationClassFields() const
Definition: classifiercodedocument.cpp:165
ClassifierCodeDocument::addCodeOperation
virtual bool addCodeOperation(CodeOperation *opBlock)=0
ClassifierCodeDocument::loadClassFieldsFromXMI
void loadClassFieldsFromXMI(QDomElement &childElem)
Definition: classifiercodedocument.cpp:682
ClassifierCodeDocument::synchronize
virtual void synchronize()
Definition: classifiercodedocument.cpp:483
ClassifierCodeDocument::addCodeClassFieldMethods
void addCodeClassFieldMethods(CodeClassFieldList &list)
Definition: classifiercodedocument.cpp:357
ClassifierCodeDocument::getCodeOperations
QList< const CodeOperation * > getCodeOperations() const
Definition: classifiercodedocument.cpp:288
ClassifierCodeDocument::updateAssociationClassFields
void updateAssociationClassFields(UMLAssociationList &assocList)
Definition: classifiercodedocument.cpp:572
ClassifierCodeDocument::getParentClassifier
UMLClassifier * getParentClassifier() const
Definition: classifiercodedocument.cpp:279
ClassifierCodeDocument::findCodeClassFieldFromParentID
CodeClassField * findCodeClassFieldFromParentID(Uml::ID::Type id, int role_id=-1)
Definition: classifiercodedocument.cpp:652
ClassifierCodeDocument::addOperation
void addOperation(UMLClassifierListItem *obj)
Definition: classifiercodedocument.cpp:306
ClassifierCodeDocument::m_classFieldMap
QMap< UMLObject *, CodeClassField * > m_classFieldMap
Definition: classifiercodedocument.h:111
ClassifierCodeDocument::syncNamesToParent
void syncNamesToParent()
Definition: classifiercodedocument.cpp:469
ClassifierCodeDocument::m_classfieldVector
CodeClassFieldList m_classfieldVector
Definition: classifiercodedocument.h:101
ClassifierCodeDocument::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: classifiercodedocument.cpp:716
ClassifierCodeDocument::getCodeClassFieldList
CodeClassFieldList * getCodeClassFieldList()
Definition: classifiercodedocument.cpp:270
ClassifierCodeDocument::hasClassFields
bool hasClassFields() const
Definition: classifiercodedocument.cpp:155
ClassifierCodeDocument::parentIsInterface
bool parentIsInterface() const
Definition: classifiercodedocument.cpp:422
ClassifierCodeDocument::declareClassFields
void declareClassFields(CodeClassFieldList &list, CodeGenObjectWithTextBlocks *parent)
Definition: classifiercodedocument.cpp:382
ClassifierCodeDocument::initCodeClassFields
virtual void initCodeClassFields()
Definition: classifiercodedocument.cpp:543
ClassifierCodeDocument::addCodeClassField
bool addCodeClassField(CodeClassField *add_object)
Definition: classifiercodedocument.cpp:186
ClassifierCodeDocument::removeCodeClassField
bool removeCodeClassField(CodeClassField *remove_object)
Definition: classifiercodedocument.cpp:228
ClassifierCodeDocument::~ClassifierCodeDocument
virtual ~ClassifierCodeDocument()
Definition: classifiercodedocument.cpp:43
ClassifierCodeDocument::syncClassFields
void syncClassFields()
Definition: classifiercodedocument.cpp:496
ClassifierCodeDocument::hasAttributeClassFields
bool hasAttributeClassFields() const
Definition: classifiercodedocument.cpp:174
ClassifierCodeDocument::removeOperation
void removeOperation(UMLClassifierListItem *obj)
Definition: classifiercodedocument.cpp:335
ClassifierCodeDocument::init
void init(UMLClassifier *classifier)
Definition: classifiercodedocument.cpp:431
CodeClassField
Definition: codeclassfield.h:26
CodeClassField::ClassFieldType
ClassFieldType
Definition: codeclassfield.h:30
CodeDocument
Definition: codedocument.h:30
CodeGenObjectWithTextBlocks
Definition: codegenobjectwithtextblocks.h:29
CodeOperation
Definition: codeoperation.h:20
HierarchicalCodeBlock
Definition: hierarchicalcodeblock.h:21
TextBlock
Definition: textblock.h:23
UMLAssociation
Sets up association information.
Definition: umlassociation.h:29
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.h:35
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: umlclassifierlistitem.h:25
codeaccessormethod.h
codeclassfield.h
codeclassfieldlist.h
CodeClassFieldList
QList< CodeClassField * > CodeClassFieldList
Definition: codeclassfieldlist.h:14
codedocument.h
codeoperation.h
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
visibility
Definition: visibility.py:1
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:14
umlclassifier.h