umbrello 26.03.70-1a62d36 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

umlenum.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2003-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef ENUM_H
7#define ENUM_H
8
9#include "umlclassifier.h"
10
11 class UMLEnumLiteral;
12
23 class UMLEnum : public UMLClassifier
24{
25 Q_OBJECT
26 public:
27 explicit UMLEnum(const QString& name = QString(), Uml::ID::Type id = Uml::ID::None);
28
29 virtual ~UMLEnum();
30
31 bool operator==(const UMLEnum& rhs) const;
32
33 virtual void copyInto(UMLObject *lhs) const;
34
35 virtual UMLObject* clone() const;
36
37 UMLObject* createEnumLiteral(const QString& name = QString());
38
39 UMLObject* addEnumLiteral(const QString &name,
40 Uml::ID::Type id = Uml::ID::None,
41 const QString& value = QString());
42
43 bool addEnumLiteral(UMLEnumLiteral *literal, IDChangeLog *Log = nullptr);
44 bool addEnumLiteral(UMLEnumLiteral* literal, int position);
45
46 int removeEnumLiteral(UMLEnumLiteral* literal);
47
48 int enumLiterals() const;
49
50 void signalEnumLiteralRemoved(UMLClassifierListItem *elit);
51
52 virtual void saveToXMI(QXmlStreamWriter& writer);
53
54 virtual UMLClassifierListItem* makeChildObject(const QString& xmiTag);
55
56Q_SIGNALS:
57 void enumLiteralAdded(UMLClassifierListItem*);
58 void enumLiteralRemoved(UMLClassifierListItem*);
59
60 protected:
61 bool load1(QDomElement & element);
62
63 private:
64 void init();
65
66};
67
68#endif // ENUM_H
69
IDChangeLog
Definition: idchangelog.h:22
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
UMLEnum
Non-graphical Information for an Enum.
Definition: umlenum.h:24
UMLEnum::makeChildObject
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
Definition: umlenum.cpp:298
UMLEnum::enumLiteralRemoved
void enumLiteralRemoved(UMLClassifierListItem *)
UMLEnum::createEnumLiteral
UMLObject * createEnumLiteral(const QString &name=QString())
Definition: umlenum.cpp:83
UMLEnum::operator==
bool operator==(const UMLEnum &rhs) const
Definition: umlenum.cpp:45
UMLEnum::enumLiteralAdded
void enumLiteralAdded(UMLClassifierListItem *)
UMLEnum::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: umlenum.cpp:239
UMLEnum::load1
bool load1(QDomElement &element)
Definition: umlenum.cpp:259
UMLEnum::~UMLEnum
virtual ~UMLEnum()
Definition: umlenum.cpp:37
UMLEnum::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlenum.cpp:54
UMLEnum::enumLiterals
int enumLiterals() const
Definition: umlenum.cpp:223
UMLEnum::signalEnumLiteralRemoved
void signalEnumLiteralRemoved(UMLClassifierListItem *elit)
Definition: umlenum.cpp:231
UMLEnum::clone
virtual UMLObject * clone() const
Definition: umlenum.cpp:62
UMLEnum::addEnumLiteral
UMLObject * addEnumLiteral(const QString &name, Uml::ID::Type id=Uml::ID::None, const QString &value=QString())
Definition: umlenum.cpp:131
UMLEnum::init
void init()
Definition: umlenum.cpp:73
UMLEnum::removeEnumLiteral
int removeEnumLiteral(UMLEnumLiteral *literal)
Definition: umlenum.cpp:204
UMLEnumLiteral
Sets up attribute information.
Definition: umlenumliteral.h:21
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
umlclassifier.h