umbrello: umbrello/uml1model/entityattribute.h Source File

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

entityattribute.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef ENTITYATTRIBUTE_H
7#define ENTITYATTRIBUTE_H
8
9#include "attribute.h"
10#include "basictypes.h"
11
20 class UMLEntityAttribute : public UMLAttribute
21{
22 Q_OBJECT
23 Q_ENUMS(DBIndex_Type)
24public:
25 enum DBIndex_Type
26 {
27 None = 1100,
28 Primary,
29 Index,
30 Unique
31 };
32
33 UMLEntityAttribute(UMLObject* parent, const QString& name,
34 Uml::ID::Type id = Uml::ID::None,
35 Uml::Visibility::Enum s = Uml::Visibility::Private,
36 UMLObject *type = 0, const QString& iv = QString());
37 explicit UMLEntityAttribute(UMLObject* parent);
38 virtual ~UMLEntityAttribute();
39
40 bool operator==(const UMLEntityAttribute& rhs) const;
41
42 virtual void copyInto(UMLObject *lhs) const;
43
44 virtual UMLObject* clone() const;
45
46 void setAttributes(const QString& attributes);
47 QString getAttributes() const;
48
49 void setIndexType(const DBIndex_Type indexType);
50 DBIndex_Type indexType() const;
51
52 void setValues(const QString& values);
53 QString getValues() const;
54
55 void setAutoIncrement(const bool autoIncrement);
56 bool getAutoIncrement() const;
57
58 void setNull(const bool null);
59 bool getNull() const;
60
61 QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig,
62 bool withStereotype=false) const;
63
64 virtual void saveToXMI1(QXmlStreamWriter& writer);
65
66 virtual bool showPropertiesDialog(QWidget* parent = 0);
67
68protected:
69 void init();
70
71 bool load1(QDomElement& element);
72
73private:
74 DBIndex_Type m_indexType;
75 QString m_values;
76 QString m_attributes;
77 bool m_autoIncrement;
78 bool m_null;
79};
80
81#endif
attribute.h
basictypes.h
UMLAttribute
Sets up attribute information.
Definition: attribute.h:23
UMLEntityAttribute
Sets up entityattribute information.
Definition: entityattribute.h:21
UMLEntityAttribute::~UMLEntityAttribute
virtual ~UMLEntityAttribute()
Definition: entityattribute.cpp:50
UMLEntityAttribute::m_attributes
QString m_attributes
Definition: entityattribute.h:76
UMLEntityAttribute::load1
bool load1(QDomElement &element)
Definition: entityattribute.cpp:253
UMLEntityAttribute::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: entityattribute.cpp:269
UMLEntityAttribute::setValues
void setValues(const QString &values)
Definition: entityattribute.cpp:97
UMLEntityAttribute::init
void init()
Definition: entityattribute.cpp:58
UMLEntityAttribute::setAutoIncrement
void setAutoIncrement(const bool autoIncrement)
Definition: entityattribute.cpp:115
UMLEntityAttribute::setAttributes
void setAttributes(const QString &attributes)
Definition: entityattribute.cpp:79
UMLEntityAttribute::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: entityattribute.cpp:204
UMLEntityAttribute::getAutoIncrement
bool getAutoIncrement() const
Definition: entityattribute.cpp:106
UMLEntityAttribute::setNull
void setNull(const bool null)
Definition: entityattribute.cpp:151
UMLEntityAttribute::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false) const
Definition: entityattribute.cpp:161
UMLEntityAttribute::getValues
QString getValues() const
Definition: entityattribute.cpp:88
UMLEntityAttribute::m_values
QString m_values
Definition: entityattribute.h:75
UMLEntityAttribute::indexType
DBIndex_Type indexType() const
Definition: entityattribute.cpp:124
UMLEntityAttribute::m_null
bool m_null
Definition: entityattribute.h:78
UMLEntityAttribute::m_autoIncrement
bool m_autoIncrement
Definition: entityattribute.h:77
UMLEntityAttribute::m_indexType
DBIndex_Type m_indexType
Definition: entityattribute.h:74
UMLEntityAttribute::operator==
bool operator==(const UMLEntityAttribute &rhs) const
Definition: entityattribute.cpp:184
UMLEntityAttribute::DBIndex_Type
DBIndex_Type
Definition: entityattribute.h:26
UMLEntityAttribute::Index
@ Index
Definition: entityattribute.h:29
UMLEntityAttribute::None
@ None
Definition: entityattribute.h:27
UMLEntityAttribute::Unique
@ Unique
Definition: entityattribute.h:30
UMLEntityAttribute::Primary
@ Primary
Definition: entityattribute.h:28
UMLEntityAttribute::setIndexType
void setIndexType(const DBIndex_Type indexType)
Definition: entityattribute.cpp:133
UMLEntityAttribute::getAttributes
QString getAttributes() const
Definition: entityattribute.cpp:70
UMLEntityAttribute::saveToXMI1
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: entityattribute.cpp:232
UMLEntityAttribute::clone
virtual UMLObject * clone() const
Definition: entityattribute.cpp:221
UMLEntityAttribute::UMLEntityAttribute
UMLEntityAttribute(UMLObject *parent, const QString &name, Uml::ID::Type id=Uml::ID::None, Uml::Visibility::Enum s=Uml::Visibility::Private, UMLObject *type=0, const QString &iv=QString())
Definition: entityattribute.cpp:29
UMLEntityAttribute::getNull
bool getNull() const
Definition: entityattribute.cpp:142
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:206
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
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:160
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:161
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
Uml::Visibility::Private
@ Private
Definition: basictypes.h:47