umbrello: umbrello/uml1model/stereotype.h Source File

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

stereotype.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2003-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef STEREOTYPE_H
12 #define STEREOTYPE_H
13
14 #include "umlobject.h"
15
40 class UMLStereotype : public UMLObject
41 {
42 Q_OBJECT
43 public:
44 explicit UMLStereotype(const QString &name, Uml::ID::Type id = Uml::ID::None);
45 UMLStereotype();
46
47 virtual ~UMLStereotype();
48
49 bool operator==(const UMLStereotype &rhs) const;
50
51 virtual void copyInto(UMLObject *lhs) const;
52
53 virtual UMLObject* clone() const;
54
55 void incrRefCount();
56 void decrRefCount();
57
58 int refCount() const;
59
60 QString name(bool includeAdornments=false) const;
61
62 class AttributeDef
63 {
64 public:
65 QString name;
66 Uml::PrimitiveTypes::Enum type;
67 QString defaultVal;
68 AttributeDef() : type(Uml::PrimitiveTypes::String) {}
69 AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal = QString())
70 : name(nm), type(t), defaultVal(dfltVal) {}
71 virtual ~AttributeDef() {}
72 };
73
74 typedef QVector<AttributeDef> AttributeDefs;
75
76 void clearAttributeDefs();
77 void setAttributeDefs(const AttributeDefs& adefs);
78 const AttributeDefs& getAttributeDefs() const;
79 AttributeDefs& getAttributeDefs();
80
81 void saveToXMI1(QXmlStreamWriter& writer);
82 bool load1(QDomElement& element);
83
84 virtual bool showPropertiesDialog(QWidget* parent);
85
86 protected:
87 int m_refCount;
88 AttributeDefs m_attrDefs;
89
90 };
91
92 #endif
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
UMLStereotype::AttributeDef
Definition: stereotype.h:63
UMLStereotype::AttributeDef::defaultVal
QString defaultVal
Definition: stereotype.h:67
UMLStereotype::AttributeDef::AttributeDef
AttributeDef()
Definition: stereotype.h:68
UMLStereotype::AttributeDef::AttributeDef
AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal=QString())
Definition: stereotype.h:69
UMLStereotype::AttributeDef::name
QString name
Definition: stereotype.h:65
UMLStereotype::AttributeDef::type
Uml::PrimitiveTypes::Enum type
Definition: stereotype.h:66
UMLStereotype::AttributeDef::~AttributeDef
virtual ~AttributeDef()
Definition: stereotype.h:71
UMLStereotype
Sets up stereotype information.
Definition: stereotype.h:41
UMLStereotype::m_attrDefs
AttributeDefs m_attrDefs
Definition: stereotype.h:88
UMLStereotype::getAttributeDefs
const AttributeDefs & getAttributeDefs() const
Definition: stereotype.cpp:114
UMLStereotype::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: stereotype.cpp:130
UMLStereotype::load1
bool load1(QDomElement &element)
Definition: stereotype.cpp:153
UMLStereotype::m_refCount
int m_refCount
Definition: stereotype.h:87
UMLStereotype::clone
virtual UMLObject * clone() const
Definition: stereotype.cpp:87
UMLStereotype::~UMLStereotype
virtual ~UMLStereotype()
Definition: stereotype.cpp:54
UMLStereotype::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: stereotype.cpp:79
UMLStereotype::UMLStereotype
UMLStereotype()
Definition: stereotype.cpp:44
UMLStereotype::refCount
int refCount() const
Definition: stereotype.cpp:221
UMLStereotype::clearAttributeDefs
void clearAttributeDefs()
Definition: stereotype.cpp:98
UMLStereotype::setAttributeDefs
void setAttributeDefs(const AttributeDefs &adefs)
Definition: stereotype.cpp:106
UMLStereotype::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent)
Definition: stereotype.cpp:191
UMLStereotype::operator==
bool operator==(const UMLStereotype &rhs) const
Definition: stereotype.cpp:62
UMLStereotype::decrRefCount
void decrRefCount()
Definition: stereotype.cpp:213
UMLStereotype::AttributeDefs
QVector< AttributeDef > AttributeDefs
size is at most N_STEREOATTRS
Definition: stereotype.h:74
UMLStereotype::incrRefCount
void incrRefCount()
Definition: stereotype.cpp:205
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
Uml::ID::Type
std::string Type
Definition: basictypes.h:385
Uml::PrimitiveTypes::Enum
Enum
Definition: basictypes.h:283
Uml::PrimitiveTypes::String
@ String
Definition: basictypes.h:284
Uml
Definition: basictypes.cpp:37
umlobject.h