umbrello: umbrello/umlmodel/enum.h Source File

umbrello 2.38.3 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

enum.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 "classifier.h"
10
11class UMLEnumLiteral;
12
23 class UMLEnum : public UMLClassifier
24{
25 Q_OBJECT
26public:
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 = 0);
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
56signals:
57 void enumLiteralAdded(UMLClassifierListItem*);
58 void enumLiteralRemoved(UMLClassifierListItem*);
59
60protected:
61 bool load1(QDomElement & element);
62
63private:
64 void init();
65
66};
67
68#endif // ENUM_H
69
IDChangeLog
Definition: idchangelog.h:22
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:25
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLEnumLiteral
Sets up attribute information.
Definition: enumliteral.h:21
UMLEnum
Non-graphical Information for an Enum.
Definition: enum.h:24
UMLEnum::makeChildObject
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
Definition: enum.cpp:298
UMLEnum::enumLiteralRemoved
void enumLiteralRemoved(UMLClassifierListItem *)
UMLEnum::createEnumLiteral
UMLObject * createEnumLiteral(const QString &name=QString())
Definition: enum.cpp:83
UMLEnum::operator==
bool operator==(const UMLEnum &rhs) const
Definition: enum.cpp:45
UMLEnum::enumLiteralAdded
void enumLiteralAdded(UMLClassifierListItem *)
UMLEnum::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: enum.cpp:239
UMLEnum::load1
bool load1(QDomElement &element)
Definition: enum.cpp:259
UMLEnum::~UMLEnum
virtual ~UMLEnum()
Definition: enum.cpp:37
UMLEnum::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: enum.cpp:54
UMLEnum::enumLiterals
int enumLiterals() const
Definition: enum.cpp:223
UMLEnum::signalEnumLiteralRemoved
void signalEnumLiteralRemoved(UMLClassifierListItem *elit)
Definition: enum.cpp:231
UMLEnum::clone
virtual UMLObject * clone() const
Definition: enum.cpp:62
UMLEnum::addEnumLiteral
UMLObject * addEnumLiteral(const QString &name, Uml::ID::Type id=Uml::ID::None, const QString &value=QString())
Definition: enum.cpp:131
UMLEnum::init
void init()
Definition: enum.cpp:73
UMLEnum::removeEnumLiteral
int removeEnumLiteral(UMLEnumLiteral *literal)
Definition: enum.cpp:204
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
classifier.h
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