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

umlstereotype.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
38 public:
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
81 protected:
82 int m_refCount;
83 AttributeDefs m_attrDefs;
84
85};
86
87 Q_DECLARE_METATYPE(UMLStereotype*);
88
89#endif
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:207
UMLStereotype::AttributeDef
Definition: umlstereotype.h:58
UMLStereotype::AttributeDef::defaultVal
QString defaultVal
Definition: umlstereotype.h:62
UMLStereotype::AttributeDef::AttributeDef
AttributeDef()
Definition: umlstereotype.h:63
UMLStereotype::AttributeDef::AttributeDef
AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal=QString())
Definition: umlstereotype.h:64
UMLStereotype::AttributeDef::name
QString name
Definition: umlstereotype.h:60
UMLStereotype::AttributeDef::type
Uml::PrimitiveTypes::Enum type
Definition: umlstereotype.h:61
UMLStereotype::AttributeDef::~AttributeDef
virtual ~AttributeDef()
Definition: umlstereotype.h:66
UMLStereotype
Sets up stereotype information.
Definition: umlstereotype.h:36
UMLStereotype::m_attrDefs
AttributeDefs m_attrDefs
Definition: umlstereotype.h:83
UMLStereotype::getAttributeDefs
const AttributeDefs & getAttributeDefs() const
Definition: umlstereotype.cpp:111
UMLStereotype::load1
bool load1(QDomElement &element)
Definition: umlstereotype.cpp:156
UMLStereotype::m_refCount
int m_refCount
Definition: umlstereotype.h:82
UMLStereotype::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition: umlstereotype.cpp:127
UMLStereotype::clone
virtual UMLObject * clone() const
Definition: umlstereotype.cpp:84
UMLStereotype::~UMLStereotype
virtual ~UMLStereotype()
Definition: umlstereotype.cpp:51
UMLStereotype::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlstereotype.cpp:76
UMLStereotype::UMLStereotype
UMLStereotype()
Definition: umlstereotype.cpp:41
UMLStereotype::refCount
int refCount() const
Definition: umlstereotype.cpp:224
UMLStereotype::clearAttributeDefs
void clearAttributeDefs()
Definition: umlstereotype.cpp:95
UMLStereotype::setAttributeDefs
void setAttributeDefs(const AttributeDefs &adefs)
Definition: umlstereotype.cpp:103
UMLStereotype::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent)
Definition: umlstereotype.cpp:194
UMLStereotype::operator==
bool operator==(const UMLStereotype &rhs) const
Definition: umlstereotype.cpp:59
UMLStereotype::decrRefCount
void decrRefCount()
Definition: umlstereotype.cpp:216
UMLStereotype::AttributeDefs
QVector< AttributeDef > AttributeDefs
size is at most N_STEREOATTRS
Definition: umlstereotype.h:69
UMLStereotype::incrRefCount
void incrRefCount()
Definition: umlstereotype.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:17
umlobject.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(UMLStereotype *)