umbrello: umbrello/umlmodel/stereotype.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

stereotype.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 STEREOTYPE_H
7#define STEREOTYPE_H
8
9#include "umlobject.h"
10
35 class UMLStereotype : public UMLObject
36{
37 Q_OBJECT
38public:
39 explicit UMLStereotype(const QString &name, Uml::ID::Type id = Uml::ID::None);
40 UMLStereotype();
41
42 virtual ~UMLStereotype();
43
44 bool operator==(const UMLStereotype &rhs) const;
45
46 virtual void copyInto(UMLObject *lhs) const;
47
48 virtual UMLObject* clone() const;
49
50 void incrRefCount();
51 void decrRefCount();
52
53 int refCount() const;
54
55 QString name(bool includeAdornments=false) const;
56
57 class AttributeDef
58 {
59 public:
60 QString name;
61 Uml::PrimitiveTypes::Enum type;
62 QString defaultVal;
63 AttributeDef() : type(Uml::PrimitiveTypes::String) {}
64 AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal = QString())
65 : name(nm), type(t), defaultVal(dfltVal) {}
66 virtual ~AttributeDef() {}
67 };
68
69 typedef QVector<AttributeDef> AttributeDefs;
70
71 void clearAttributeDefs();
72 void setAttributeDefs(const AttributeDefs& adefs);
73 const AttributeDefs& getAttributeDefs() const;
74 AttributeDefs& getAttributeDefs();
75
76 void saveToXMI(QXmlStreamWriter& writer);
77 bool load1(QDomElement& element);
78
79 virtual bool showPropertiesDialog(QWidget* parent);
80
81protected:
82 int m_refCount;
83 AttributeDefs m_attrDefs;
84
85};
86
87#endif
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
UMLStereotype::AttributeDef
Definition: stereotype.h:58
UMLStereotype::AttributeDef::defaultVal
QString defaultVal
Definition: stereotype.h:62
UMLStereotype::AttributeDef::AttributeDef
AttributeDef()
Definition: stereotype.h:63
UMLStereotype::AttributeDef::AttributeDef
AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal=QString())
Definition: stereotype.h:64
UMLStereotype::AttributeDef::name
QString name
Definition: stereotype.h:60
UMLStereotype::AttributeDef::type
Uml::PrimitiveTypes::Enum type
Definition: stereotype.h:61
UMLStereotype::AttributeDef::~AttributeDef
virtual ~AttributeDef()
Definition: stereotype.h:66
UMLStereotype
Sets up stereotype information.
Definition: stereotype.h:36
UMLStereotype::m_attrDefs
AttributeDefs m_attrDefs
Definition: stereotype.h:83
UMLStereotype::getAttributeDefs
const AttributeDefs & getAttributeDefs() const
Definition: stereotype.cpp:111
UMLStereotype::load1
bool load1(QDomElement &element)
Definition: stereotype.cpp:156
UMLStereotype::m_refCount
int m_refCount
Definition: stereotype.h:82
UMLStereotype::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: stereotype.cpp:127
UMLStereotype::clone
virtual UMLObject * clone() const
Definition: stereotype.cpp:84
UMLStereotype::~UMLStereotype
virtual ~UMLStereotype()
Definition: stereotype.cpp:51
UMLStereotype::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: stereotype.cpp:76
UMLStereotype::UMLStereotype
UMLStereotype()
Definition: stereotype.cpp:41
UMLStereotype::refCount
int refCount() const
Definition: stereotype.cpp:224
UMLStereotype::clearAttributeDefs
void clearAttributeDefs()
Definition: stereotype.cpp:95
UMLStereotype::setAttributeDefs
void setAttributeDefs(const AttributeDefs &adefs)
Definition: stereotype.cpp:103
UMLStereotype::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent)
Definition: stereotype.cpp:194
UMLStereotype::operator==
bool operator==(const UMLStereotype &rhs) const
Definition: stereotype.cpp:59
UMLStereotype::decrRefCount
void decrRefCount()
Definition: stereotype.cpp:216
UMLStereotype::AttributeDefs
QVector< AttributeDef > AttributeDefs
size is at most N_STEREOATTRS
Definition: stereotype.h:69
UMLStereotype::incrRefCount
void incrRefCount()
Definition: stereotype.cpp:208
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::PrimitiveTypes::Enum
Enum
Definition: basictypes.h:269
Uml
Definition: basictypes.cpp:18
umlobject.h