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

umlforeignkeyconstraintdialog.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-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef UMLFOREIGNKEYCONSTRAINTDIALOG_H
12 #define UMLFOREIGNKEYCONSTRAINTDIALOG_H
13
14 //app includes
15 #include "multipagedialogbase.h"
16 #include "umlentityattributelist.h"
17
18 //kde includes
19
20 //qt includes
21 #include <QList>
22
23 class KComboBox;
24 class KLineEdit;
25 class UMLDoc;
26 class UMLForeignKeyConstraint;
27 class QGroupBox;
28 class QLabel;
29 class QPushButton;
30 class QTreeWidget;
31
32 typedef QPair<UMLEntityAttribute*, UMLEntityAttribute*> EntityAttributePair;
33 typedef QList<EntityAttributePair> EntityAttributePairList;
34
42 class UMLForeignKeyConstraintDialog : public MultiPageDialogBase
43 {
44 Q_OBJECT
45 public:
46 UMLForeignKeyConstraintDialog(QWidget* parent, UMLForeignKeyConstraint* pForeignKeyConstraint);
47 ~UMLForeignKeyConstraintDialog();
48
49 private:
50 bool apply();
51
52 void setupGeneralPage();
53 void setupColumnPage();
54
55 void refillReferencedAttributeCB();
56 void refillLocalAttributeCB();
57
58 UMLDoc* m_doc;
59 UMLForeignKeyConstraint* m_pForeignKeyConstraint;
60
61 struct GeneralWidgets {
62
63 QGroupBox* generalGB;
64 QGroupBox* actionGB;
65
66 QLabel* referencedEntityL;
67 QLabel* nameL;
68
69 KLineEdit* nameT;
70
71 KComboBox* referencedEntityCB;
72
73 QLabel* onUpdateL;
74 QLabel* onDeleteL;
75 KComboBox* updateActionCB;
76 KComboBox* deleteActionCB;
77 }; // end general widgets
78
79 struct ColumnWidgets {
80
81 QTreeWidget* mappingTW;
82
83 KComboBox* localColumnCB;
84 KComboBox* referencedColumnCB;
85
86 QLabel* localColumnL;
87 QLabel* referencedColumnL;
88
89 QPushButton* addPB, *removePB;
90 }; // end column widgets
91
92 // these attributes store the local cache
93
94 UMLEntityAttributeList m_pLocalAttributeList;
95 UMLEntityAttributeList m_pReferencedAttributeList;
96
97 EntityAttributePairList m_pAttributeMapList;
98
103 int m_pReferencedEntityIndex;
104 // end of local cache
105
106 GeneralWidgets m_GeneralWidgets;
107 ColumnWidgets m_ColumnWidgets;
108
109 KPageWidgetItem *pageGeneral, *pageColumn;
110
111 public slots:
112 void slotResetWidgetState();
113 void slotApply();
114 void slotOk();
115 void slotAddPair();
116 void slotDeletePair();
117 void slotReferencedEntityChanged(int index);
118 };
119
120 #endif
UMLForeignKeyConstraint::getUpdateAction
UpdateDeleteAction getUpdateAction() const
Definition: foreignkeyconstraint.cpp:425
UMLForeignKeyConstraintDialog::apply
bool apply()
Definition: umlforeignkeyconstraintdialog.cpp:155
UMLForeignKeyConstraint::UpdateDeleteAction
UpdateDeleteAction
Definition: foreignkeyconstraint.h:42
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:35
UMLForeignKeyConstraintDialog::m_pReferencedEntityIndex
int m_pReferencedEntityIndex
Definition: umlforeignkeyconstraintdialog.h:103
template.h
UMLForeignKeyConstraintDialog::pageColumn
KPageWidgetItem * pageColumn
Definition: umlforeignkeyconstraintdialog.h:109
UMLForeignKeyConstraintDialog::ColumnWidgets::referencedColumnCB
KComboBox * referencedColumnCB
Definition: umlforeignkeyconstraintdialog.h:84
Icon_Utils::it_Properties_Columns
@ it_Properties_Columns
Definition: icon_utils.h:83
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
UMLEntityList
QList< UMLEntity * > UMLEntityList
Definition: umlentitylist.h:17
UMLForeignKeyConstraint::setUpdateAction
void setUpdateAction(UpdateDeleteAction uda)
Definition: foreignkeyconstraint.cpp:441
UMLForeignKeyConstraintDialog::m_pLocalAttributeList
UMLEntityAttributeList m_pLocalAttributeList
Definition: umlforeignkeyconstraintdialog.h:94
entity.h
UMLForeignKeyConstraintDialog::GeneralWidgets
Definition: umlforeignkeyconstraintdialog.h:61
UMLForeignKeyConstraintDialog::GeneralWidgets::nameL
QLabel * nameL
Definition: umlforeignkeyconstraintdialog.h:67
UMLForeignKeyConstraint::setReferencedEntity
void setReferencedEntity(UMLEntity *ent)
Definition: foreignkeyconstraint.cpp:336
multipagedialogbase.h
operation.h
UMLObject::ot_Entity
@ ot_Entity
Definition: umlobject.h:101
UMLForeignKeyConstraintDialog::GeneralWidgets::updateActionCB
KComboBox * updateActionCB
Definition: umlforeignkeyconstraintdialog.h:75
UMLForeignKeyConstraintDialog::slotApply
void slotApply()
Definition: umlforeignkeyconstraintdialog.cpp:383
foreignkeyconstraint.h
UMLForeignKeyConstraint
Sets up Foreign Key entity constraint information.
Definition: foreignkeyconstraint.h:33
UMLForeignKeyConstraintDialog::slotAddPair
void slotAddPair()
Definition: umlforeignkeyconstraintdialog.cpp:78
EntityAttributePair
QPair< UMLEntityAttribute *, UMLEntityAttribute * > EntityAttributePair
Definition: umlforeignkeyconstraintdialog.h:30
object_factory.h
UMLForeignKeyConstraintDialog::GeneralWidgets::generalGB
QGroupBox * generalGB
Definition: umlforeignkeyconstraintdialog.h:63
Uml::SignatureType::SigNoVis
@ SigNoVis
Definition: basictypes.h:165
UMLObject::emitModified
void emitModified()
Definition: umlobject.cpp:385
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:671
UMLForeignKeyConstraintDialog::slotOk
void slotOk()
Definition: umlforeignkeyconstraintdialog.cpp:391
UMLObject::setName
virtual void setName(const QString &strName)
Definition: umlobject.cpp:192
MultiPageDialogBase::accept
void accept()
Definition: multipagedialogbase.cpp:173
UMLForeignKeyConstraintDialog::ColumnWidgets::addPB
QPushButton * addPB
Definition: umlforeignkeyconstraintdialog.h:89
Dialog_Utils::makeLabeledEditField
KLineEdit * makeLabeledEditField(QGridLayout *layout, int row, QLabel *&label, const QString &labelText, KLineEdit *&editField, const QString &editFieldText, int columnOffset)
Definition: dialog_utils.cpp:52
UMLForeignKeyConstraintDialog::GeneralWidgets::nameT
KLineEdit * nameT
Definition: umlforeignkeyconstraintdialog.h:69
UMLForeignKeyConstraint::setDeleteAction
void setDeleteAction(UpdateDeleteAction uda)
Definition: foreignkeyconstraint.cpp:433
UMLForeignKeyConstraintDialog::ColumnWidgets::mappingTW
QTreeWidget * mappingTW
Definition: umlforeignkeyconstraintdialog.h:81
UMLForeignKeyConstraintDialog::m_pForeignKeyConstraint
UMLForeignKeyConstraint * m_pForeignKeyConstraint
Definition: umlforeignkeyconstraintdialog.h:59
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
MultiPageDialogBase::createPage
QFrame * createPage(const QString &name, const QString &header, Icon_Utils::IconType icon)
Definition: multipagedialogbase.cpp:325
UMLObject::asUMLEntityAttribute
UMLEntityAttribute * asUMLEntityAttribute()
Definition: umlobject.cpp:1314
UMLForeignKeyConstraintDialog::refillLocalAttributeCB
void refillLocalAttributeCB()
Definition: umlforeignkeyconstraintdialog.cpp:443
UMLForeignKeyConstraint::getReferencedEntity
UMLEntity * getReferencedEntity() const
Definition: foreignkeyconstraint.cpp:350
MultiPageDialogBase::applyClicked
void applyClicked()
Definition: moc_multipagedialogbase.cpp:192
UMLObject::asUMLEntity
UMLEntity * asUMLEntity()
Definition: umlobject.cpp:1313
UMLForeignKeyConstraintDialog::slotReferencedEntityChanged
void slotReferencedEntityChanged(int index)
Definition: umlforeignkeyconstraintdialog.cpp:398
UMLForeignKeyConstraintDialog::setupGeneralPage
void setupGeneralPage()
Definition: umlforeignkeyconstraintdialog.cpp:201
UMLForeignKeyConstraint::clearMappings
void clearMappings()
Definition: foreignkeyconstraint.cpp:367
UMLForeignKeyConstraintDialog::~UMLForeignKeyConstraintDialog
~UMLForeignKeyConstraintDialog()
Definition: umlforeignkeyconstraintdialog.cpp:71
UMLForeignKeyConstraintDialog::slotResetWidgetState
void slotResetWidgetState()
Definition: umlforeignkeyconstraintdialog.cpp:462
umlentitylist.h
classifierlistitem.h
entityattribute.h
UMLForeignKeyConstraintDialog::m_pAttributeMapList
EntityAttributePairList m_pAttributeMapList
Definition: umlforeignkeyconstraintdialog.h:97
Uml::ModelType::EntityRelationship
@ EntityRelationship
Definition: basictypes.h:46
UMLForeignKeyConstraintDialog::ColumnWidgets::referencedColumnL
QLabel * referencedColumnL
Definition: umlforeignkeyconstraintdialog.h:87
UMLApp
Definition: uml.h:100
umlentityattributelist.h
attribute.h
MultiPageDialogBase::okClicked
void okClicked()
Definition: moc_multipagedialogbase.cpp:186
UMLForeignKeyConstraintDialog
A dialog page to display foreignkey constraint properties.
Definition: umlforeignkeyconstraintdialog.h:43
UMLForeignKeyConstraintDialog::ColumnWidgets::removePB
QPushButton * removePB
Definition: umlforeignkeyconstraintdialog.h:89
MultiPageDialogBase
Definition: multipagedialogbase.h:52
i18n
#define i18n
Definition: main.cpp:39
UMLForeignKeyConstraintDialog::slotDeletePair
void slotDeletePair()
Definition: umlforeignkeyconstraintdialog.cpp:118
UMLForeignKeyConstraint::getEntityAttributePairs
QMap< UMLEntityAttribute *, UMLEntityAttribute * > getEntityAttributePairs()
Definition: foreignkeyconstraint.cpp:409
UMLForeignKeyConstraintDialog::UMLForeignKeyConstraintDialog
UMLForeignKeyConstraintDialog(QWidget *parent, UMLForeignKeyConstraint *pForeignKeyConstraint)
Definition: umlforeignkeyconstraintdialog.cpp:55
UMLObject::ot_EntityAttribute
@ ot_EntityAttribute
Definition: umlobject.h:102
uDebug
#define uDebug()
Definition: debug_utils.h:122
UMLEntity::getFilteredList
UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Definition: entity.cpp:645
UMLForeignKeyConstraintDialog::ColumnWidgets::localColumnCB
KComboBox * localColumnCB
Definition: umlforeignkeyconstraintdialog.h:83
UMLForeignKeyConstraintDialog::m_doc
UMLDoc * m_doc
the UMLDocument where all objects live
Definition: umlforeignkeyconstraintdialog.h:58
UMLClassifierListItem::toString
virtual QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: classifierlistitem.cpp:90
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
UMLForeignKeyConstraintDialog::GeneralWidgets::onUpdateL
QLabel * onUpdateL
Definition: umlforeignkeyconstraintdialog.h:73
UMLForeignKeyConstraintDialog::GeneralWidgets::deleteActionCB
KComboBox * deleteActionCB
Definition: umlforeignkeyconstraintdialog.h:76
UMLDoc
Definition: umldoc.h:75
UMLForeignKeyConstraintDialog::GeneralWidgets::onDeleteL
QLabel * onDeleteL
Definition: umlforeignkeyconstraintdialog.h:74
UMLEntityAttributeList
Definition: umlentityattributelist.h:26
UMLForeignKeyConstraintDialog::GeneralWidgets::referencedEntityCB
KComboBox * referencedEntityCB
Definition: umlforeignkeyconstraintdialog.h:71
Icon_Utils::it_Properties_General
@ it_Properties_General
Definition: icon_utils.h:64
UMLClassifierListItemList
Definition: umlclassifierlistitemlist.h:27
UMLForeignKeyConstraintDialog::GeneralWidgets::referencedEntityL
QLabel * referencedEntityL
Definition: umlforeignkeyconstraintdialog.h:66
UMLForeignKeyConstraintDialog::ColumnWidgets
Definition: umlforeignkeyconstraintdialog.h:79
classifier.h
uniqueconstraint.h
UMLForeignKeyConstraint::getDeleteAction
UpdateDeleteAction getDeleteAction() const
Definition: foreignkeyconstraint.cpp:417
uml.h
enumliteral.h
UMLForeignKeyConstraintDialog::m_pReferencedAttributeList
UMLEntityAttributeList m_pReferencedAttributeList
Definition: umlforeignkeyconstraintdialog.h:95
debug_utils.h
icon_utils.h
UMLForeignKeyConstraintDialog::ColumnWidgets::localColumnL
QLabel * localColumnL
Definition: umlforeignkeyconstraintdialog.h:86
MultiPageDialogBase::setCaption
void setCaption(const QString &caption)
Definition: multipagedialogbase.cpp:162
EntityAttributePairList
QList< EntityAttributePair > EntityAttributePairList
Definition: umlforeignkeyconstraintdialog.h:33
MultiPageDialogBase::spacingHint
static int spacingHint()
Definition: multipagedialogbase.cpp:214
UMLForeignKeyConstraint::addEntityAttributePair
bool addEntityAttributePair(UMLEntityAttribute *pAttr, UMLEntityAttribute *rAttr)
Definition: foreignkeyconstraint.cpp:185
UMLEntityAttribute::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: entityattribute.cpp:166
UMLForeignKeyConstraintDialog::refillReferencedAttributeCB
void refillReferencedAttributeCB()
Definition: umlforeignkeyconstraintdialog.cpp:421
dialog_utils.h
UMLForeignKeyConstraintDialog::m_ColumnWidgets
ColumnWidgets m_ColumnWidgets
Definition: umlforeignkeyconstraintdialog.h:107
UMLEntityAttribute
Sets up entityattribute information.
Definition: entityattribute.h:26
UMLForeignKeyConstraintDialog::setupColumnPage
void setupColumnPage()
Definition: umlforeignkeyconstraintdialog.cpp:288
UMLForeignKeyConstraintDialog::pageGeneral
KPageWidgetItem * pageGeneral
Definition: umlforeignkeyconstraintdialog.h:109
umlforeignkeyconstraintdialog.h
UMLDoc::findUMLObjectRecursive
UMLObject * findUMLObjectRecursive(Uml::ModelType::Enum, const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject)
Definition: umldoc.cpp:1134
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLForeignKeyConstraintDialog::m_GeneralWidgets
GeneralWidgets m_GeneralWidgets
Definition: umlforeignkeyconstraintdialog.h:106
umldoc.h
UMLDoc::entities
UMLEntityList entities(bool includeNested=true)
Definition: umldoc.cpp:3028
enum.h
UMLForeignKeyConstraintDialog::GeneralWidgets::actionGB
QGroupBox * actionGB
Definition: umlforeignkeyconstraintdialog.h:64