umbrello: umbrello/uml1model/umlcanvasobject.h Source File

umbrello 2.32.3 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 * 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) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef CANVASOBJECT_H
12 #define CANVASOBJECT_H
13
14 #include "umlobject.h"
15 #include "umlobjectlist.h"
16 #include "umlclassifierlist.h"
17 #include "umlassociationlist.h"
18
33 class UMLCanvasObject : public UMLObject
34 {
35 Q_OBJECT
36
37 public:
38 explicit UMLCanvasObject(const QString & name = QString(), Uml::ID::Type id = Uml::ID::None);
39 virtual ~UMLCanvasObject();
40
41 bool operator==(const UMLCanvasObject& rhs) const;
42
43 virtual void copyInto(UMLObject *lhs) const;
44
45 // The abstract method UMLObject::clone() is implemented
46 // in the classes inheriting from UMLCanvasObject.
47
48 bool addAssociationEnd(UMLAssociation* assoc);
49
50 bool hasAssociation(UMLAssociation* assoc);
51
52 int removeAssociationEnd(UMLAssociation *assoc);
53
54 void removeAllAssociationEnds();
55
56 int associations();
57
58 UMLAssociationList getAssociations();
59
60 UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType);
61
62 UMLClassifierList getSuperClasses(bool withRealizations = true);
63 UMLClassifierList getSubClasses();
64
65 virtual UMLAssociationList getRealizations();
66
67 UMLAssociationList getAggregations();
68 UMLAssociationList getCompositions();
69 UMLAssociationList getRelationships();
70
71 virtual UMLObject *findChildObject(const QString &n,
72 UMLObject::ObjectType t = UMLObject::ot_UMLObject);
73 virtual UMLObject *findChildObjectById(Uml::ID::Type id, bool considerAncestors = false);
74
75 virtual QString uniqChildName(const UMLObject::ObjectType type,
76 const QString &prefix = QString());
77
78 virtual void removeAllChildObjects();
79
80 UMLObjectList &subordinates() const {
81 m_List.removeAll(0);
82 return m_List;
83 }
84
85 virtual bool resolveRef();
86
87 // The abstract method UMLObject::saveToXMI1() is implemented
88 // in the classes inheriting from UMLCanvasObject.
89
90 private:
91
100 mutable UMLObjectList m_List;
101
102 signals:
103
104 void sigAssociationEndAdded(UMLAssociation * assoc);
105 void sigAssociationEndRemoved(UMLAssociation * assoc);
106
107 };
108
109 #endif
UMLAssociation
Sets up association information.
Definition: association.h:33
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:34
UMLCanvasObject::getAssociations
UMLAssociationList getAssociations()
Definition: umlcanvasobject.cpp:329
UMLCanvasObject::UMLCanvasObject
UMLCanvasObject(const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
Definition: umlcanvasobject.cpp:37
UMLCanvasObject::~UMLCanvasObject
virtual ~UMLCanvasObject()
Definition: umlcanvasobject.cpp:45
UMLCanvasObject::m_List
UMLObjectList m_List
Definition: umlcanvasobject.h:100
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
UMLCanvasObject::operator==
bool operator==(const UMLCanvasObject &rhs) const
Definition: umlcanvasobject.cpp:274
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Definition: umlcanvasobject.cpp:238
UMLCanvasObject::associations
int associations()
Definition: umlcanvasobject.cpp:314
UMLCanvasObject::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlcanvasobject.cpp:298
UMLCanvasObject::subordinates
UMLObjectList & subordinates() const
Definition: umlcanvasobject.h:80
UMLCanvasObject::getSubClasses
UMLClassifierList getSubClasses()
Definition: umlcanvasobject.cpp:377
UMLCanvasObject::getRelationships
UMLAssociationList getRelationships()
Definition: umlcanvasobject.cpp:432
UMLCanvasObject::resolveRef
virtual bool resolveRef()
Definition: umlcanvasobject.cpp:440
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
UMLCanvasObject::removeAllAssociationEnds
void removeAllAssociationEnds()
Definition: umlcanvasobject.cpp:129
UMLCanvasObject::getRealizations
virtual UMLAssociationList getRealizations()
Definition: umlcanvasobject.cpp:402
UMLCanvasObject::getSpecificAssocs
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Definition: umlcanvasobject.cpp:61
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Definition: umlcanvasobject.cpp:180
UMLCanvasObject::removeAllChildObjects
virtual void removeAllChildObjects()
Definition: umlcanvasobject.cpp:161
UMLCanvasObject::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Definition: umlcanvasobject.cpp:261
UMLCanvasObject::removeAssociationEnd
int removeAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:114
UMLCanvasObject::sigAssociationEndAdded
void sigAssociationEndAdded(UMLAssociation *assoc)
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
UMLCanvasObject::hasAssociation
bool hasAssociation(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:101
UMLCanvasObject::sigAssociationEndRemoved
void sigAssociationEndRemoved(UMLAssociation *assoc)
UMLCanvasObject::addAssociationEnd
bool addAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:80
UMLObjectList
Definition: umlobjectlist.h:29
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:80
UMLObject::ot_UMLObject
@ ot_UMLObject
Definition: umlobject.h:82
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
umlobject.h
umlobjectlist.h