• 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.cpp
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 // own header
12 #include "entity.h"
13 
14 // app includes
15 #include "debug_utils.h"
16 #include "entityattribute.h"
17 #include "uniqueconstraint.h"
18 #include "foreignkeyconstraint.h"
19 #include "checkconstraint.h"
20 #include "umldoc.h"
21 #include "uml.h"
22 #include "uniqueid.h"
23 #include "umlentityattributelist.h"
24 #include "umlentityconstraintlist.h"
25 #include "idchangelog.h"
26 #include "umlentityattributedialog.h"
27 #include "umluniqueconstraintdialog.h"
28 #include "umlforeignkeyconstraintdialog.h"
29 #include "umlcheckconstraintdialog.h"
30 
31 // kde includes
32 #include <klocale.h>
33 #include <kmessagebox.h>
34 
35 // qt includes
36 #include <QPointer>
37 
41 UMLEntity::UMLEntity(const QString& name, Uml::ID::Type id)
42  : UMLClassifier(name, id),
43  m_PrimaryKey(0)
44 {
45  m_BaseType = UMLObject::ot_Entity;
46  connect(this, SIGNAL(entityAttributeRemoved(UMLClassifierListItem*)),
47  this, SLOT(slotEntityAttributeRemoved(UMLClassifierListItem*)));
48 }
49 
53 UMLEntity::~UMLEntity()
54 {
55  m_List.clear();
56 }
57 
61 bool UMLEntity::operator==(const UMLEntity& rhs) const
62 {
63  return UMLClassifier::operator==(rhs);
64 }
65 
70 void UMLEntity::copyInto(UMLObject *lhs) const
71 {
72  UMLEntity *target = static_cast<UMLEntity*>(lhs);
73 
74  // call base class copy function
75  UMLClassifier::copyInto(target);
76 
77  // copy local data items
78  target->m_PrimaryKey = m_PrimaryKey;
79 }
80 
84 UMLObject* UMLEntity::clone() const
85 {
86  UMLEntity* clone = new UMLEntity();
87  copyInto(clone);
88 
89  return clone;
90 }
91 
100 UMLAttribute* UMLEntity::createAttribute(const QString &name /*= QString()*/, UMLObject *type /*= 0*/,
101  Uml::Visibility::Enum vis /* = Uml::Visibility::Private*/,
102  const QString& iv /* = QString()*/)
103 {
104  Uml::ID::Type id = UniqueID::gen();
105  QString currentName;
106  if (name.isNull()) {
107  currentName = uniqChildName(UMLObject::ot_EntityAttribute);
108  } else {
109  currentName = name;
110  }
111 
112  UMLEntityAttribute* newAttribute = new UMLEntityAttribute(this, currentName, id, vis, type, iv);
113 
114  int button = KDialog::Accepted;
115  bool goodName = false;
116 
117  //check for name.isNull() stops dialog being shown
118  //when creating attribute via list view
119  while (button == KDialog::Accepted && !goodName && name.isNull()) {
120  QPointer<UMLEntityAttributeDialog> dialog = new UMLEntityAttributeDialog(0, newAttribute);
121  button = dialog->exec();
122  QString name = newAttribute->name();
123 
124  if (name.length() == 0) {
125  KMessageBox::error(0, i18n("That is an invalid name."), i18n("Invalid Name"));
126  } else if (findChildObject(name) != NULL) {
127  KMessageBox::error(0, i18n("That name is already being used."), i18n("Not a Unique Name"));
128  } else {
129  goodName = true;
130  }
131  delete dialog;
132  }
133 
134  if (button != KDialog::Accepted) {
135  delete newAttribute;
136  return 0;
137  }
138 
139  addEntityAttribute(newAttribute);
140 
141  UMLDoc *umldoc = UMLApp::app()->document();
142  umldoc->signalUMLObjectCreated(newAttribute);
143  return newAttribute;
144 }
145 
151 UMLUniqueConstraint* UMLEntity::createUniqueConstraint(const QString &name)
152 {
153  Uml::ID::Type id = UniqueID::gen();
154  QString currentName;
155  if (name.isNull()) {
156 
160  currentName = uniqChildName(UMLObject::ot_UniqueConstraint);
161  } else {
162  currentName = name;
163  }
164 
165  UMLUniqueConstraint* newUniqueConstraint = new UMLUniqueConstraint(this, currentName, id);
166 
167  int button = KDialog::Accepted;
168  bool goodName = false;
169 
170  //check for name.isNull() stops dialog being shown
171  //when creating attribute via list view
172  while (button == KDialog::Accepted && !goodName && name.isNull()) {
173  QPointer<UMLUniqueConstraintDialog> dialog = new UMLUniqueConstraintDialog(0, newUniqueConstraint);
174  button = dialog->exec();
175  QString name = newUniqueConstraint->name();
176 
177  if (name.length() == 0) {
178  KMessageBox::error(0, i18n("That is an invalid name."), i18n("Invalid Name"));
179  } else if (findChildObject(name) != NULL) {
180  KMessageBox::error(0, i18n("That name is already being used."), i18n("Not a Unique Name"));
181  } else {
182  goodName = true;
183  }
184  delete dialog;
185  }
186 
187  if (button != KDialog::Accepted) {
188  delete newUniqueConstraint;
189  return NULL;
190  }
191 
192  addConstraint(newUniqueConstraint);
193 
194  UMLDoc *umldoc = UMLApp::app()->document();
195  umldoc->signalUMLObjectCreated(newUniqueConstraint);
196  emitModified();
197  return newUniqueConstraint;
198 }
199 
205 UMLForeignKeyConstraint* UMLEntity::createForeignKeyConstraint(const QString &name)
206 {
207  Uml::ID::Type id = UniqueID::gen();
208  QString currentName;
209  if (name.isNull()) {
210  currentName = uniqChildName(UMLObject::ot_ForeignKeyConstraint);
211  } else {
212  currentName = name;
213  }
214 
215  UMLForeignKeyConstraint* newForeignKeyConstraint = new UMLForeignKeyConstraint(this, currentName, id);
216 
217  int button = KDialog::Accepted;
218  bool goodName = false;
219 
220  //check for name.isNull() stops dialog being shown
221  //when creating attribute via list view
222  while (button == KDialog::Accepted && !goodName && name.isNull()) {
223  QPointer<UMLForeignKeyConstraintDialog> dialog = new UMLForeignKeyConstraintDialog(0, newForeignKeyConstraint);
224  button = dialog->exec();
225  QString name = newForeignKeyConstraint->name();
226 
227  if (name.length() == 0) {
228  KMessageBox::error(0, i18n("That is an invalid name."), i18n("Invalid Name"));
229  } else if (findChildObject(name) != NULL) {
230  KMessageBox::error(0, i18n("That name is already being used."), i18n("Not a Unique Name"));
231  } else {
232  goodName = true;
233  }
234  delete dialog;
235  }
236 
237  if (button != KDialog::Accepted) {
238  return NULL;
239  }
240 
241  addConstraint(newForeignKeyConstraint);
242 
243  UMLDoc *umldoc = UMLApp::app()->document();
244  umldoc->signalUMLObjectCreated(newForeignKeyConstraint);
245  emitModified();
246  return newForeignKeyConstraint;
247 }
248 
254 UMLCheckConstraint* UMLEntity::createCheckConstraint(const QString &name)
255 {
256  Uml::ID::Type id = UniqueID::gen();
257  QString currentName;
258  if (name.isNull()) {
259  currentName = uniqChildName(UMLObject::ot_CheckConstraint);
260  } else {
261  currentName = name;
262  }
263 
264  UMLCheckConstraint* newCheckConstraint = new UMLCheckConstraint(this, currentName, id);
265 
266  int button = KDialog::Accepted;
267  bool goodName = false;
268 
269  //check for name.isNull() stops dialog being shown
270  //when creating attribute via list view
271  while (button == KDialog::Accepted && !goodName && name.isNull()) {
272  QPointer<UMLCheckConstraintDialog> dialog = new UMLCheckConstraintDialog(0, newCheckConstraint);
273  button = dialog->exec();
274  QString name = newCheckConstraint->name();
275 
276  if (name.length() == 0) {
277  KMessageBox::error(0, i18n("That is an invalid name."), i18n("Invalid Name"));
278  } else if (findChildObject(name) != NULL) {
279  KMessageBox::error(0, i18n("That name is already being used."), i18n("Not a Unique Name"));
280  } else {
281  goodName = true;
282  }
283  delete dialog;
284  }
285 
286  if (button != KDialog::Accepted) {
287  return NULL;
288  }
289 
290  addConstraint(newCheckConstraint);
291 
292  UMLDoc *umldoc = UMLApp::app()->document();
293  umldoc->signalUMLObjectCreated(newCheckConstraint);
294  emitModified();
295  return newCheckConstraint;
296 }
297 
305 UMLObject* UMLEntity::addEntityAttribute(const QString& name, Uml::ID::Type id)
306 {
307  UMLEntityAttribute* literal = new UMLEntityAttribute(this, name, id);
308  m_List.append(literal);
309  emit entityAttributeAdded(literal);
310  UMLObject::emitModified();
311  connect(literal, SIGNAL(modified()), this, SIGNAL(modified()));
312  return literal;
313 }
314 
322 bool UMLEntity::addEntityAttribute(UMLEntityAttribute* att, IDChangeLog* log /* = 0*/)
323 {
324  QString name = (QString)att->name();
325  if (findChildObject(name) == NULL) {
326  att->setParent(this);
327  m_List.append(att);
328  emit entityAttributeAdded(att);
329  UMLObject::emitModified();
330  connect(att, SIGNAL(modified()), this, SIGNAL(modified()));
331  return true;
332  } else if (log) {
333  log->removeChangeByNewID(att->id());
334  delete att;
335  }
336  return false;
337 }
338 
348 bool UMLEntity::addEntityAttribute(UMLEntityAttribute* att, int position)
349 {
350  QString name = (QString)att->name();
351  if (findChildObject(name) == NULL) {
352  att->setParent(this);
353  if (position >= 0 && position <= (int)m_List.count()) {
354  m_List.insert(position, att);
355  } else {
356  m_List.append(att);
357  }
358  emit entityAttributeAdded(att);
359  UMLObject::emitModified();
360  connect(att, SIGNAL(modified()), this, SIGNAL(modified()));
361  return true;
362  }
363  return false;
364 }
365 
372 int UMLEntity::removeEntityAttribute(UMLClassifierListItem* att)
373 {
374  if (!m_List.removeAll((UMLEntityAttribute*)att)) {
375  uDebug() << "can not find att given in list";
376  return -1;
377  }
378  emit entityAttributeRemoved(att);
379  UMLObject::emitModified();
380  // If we are deleting the object, then we don't need to disconnect..this is done auto-magically
381  // for us by QObject. -b.t.
382  // disconnect(att, SIGNAL(modified()), this, SIGNAL(modified()));
383  delete att;
384  return m_List.count();
385 }
386 
391 int UMLEntity::entityAttributes()
392 {
393  UMLClassifierListItemList entityAttributes = getFilteredList(UMLObject::ot_EntityAttribute);
394  return entityAttributes.count();
395 }
396 
400 void UMLEntity::signalEntityAttributeRemoved(UMLClassifierListItem *eattr)
401 {
402  emit entityAttributeRemoved(eattr);
403 }
404 
409 bool UMLEntity::resolveRef()
410 {
411  bool success = UMLClassifier::resolveRef();
412  for (UMLObjectListIt oit(m_List); oit.hasNext();) {
413  UMLObject* obj = oit.next();
414  if (obj->resolveRef()) {
415  UMLClassifierListItem *cli = static_cast<UMLClassifierListItem*>(obj);
416  switch (cli->baseType()) {
417  case UMLObject::ot_EntityAttribute:
418  emit entityAttributeAdded(cli);
419  break;
420  case UMLObject::ot_UniqueConstraint:
421  case UMLObject::ot_ForeignKeyConstraint:
422  emit entityConstraintAdded(cli);
423  break;
424  default:
425  break;
426  }
427  }
428  }
429  return success;
430 }
431 
435 void UMLEntity::saveToXMI(QDomDocument& qDoc, QDomElement& qElement)
436 {
437  QDomElement entityElement = UMLObject::save("UML:Entity", qDoc);
438  //save operations
439  UMLClassifierListItemList entityAttributes = getFilteredList(UMLObject::ot_EntityAttribute);
440  UMLClassifierListItem* pEntityAttribute = 0;
441  foreach (pEntityAttribute, entityAttributes) {
442  pEntityAttribute->saveToXMI(qDoc, entityElement);
443  }
444 
445  UMLClassifierListItemList entityConstraints = getFilteredList(UMLObject::ot_EntityConstraint);
446  foreach(UMLClassifierListItem* cli, entityConstraints) {
447  cli->saveToXMI(qDoc, entityElement);
448  }
449 
450  qElement.appendChild(entityElement);
451 }
452 
456 bool UMLEntity::load(QDomElement& element)
457 {
458  QDomNode node = element.firstChild();
459  while(!node.isNull()) {
460  if (node.isComment()) {
461  node = node.nextSibling();
462  continue;
463  }
464  QDomElement tempElement = node.toElement();
465  QString tag = tempElement.tagName();
466  if (UMLDoc::tagEq(tag, "EntityAttribute")) { // for backward compatibility
467  UMLEntityAttribute* pEntityAttribute = new UMLEntityAttribute(this);
468  if(!pEntityAttribute->loadFromXMI(tempElement)) {
469  return false;
470  }
471  m_List.append(pEntityAttribute);
472  } else if (UMLDoc::tagEq(tag, "UniqueConstraint")) {
473  UMLUniqueConstraint* pUniqueConstraint = new UMLUniqueConstraint(this);
474  if (!pUniqueConstraint->loadFromXMI(tempElement)) {
475  return false;
476  }
477  addConstraint(pUniqueConstraint);
478  } else if (UMLDoc::tagEq(tag,"ForeignKeyConstraint")) {
479  UMLForeignKeyConstraint* pForeignKeyConstraint = new UMLForeignKeyConstraint(this);
480  if (!pForeignKeyConstraint->loadFromXMI(tempElement)) {
481  return false;
482  }
483 
484  addConstraint(pForeignKeyConstraint);
485  } else if (UMLDoc::tagEq(tag, "CheckConstraint")) {
486 
487  UMLCheckConstraint* pCheckConstraint = new UMLCheckConstraint(this);
488  if (!pCheckConstraint->loadFromXMI(tempElement)) {
489  return false;
490  }
491 
492  addConstraint(pCheckConstraint);
493  } else if (tag == "stereotype") {
494  uDebug() << name() << ": losing old-format stereotype.";
495  } else {
496  uWarning() << "unknown child type in UMLEntity::load";
497  }
498  node = node.nextSibling();
499  }//end while
500  return true;
501 }
502 
510 bool UMLEntity::setAsPrimaryKey(UMLUniqueConstraint* uconstr)
511 {
512  if (uconstr == NULL) {
513  uDebug() << "NULL value passed. To unset a Primary Key use "
514  << "unsetPrimaryKey()";
515  return false;
516  }
517 
518  if (static_cast<UMLEntity*>(uconstr->parent()) != this) {
519 
520  uDebug() << "Parent of " << uconstr->name()
521  << " does not match with current entity";
522  return false;
523  }
524 
525  // check if this constraint already exists as a unique constraint for this entity
526  UMLUniqueConstraint* uuc = static_cast<UMLUniqueConstraint*>(findChildObjectById(uconstr->id()));
527  if (uuc == NULL) {
528  addConstraint(uconstr);
529  uuc = uconstr;
530  }
531 
532  UMLUniqueConstraint* oldPrimaryKey = m_PrimaryKey;
533 
534  m_PrimaryKey = uuc;
535 
536  if (oldPrimaryKey != NULL)
537  oldPrimaryKey->emitModified();
538 
539  uuc->emitModified();
540  emitModified();
541  return true;
542 }
543 
549 void UMLEntity::unsetPrimaryKey()
550 {
551  m_PrimaryKey = 0;
552 }
553 
558 bool UMLEntity::hasPrimaryKey() const
559 {
560  if (m_PrimaryKey) {
561  return true;
562  }
563 
564  return false;
565 }
566 
573 bool UMLEntity::addConstraint(UMLEntityConstraint* constr)
574 {
575  if (findChildObjectById(constr->id()) != NULL) {
576  uDebug() << "Constraint with id " << Uml::ID::toString(constr->id())
577  << " already exists ";
578  return false;
579  }
580 
581  m_List.append(constr);
582 
583  emit entityConstraintAdded(constr);
584  UMLObject::emitModified();
585  connect(constr, SIGNAL(modified()), this, SIGNAL(modified()));
586 
587  return true;
588 }
589 
596 bool UMLEntity::removeConstraint(UMLEntityConstraint* constr)
597 {
598  if (findChildObjectById(constr->id()) == NULL) {
599  uDebug() << "Constraint with id " << Uml::ID::toString(constr->id())
600  << " does not exist ";
601  return false;
602  }
603 
604  if (m_PrimaryKey == constr) {
605  unsetPrimaryKey();
606  }
607 
608  m_List.removeAll(constr);
609 
610  emit entityConstraintRemoved(constr);
611  UMLObject::emitModified();
612 
613  delete constr;
614  return true;
615 }
616 
620 void UMLEntity::slotEntityAttributeRemoved(UMLClassifierListItem* cli)
621 {
622  // this function does some cleanjobs related to this entity when the attribute is
623  // removed, like, removing the attribute from all constraints
624 
625  UMLEntityAttribute* entAtt = static_cast<UMLEntityAttribute*>(cli);
626  if (cli) {
627  UMLClassifierListItemList ual = this->getFilteredList(UMLObject::ot_UniqueConstraint);
628 
629  foreach(UMLClassifierListItem* ucli, ual) {
630  UMLUniqueConstraint* uuc = static_cast<UMLUniqueConstraint*>(ucli);
631  if (uuc->hasEntityAttribute(entAtt)) {
632  uuc->removeEntityAttribute(entAtt);
633  }
634  }
635  }
636 
637 }
638 
642 UMLClassifierListItemList UMLEntity::getFilteredList(UMLObject::ObjectType ot) const
643 {
644  if (ot == UMLObject::ot_EntityConstraint) {
645  UMLClassifierListItemList ucList, fcList, ccList, rcList;
646  ucList = UMLClassifier::getFilteredList(UMLObject::ot_UniqueConstraint);
647  fcList = UMLClassifier::getFilteredList(UMLObject::ot_ForeignKeyConstraint);
648  ccList = UMLClassifier::getFilteredList(UMLObject::ot_CheckConstraint);
649 
650  // append the lists to rcList
651  // first the Unique Constraints
652  foreach(UMLClassifierListItem* ucli, ucList) {
653  rcList.append(ucli);
654  }
655 
656  // then the Foreign Key Constraints
657  foreach(UMLClassifierListItem* ucli, fcList) {
658  rcList.append(ucli);
659  }
660 
661  foreach(UMLClassifierListItem* ucli, ccList) {
662  rcList.append(ucli);
663  }
664 
665  return rcList;
666  } else {
667  return UMLClassifier::getFilteredList(ot);
668  }
669 }
670 
676 bool UMLEntity::isPrimaryKey(UMLUniqueConstraint* uConstr) const
677 {
678  if (uConstr == m_PrimaryKey) {
679  return true;
680  }
681 
682  return false;
683 }
684 
689 UMLEntityAttributeList UMLEntity::getEntityAttributes() const
690 {
691  UMLEntityAttributeList entityAttributeList;
692  for (UMLObjectListIt lit(m_List); lit.hasNext();) {
693  UMLObject *listItem = lit.next();
694  if (listItem->baseType() == UMLObject::ot_EntityAttribute) {
695  entityAttributeList.append(static_cast<UMLEntityAttribute*>(listItem));
696  }
697  }
698  return entityAttributeList;
699 }
700 
701 
710 UMLClassifierListItem* UMLEntity::makeChildObject(const QString& xmiTag)
711 {
712  UMLClassifierListItem* pObject = NULL;
713  if (UMLDoc::tagEq(xmiTag, "EntityAttribute")) {
714  pObject = new UMLEntityAttribute(this);
715  }
716  return pObject;
717 }
718 
719 #include "entity.moc"
UMLEntityAttributeDialog
Definition: umlentityattributedialog.h:28
entity.h
UMLObjectListIt
QListIterator< UMLObject * > UMLObjectListIt
Definition: umlobjectlist.h:18
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
UniqueID::gen
Uml::ID::Type gen()
MAIN FUNCTION: Return a new unique ID.
Definition: uniqueid.cpp:26
UMLObject::loadFromXMI
virtual bool loadFromXMI(QDomElement &element)
This method loads the generic parts of the XMI common to most model classes.
Definition: umlobject.cpp:914
umlentityattributedialog.h
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
UMLForeignKeyConstraintDialog
A dialog page to display foreignkey constraint properties.
Definition: umlforeignkeyconstraintdialog.h:39
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
idchangelog.h
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
UMLClassifier::getFilteredList
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Returns the entries in m_List that are of the requested type.
Definition: classifier.cpp:1019
UMLEntity::getFilteredList
UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Reimplementation of getFilteredList to support ot=UMLObject::ot_EntityConstraint. ...
Definition: entity.cpp:642
UMLDoc::tagEq
static bool tagEq(const QString &tag, const QString &pattern)
Function for comparing tags in XMI files.
Definition: umldoc.cpp:3030
umlcheckconstraintdialog.h
entityattribute.h
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
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
foreignkeyconstraint.h
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
UMLObject::ot_UniqueConstraint
Definition: umlobject.h:71
uWarning
#define uWarning()
Definition: debug_utils.h:97
UMLEntity::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Creates the element including its entityliterals.
Definition: entity.cpp:435
UMLApp::document
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:872
IDChangeLog::removeChangeByNewID
void removeChangeByNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:124
umlentityconstraintlist.h
UMLEntity::entityAttributeAdded
void entityAttributeAdded(UMLClassifierListItem *)
UMLUniqueConstraint::removeEntityAttribute
bool removeEntityAttribute(UMLEntityAttribute *attr)
Removes a UMLEntityAttribute from the list.
Definition: uniqueconstraint.cpp:276
UMLCheckConstraint
This class is used to set up information for a unique entity constraint.
Definition: checkconstraint.h:25
debug_utils.h
UMLForeignKeyConstraint
This class is used to set up information for a foreign key entity constraint.
Definition: foreignkeyconstraint.h:32
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
UMLObject::resolveRef
virtual bool resolveRef()
Resolve referenced objects (if any.) Needs to be called after all UML objects are loaded from file...
Definition: umlobject.cpp:709
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 *)
uniqueconstraint.h
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
UMLClassifier::resolveRef
virtual bool resolveRef()
Needs to be called after all UML objects are loaded from file.
Definition: classifier.cpp:692
UMLObject::ot_CheckConstraint
Definition: umlobject.h:73
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Find a child object with the given name.
Definition: umlcanvasobject.cpp:240
UMLEntity::addConstraint
bool addConstraint(UMLEntityConstraint *constr)
Adds a Constraint to this UMLEntity.
Definition: entity.cpp:573
UMLObject::ot_Entity
Definition: umlobject.h:67
uDebug
#define uDebug()
Definition: debug_utils.h:95
umlentityattributelist.h
UMLObject::emitModified
void emitModified()
Forces the emission of the modified signal.
Definition: umlobject.cpp:354
UMLEntity::addEntityAttribute
UMLObject * addEntityAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Adds an entityAttribute.
Definition: entity.cpp:305
UMLObject::ot_ForeignKeyConstraint
Definition: umlobject.h:72
UMLClassifier::copyInto
virtual void copyInto(UMLObject *lhs) const
Copy the internal presentation of this object into the new object.
Definition: classifier.cpp:665
UMLCanvasObject::m_List
UMLObjectList m_List
List of all the associations in this object.
Definition: umlcanvasobject.h:99
UMLEntity::entityConstraintAdded
void entityConstraintAdded(UMLClassifierListItem *)
UMLCheckConstraintDialog
A dialog page to display check constraint properties.
Definition: umlcheckconstraintdialog.h:30
UMLEntity::removeEntityAttribute
int removeEntityAttribute(UMLClassifierListItem *att)
Removes an entityAttribute from the class.
Definition: entity.cpp:372
UMLObject::ot_EntityConstraint
Definition: umlobject.h:70
UMLUniqueConstraint::hasEntityAttribute
bool hasEntityAttribute(UMLEntityAttribute *attr)
Check if a entity attribute is present in m_entityAttributeList.
Definition: uniqueconstraint.cpp:224
checkconstraint.h
Uml::ID::Type
std::string Type
Definition: basictypes.h:317
UMLClassifier::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Find the child object by the given id.
Definition: classifier.cpp:553
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
UMLObject::baseType
ObjectType baseType() const
Returns the type of the object.
Definition: umlobject.cpp:366
UMLEntityConstraint
This class is used to set up information for a entity constraint.
Definition: entityconstraint.h:26
UMLObject::m_BaseType
ObjectType m_BaseType
objects type
Definition: umlobject.h:176
umluniqueconstraintdialog.h
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1048
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::save
QDomElement save(const QString &tag, QDomDocument &qDoc)
Auxiliary to saveToXMI.
Definition: umlobject.cpp:808
umldoc.h
UMLUniqueConstraintDialog
A dialog page to display unique constraint properties.
Definition: umluniqueconstraintdialog.h:36
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
UMLObject::saveToXMI
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)=0
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
uniqueid.h
UMLEntity::hasPrimaryKey
bool hasPrimaryKey() const
Checks if This UMLEntity has a primary key set.
Definition: entity.cpp:558
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Returns a name for the new association, operation, template or attribute appended with a number if th...
Definition: umlcanvasobject.cpp:185
UMLObject::modified
void modified()
UMLEntity::createForeignKeyConstraint
UMLForeignKeyConstraint * createForeignKeyConstraint(const QString &name=QString())
Creates a Foreign Key Constraint for this Entity.
Definition: entity.cpp:205
UMLClassifier::operator==
bool operator==(const UMLClassifier &rhs) const
Overloaded '==' operator.
Definition: classifier.cpp:648
umlforeignkeyconstraintdialog.h
UMLObject::ot_EntityAttribute
Definition: umlobject.h:68
UMLEntity
This class contains the non-graphical information required for a UML Entity.
Definition: entity.h:34
uml.h
UMLDoc::signalUMLObjectCreated
void signalUMLObjectCreated(UMLObject *o)
Signal that a UMLObject has been created.
Definition: umldoc.cpp:1619
UMLDoc
UMLDoc provides a document object for a document-view model.
Definition: umldoc.h:63
UMLEntity::entityConstraintRemoved
void entityConstraintRemoved(UMLClassifierListItem *)
UMLObject::id
virtual Uml::ID::Type id() const
Returns the ID of the object.
Definition: umlobject.cpp:394
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