• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
entity.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-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef ENTITY_H
12 #define ENTITY_H
13 
14 #include "classifier.h"
15 
16 // forward declarations
17 class UMLEntityAttribute;
18 class UMLEntityConstraint;
19 class UMLUniqueConstraint;
20 class UMLForeignKeyConstraint;
21 class UMLCheckConstraint;
22 class UMLEntityAttributeList;
23 
34 class UMLEntity : public UMLClassifier
35 {
36  Q_OBJECT
37 public:
38  explicit UMLEntity(const QString& name = QString(), Uml::ID::Type id = Uml::ID::None);
39  virtual ~UMLEntity();
40 
41  bool operator==(const UMLEntity& rhs) const;
42 
43  virtual void copyInto(UMLObject *lhs) const;
44 
45  virtual UMLObject* clone() const;
46 
47  virtual UMLAttribute* createAttribute(const QString &name = QString(),
48  UMLObject *type = 0, Uml::Visibility::Enum vis = Uml::Visibility::Private,
49  const QString &init = QString());
50 
51  UMLUniqueConstraint* createUniqueConstraint(const QString &name = QString());
52  UMLForeignKeyConstraint* createForeignKeyConstraint(const QString &name = QString());
53  UMLCheckConstraint* createCheckConstraint(const QString &name = QString());
54 
55  UMLObject* addEntityAttribute(const QString &name, Uml::ID::Type id = Uml::ID::None);
56  bool addEntityAttribute(UMLEntityAttribute* att, IDChangeLog* log = 0);
57  bool addEntityAttribute(UMLEntityAttribute* att, int position);
58 
59  int removeEntityAttribute(UMLClassifierListItem* att);
60 
61  void signalEntityAttributeRemoved(UMLClassifierListItem *eattr);
62 
63  int entityAttributes() ;
64 
65  bool setAsPrimaryKey(UMLUniqueConstraint* uconstr);
66  void unsetPrimaryKey();
67  bool hasPrimaryKey() const;
68  bool isPrimaryKey(UMLUniqueConstraint* uConstr) const;
69 
70  bool addConstraint(UMLEntityConstraint* constr);
71  bool removeConstraint(UMLEntityConstraint* constr);
72 
73  virtual bool resolveRef();
74 
75  virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
76 
77  UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const;
78 
79  UMLEntityAttributeList getEntityAttributes() const;
80 
81  virtual UMLClassifierListItem* makeChildObject(const QString& xmiTag);
82 
83 private slots:
84  void slotEntityAttributeRemoved(UMLClassifierListItem*);
85 
86 signals:
87  void entityAttributeAdded(UMLClassifierListItem*);
88  void entityAttributeRemoved(UMLClassifierListItem*);
89  void entityConstraintAdded(UMLClassifierListItem*);
90  void entityConstraintRemoved(UMLClassifierListItem*);
91 
92 protected:
93  bool load(QDomElement& element);
94 
95 private:
96 
103  UMLUniqueConstraint* m_PrimaryKey;
104 
105 };
106 
107 #endif // ENTITY_H
108 
UMLEntity::createCheckConstraint
UMLCheckConstraint * createCheckConstraint(const QString &name=QString())
Creates a Check Constraint for this Entity.
Definition: entity.cpp:254
UMLClassifierListItemList
This sub-class adds copyInto and clone to the QPtrList base class...
Definition: umlclassifierlistitemlist.h:26
UMLEntity::entityAttributes
int entityAttributes()
Returns the number of entityAttributes for the class.
Definition: entity.cpp:391
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
UMLEntity::~UMLEntity
virtual ~UMLEntity()
Standard destructor.
Definition: entity.cpp:53
UMLClassifierListItem
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
UMLEntity::createUniqueConstraint
UMLUniqueConstraint * createUniqueConstraint(const QString &name=QString())
Creates a Unique Constraint for this Entity.
Definition: entity.cpp:151
UMLEntity::setAsPrimaryKey
bool setAsPrimaryKey(UMLUniqueConstraint *uconstr)
Sets the UniqueConstraint passed as the Primary Key of this Entity If the UniqueConstraint exists...
Definition: entity.cpp:510
UMLEntity::getFilteredList
UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Reimplementation of getFilteredList to support ot=UMLObject::ot_EntityConstraint. ...
Definition: entity.cpp:642
IDChangeLog
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
UMLEntity::UMLEntity
UMLEntity(const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
Constructor.
Definition: entity.cpp:41
UMLObject::init
void init()
Initializes key variables of the class.
Definition: umlobject.cpp:96
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
UMLEntity::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Creates the element including its entityliterals.
Definition: entity.cpp:435
classifier.h
UMLEntity::entityAttributeAdded
void entityAttributeAdded(UMLClassifierListItem *)
UMLCheckConstraint
This class is used to set up information for a unique entity constraint.
Definition: checkconstraint.h:25
UMLForeignKeyConstraint
This class is used to set up information for a foreign key entity constraint.
Definition: foreignkeyconstraint.h:32
Uml::Visibility::Private
Definition: basictypes.h:58
UMLEntity::operator==
bool operator==(const UMLEntity &rhs) const
Overloaded '==' operator.
Definition: entity.cpp:61
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
UMLEntity::load
bool load(QDomElement &element)
Loads the element including its entityAttributes.
Definition: entity.cpp:456
UMLEntity::makeChildObject
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
Create a new ClassifierListObject (entityattribute) according to the given XMI tag.
Definition: entity.cpp:710
UMLEntity::entityAttributeRemoved
void entityAttributeRemoved(UMLClassifierListItem *)
UMLEntity::getEntityAttributes
UMLEntityAttributeList getEntityAttributes() const
Returns the Entity Attributes.
Definition: entity.cpp:689
UMLEntity::removeConstraint
bool removeConstraint(UMLEntityConstraint *constr)
Removes an existing constraint from this UMLEntity.
Definition: entity.cpp:596
UMLEntity::addConstraint
bool addConstraint(UMLEntityConstraint *constr)
Adds a Constraint to this UMLEntity.
Definition: entity.cpp:573
UMLEntity::addEntityAttribute
UMLObject * addEntityAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Adds an entityAttribute.
Definition: entity.cpp:305
UMLEntity::entityConstraintAdded
void entityConstraintAdded(UMLClassifierListItem *)
UMLEntity::removeEntityAttribute
int removeEntityAttribute(UMLClassifierListItem *att)
Removes an entityAttribute from the class.
Definition: entity.cpp:372
Uml::ID::Type
std::string Type
Definition: basictypes.h:317
UMLEntity::signalEntityAttributeRemoved
void signalEntityAttributeRemoved(UMLClassifierListItem *eattr)
Emit the entityAttributeRemoved signal.
Definition: entity.cpp:400
UMLEntity::resolveRef
virtual bool resolveRef()
Resolve the types referenced by our UMLEntityAttributes.
Definition: entity.cpp:409
UMLEntityConstraint
This class is used to set up information for a entity constraint.
Definition: entityconstraint.h:26
UMLEntity::createAttribute
virtual UMLAttribute * createAttribute(const QString &name=QString(), UMLObject *type=0, Uml::Visibility::Enum vis=Uml::Visibility::Private, const QString &init=QString())
Create an UMLAttribute.
Definition: entity.cpp:100
UMLEntity::unsetPrimaryKey
void unsetPrimaryKey()
Unset a Primary Key Constraint if it exists, else does nothing This function will make the primary ke...
Definition: entity.cpp:549
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:47
UMLUniqueConstraint
This class is used to set up information for a unique entity constraint.
Definition: uniqueconstraint.h:28
UMLEntityAttribute
This class is used to set up information for an entityattribute.
Definition: entityattribute.h:25
UMLEntity::copyInto
virtual void copyInto(UMLObject *lhs) const
Copy the internal presentation of this object into the new object.
Definition: entity.cpp:70
UMLEntity::isPrimaryKey
bool isPrimaryKey(UMLUniqueConstraint *uConstr) const
Checks if a given Unique Constraint is primary key of this entity.
Definition: entity.cpp:676
UMLEntity::clone
virtual UMLObject * clone() const
Make a clone of this object.
Definition: entity.cpp:84
UMLEntityAttributeList
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlentityattributelist.h:25
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
UMLEntity::hasPrimaryKey
bool hasPrimaryKey() const
Checks if This UMLEntity has a primary key set.
Definition: entity.cpp:558
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:319
UMLEntity::createForeignKeyConstraint
UMLForeignKeyConstraint * createForeignKeyConstraint(const QString &name=QString())
Creates a Foreign Key Constraint for this Entity.
Definition: entity.cpp:205
UMLEntity
This class contains the non-graphical information required for a UML Entity.
Definition: entity.h:34
UMLEntity::entityConstraintRemoved
void entityConstraintRemoved(UMLClassifierListItem *)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal