umbrello: umbrello/umlmodel/umlcanvasobject.h Source File

umbrello 2.38.2 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

umlcanvasobject.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2021 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
35public:
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) const;
49
50 int removeAssociationEnd(UMLAssociation *assoc);
51
52 void removeAllAssociationEnds();
53
54 int associations() const;
55
56 UMLAssociationList getAssociations() const;
57
58 UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType) const;
59
60 UMLClassifierList getSuperClasses(bool withRealizations = true) const;
61 UMLClassifierList getSubClasses() const;
62
63 virtual UMLAssociationList getRealizations() const;
64
65 UMLAssociationList getAggregations() const;
66 UMLAssociationList getCompositions() const;
67 UMLAssociationList getRelationships() const;
68
69 virtual UMLObject *findChildObject(const QString &n,
70 UMLObject::ObjectType t = UMLObject::ot_UMLObject) const;
71 virtual UMLObject *findChildObjectById(Uml::ID::Type id, bool considerAncestors = false) const;
72
73 virtual QString uniqChildName(const UMLObject::ObjectType type,
74 const QString &prefix = QString()) const;
75 virtual void removeAllChildObjects();
76
77 UMLObjectList &subordinates() const {
78 m_List.removeAll(0);
79 return m_List;
80 }
81
82 virtual bool resolveRef();
83
84 // The abstract method UMLObject::saveToXMI() is implemented
85 // in the classes inheriting from UMLCanvasObject.
86
87private:
88
97 mutable UMLObjectList m_List;
98
99signals:
100
101 void sigAssociationEndAdded(UMLAssociation * assoc);
102 void sigAssociationEndRemoved(UMLAssociation * assoc);
103
104};
105
106#endif
UMLAssociation
Sets up association information.
Definition: association.h:29
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:32
UMLCanvasObject::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false) const
Definition: umlcanvasobject.cpp:260
UMLCanvasObject::~UMLCanvasObject
virtual ~UMLCanvasObject()
Definition: umlcanvasobject.cpp:40
UMLCanvasObject::hasAssociation
bool hasAssociation(UMLAssociation *assoc) const
Definition: umlcanvasobject.cpp:97
UMLCanvasObject::m_List
UMLObjectList m_List
Definition: umlcanvasobject.h:97
UMLCanvasObject::getAssociations
UMLAssociationList getAssociations() const
Definition: umlcanvasobject.cpp:328
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString()) const
Definition: umlcanvasobject.cpp:178
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject) const
Definition: umlcanvasobject.cpp:237
UMLCanvasObject::getRelationships
UMLAssociationList getRelationships() const
Definition: umlcanvasobject.cpp:433
UMLCanvasObject::getRealizations
virtual UMLAssociationList getRealizations() const
Definition: umlcanvasobject.cpp:403
UMLCanvasObject::operator==
bool operator==(const UMLCanvasObject &rhs) const
Definition: umlcanvasobject.cpp:273
UMLCanvasObject::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlcanvasobject.cpp:297
UMLCanvasObject::resolveRef
virtual bool resolveRef()
Definition: umlcanvasobject.cpp:441
UMLCanvasObject::associations
int associations() const
Definition: umlcanvasobject.cpp:313
UMLCanvasObject::getSpecificAssocs
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType) const
Definition: umlcanvasobject.cpp:57
UMLCanvasObject::subordinates
UMLObjectList & subordinates() const
Definition: umlcanvasobject.h:77
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true) const
Definition: umlcanvasobject.cpp:348
UMLCanvasObject::removeAllAssociationEnds
void removeAllAssociationEnds()
Definition: umlcanvasobject.cpp:125
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations() const
Definition: umlcanvasobject.cpp:413
UMLCanvasObject::removeAllChildObjects
virtual void removeAllChildObjects()
Definition: umlcanvasobject.cpp:159
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions() const
Definition: umlcanvasobject.cpp:423
UMLCanvasObject::removeAssociationEnd
int removeAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:110
UMLCanvasObject::sigAssociationEndAdded
void sigAssociationEndAdded(UMLAssociation *assoc)
UMLCanvasObject::sigAssociationEndRemoved
void sigAssociationEndRemoved(UMLAssociation *assoc)
UMLCanvasObject::getSubClasses
UMLClassifierList getSubClasses() const
Definition: umlcanvasobject.cpp:377
UMLCanvasObject::addAssociationEnd
bool addAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:76
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:207
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:14
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:14
umlobject.h
umlobjectlist.h