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 
63  {
64  public:
65  QString name;
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;
80 
81  void saveToXMI1(QXmlStreamWriter& writer);
82  bool load1(QDomElement& element);
83 
84  virtual bool showPropertiesDialog(QWidget* parent);
85 
86 protected:
89 
90 };
91 
92 #endif
The base class for UML objects.
Definition: umlobject.h:75
QString name() const
Definition: umlobject.cpp:211
Definition: stereotype.h:63
QString defaultVal
Definition: stereotype.h:67
AttributeDef()
Definition: stereotype.h:68
AttributeDef(QString nm, Uml::PrimitiveTypes::Enum t, QString dfltVal=QString())
Definition: stereotype.h:69
QString name
Definition: stereotype.h:65
Uml::PrimitiveTypes::Enum type
Definition: stereotype.h:66
virtual ~AttributeDef()
Definition: stereotype.h:71
Sets up stereotype information.
Definition: stereotype.h:41
AttributeDefs m_attrDefs
Definition: stereotype.h:88
const AttributeDefs & getAttributeDefs() const
Definition: stereotype.cpp:114
void saveToXMI1(QXmlStreamWriter &writer)
Definition: stereotype.cpp:130
bool load1(QDomElement &element)
Definition: stereotype.cpp:153
int m_refCount
Definition: stereotype.h:87
virtual UMLObject * clone() const
Definition: stereotype.cpp:87
virtual ~UMLStereotype()
Definition: stereotype.cpp:54
virtual void copyInto(UMLObject *lhs) const
Definition: stereotype.cpp:79
UMLStereotype()
Definition: stereotype.cpp:44
int refCount() const
Definition: stereotype.cpp:221
void clearAttributeDefs()
Definition: stereotype.cpp:98
void setAttributeDefs(const AttributeDefs &adefs)
Definition: stereotype.cpp:106
virtual bool showPropertiesDialog(QWidget *parent)
Definition: stereotype.cpp:191
bool operator==(const UMLStereotype &rhs) const
Definition: stereotype.cpp:62
void decrRefCount()
Definition: stereotype.cpp:213
QVector< AttributeDef > AttributeDefs
size is at most N_STEREOATTRS
Definition: stereotype.h:74
void incrRefCount()
Definition: stereotype.cpp:205
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
std::string Type
Definition: basictypes.h:385
Enum
Definition: basictypes.h:283
@ String
Definition: basictypes.h:284
Definition: basictypes.cpp:37