umbrello: umbrello/uml1model/umlcanvasobject.h Source File

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

umlcanvasobject.h
Go to the documentation of this file.
1 /*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4 */
5
6 #ifndef CANVASOBJECT_H
7 #define CANVASOBJECT_H
8
9 #include "umlobject.h"
10 #include "umlobjectlist.h"
11 #include "umlclassifierlist.h"
12 #include "umlassociationlist.h"
13
31 class UMLCanvasObject : public UMLObject
32 {
33 Q_OBJECT
34
35 public:
36 explicit UMLCanvasObject(const QString & name = QString(), Uml::ID::Type id = Uml::ID::None);
37 virtual ~UMLCanvasObject();
38
39 bool operator==(const UMLCanvasObject& rhs) const;
40
41 virtual void copyInto(UMLObject *lhs) const;
42
43 // The abstract method UMLObject::clone() is implemented
44 // in the classes inheriting from UMLCanvasObject.
45
46 bool addAssociationEnd(UMLAssociation* assoc);
47
48 bool hasAssociation(UMLAssociation* assoc);
49
50 int removeAssociationEnd(UMLAssociation *assoc);
51
52 void removeAllAssociationEnds();
53
54 int associations();
55
56 UMLAssociationList getAssociations();
57
58 UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType);
59
60 UMLClassifierList getSuperClasses(bool withRealizations = true);
61 UMLClassifierList getSubClasses();
62
63 virtual UMLAssociationList getRealizations();
64
65 UMLAssociationList getAggregations();
66 UMLAssociationList getCompositions();
67 UMLAssociationList getRelationships();
68
69 virtual UMLObject *findChildObject(const QString &n,
70 UMLObject::ObjectType t = UMLObject::ot_UMLObject);
71 virtual UMLObject *findChildObjectById(Uml::ID::Type id, bool considerAncestors = false);
72
73 virtual QString uniqChildName(const UMLObject::ObjectType type,
74 const QString &prefix = QString());
75
76 virtual void removeAllChildObjects();
77
78 UMLObjectList &subordinates() const {
79 m_List.removeAll(0);
80 return m_List;
81 }
82
83 virtual bool resolveRef();
84
85 // The abstract method UMLObject::saveToXMI1() is implemented
86 // in the classes inheriting from UMLCanvasObject.
87
88 private:
89
98 mutable UMLObjectList m_List;
99
100 signals:
101
102 void sigAssociationEndAdded(UMLAssociation * assoc);
103 void sigAssociationEndRemoved(UMLAssociation * assoc);
104
105 };
106
107 #endif
UMLAssociation
Sets up association information.
Definition: association.h:29
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:32
UMLCanvasObject::getAssociations
UMLAssociationList getAssociations()
Definition: umlcanvasobject.cpp:324
UMLCanvasObject::UMLCanvasObject
UMLCanvasObject(const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
Definition: umlcanvasobject.cpp:32
UMLCanvasObject::~UMLCanvasObject
virtual ~UMLCanvasObject()
Definition: umlcanvasobject.cpp:40
UMLCanvasObject::m_List
UMLObjectList m_List
Definition: umlcanvasobject.h:98
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:344
UMLCanvasObject::operator==
bool operator==(const UMLCanvasObject &rhs) const
Definition: umlcanvasobject.cpp:269
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Definition: umlcanvasobject.cpp:233
UMLCanvasObject::associations
int associations()
Definition: umlcanvasobject.cpp:309
UMLCanvasObject::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlcanvasobject.cpp:293
UMLCanvasObject::subordinates
UMLObjectList & subordinates() const
Definition: umlcanvasobject.h:78
UMLCanvasObject::getSubClasses
UMLClassifierList getSubClasses()
Definition: umlcanvasobject.cpp:372
UMLCanvasObject::getRelationships
UMLAssociationList getRelationships()
Definition: umlcanvasobject.cpp:427
UMLCanvasObject::resolveRef
virtual bool resolveRef()
Definition: umlcanvasobject.cpp:435
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:417
UMLCanvasObject::removeAllAssociationEnds
void removeAllAssociationEnds()
Definition: umlcanvasobject.cpp:124
UMLCanvasObject::getRealizations
virtual UMLAssociationList getRealizations()
Definition: umlcanvasobject.cpp:397
UMLCanvasObject::getSpecificAssocs
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Definition: umlcanvasobject.cpp:56
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Definition: umlcanvasobject.cpp:175
UMLCanvasObject::removeAllChildObjects
virtual void removeAllChildObjects()
Definition: umlcanvasobject.cpp:156
UMLCanvasObject::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Definition: umlcanvasobject.cpp:256
UMLCanvasObject::removeAssociationEnd
int removeAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:109
UMLCanvasObject::sigAssociationEndAdded
void sigAssociationEndAdded(UMLAssociation *assoc)
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:407
UMLCanvasObject::hasAssociation
bool hasAssociation(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:96
UMLCanvasObject::sigAssociationEndRemoved
void sigAssociationEndRemoved(UMLAssociation *assoc)
UMLCanvasObject::addAssociationEnd
bool addAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:75
UMLObjectList
Definition: umlobjectlist.h:25
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:76
UMLObject::ot_UMLObject
@ ot_UMLObject
Definition: umlobject.h:78
UMLObject::name
QString name() const
Definition: umlobject.cpp:206
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:92
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
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:12
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:12
umlobject.h
umlobjectlist.h