umbrello  2.39.2
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  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 
58  {
59  public:
60  QString name;
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;
75 
76  void saveToXMI(QXmlStreamWriter& writer);
77  bool load1(QDomElement& element);
78 
79  virtual bool showPropertiesDialog(QWidget* parent);
80 
81 protected:
84 
85 };
86 
87 #endif
The base class for UML objects.
Definition: umlobject.h:70
QString name() const
Definition: umlobject.cpp:207
Definition: stereotype.h:58
QString defaultVal
Definition: stereotype.h:62
AttributeDef()
Definition: stereotype.h:63
AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal=QString())
Definition: stereotype.h:64
QString name
Definition: stereotype.h:60
Uml::PrimitiveTypes::Enum type
Definition: stereotype.h:61
virtual ~AttributeDef()
Definition: stereotype.h:66
Sets up stereotype information.
Definition: stereotype.h:36
AttributeDefs m_attrDefs
Definition: stereotype.h:83
const AttributeDefs & getAttributeDefs() const
Definition: stereotype.cpp:111
bool load1(QDomElement &element)
Definition: stereotype.cpp:156
int m_refCount
Definition: stereotype.h:82
void saveToXMI(QXmlStreamWriter &writer)
Definition: stereotype.cpp:127
virtual UMLObject * clone() const
Definition: stereotype.cpp:84
virtual ~UMLStereotype()
Definition: stereotype.cpp:51
virtual void copyInto(UMLObject *lhs) const
Definition: stereotype.cpp:76
UMLStereotype()
Definition: stereotype.cpp:41
int refCount() const
Definition: stereotype.cpp:224
void clearAttributeDefs()
Definition: stereotype.cpp:95
void setAttributeDefs(const AttributeDefs &adefs)
Definition: stereotype.cpp:103
virtual bool showPropertiesDialog(QWidget *parent)
Definition: stereotype.cpp:194
bool operator==(const UMLStereotype &rhs) const
Definition: stereotype.cpp:59
void decrRefCount()
Definition: stereotype.cpp:216
QVector< AttributeDef > AttributeDefs
size is at most N_STEREOATTRS
Definition: stereotype.h:69
void incrRefCount()
Definition: stereotype.cpp:208
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
std::string Type
Definition: basictypes.h:371
Enum
Definition: basictypes.h:269
@ String
Definition: basictypes.h:270
Definition: basictypes.cpp:18