• 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
  • dialogs
umloperationdialog.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) 2002-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 // own header
12 #include "umloperationdialog.h"
13 
14 //app includes
15 #include "debug_utils.h"
16 #include "uml.h"
17 #include "umldoc.h"
18 #include "operation.h"
19 #include "classifier.h"
20 #include "template.h"
21 #include "listpopupmenu.h"
22 #include "umlattributelist.h"
23 #include "classifierlistitem.h"
24 #include "umlclassifierlistitemlist.h"
25 #include "dialog_utils.h"
26 #include "parmpropdlg.h"
27 #include "stereotype.h"
28 #include "uniqueid.h"
29 
30 //kde includes
31 #include <klineedit.h>
32 #include <kcombobox.h>
33 #include <klocale.h>
34 #include <kmessagebox.h>
35 #include <kdialogbuttonbox.h>
36 
37 //qt includes
38 #include <QCheckBox>
39 #include <QGridLayout>
40 #include <QGroupBox>
41 #include <QHBoxLayout>
42 #include <QLabel>
43 #include <QLayout>
44 #include <QListWidget>
45 #include <QPointer>
46 #include <QPushButton>
47 #include <QRadioButton>
48 #include <QToolButton>
49 #include <QVBoxLayout>
50 
54 UMLOperationDialog::UMLOperationDialog(QWidget * parent, UMLOperation * pOperation)
55  : KDialog(parent)
56 {
57  setCaption(i18n("Operation Properties"));
58  setButtons(Help | Ok | Cancel);
59  setDefaultButton(Ok);
60  setModal(true);
61  showButtonSeparator(true);
62 
63  m_operation = pOperation;
64  m_doc = UMLApp::app()->document();
65  m_menu = 0;
66  setupDialog();
67  connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
68  connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
69 }
70 
74 UMLOperationDialog::~UMLOperationDialog()
75 {
76 }
77 
81 void UMLOperationDialog::setupDialog()
82 {
83  QFrame *frame = new QFrame(this);
84  setMainWidget(frame);
85  int margin = fontMetrics().height();
86  QVBoxLayout * topLayout = new QVBoxLayout(frame);
87 
88  m_pGenGB = new QGroupBox(i18n("General Properties"), frame);
89  QGridLayout * genLayout = new QGridLayout(m_pGenGB);
90  genLayout->setColumnStretch(1, 1);
91  genLayout->setColumnStretch(3, 1);
92  genLayout->addItem(new QSpacerItem(200, 0), 0, 1);
93  genLayout->addItem(new QSpacerItem(200, 0), 0, 3);
94  genLayout->setMargin(margin);
95  genLayout->setSpacing(10);
96 
97  Dialog_Utils::makeLabeledEditField(m_pGenGB, genLayout, 0,
98  m_pNameL, i18nc("operation name", "&Name:"),
99  m_pNameLE, m_operation->name());
100 
101  m_pRtypeL = new QLabel(i18n("&Type:"), m_pGenGB);
102  genLayout->addWidget(m_pRtypeL, 0, 2);
103 
104  m_pRtypeCB = new KComboBox(true, m_pGenGB);
105  genLayout->addWidget(m_pRtypeCB, 0, 3);
106  m_pRtypeL->setBuddy(m_pRtypeCB);
107 
108  m_pStereoTypeL = new QLabel(i18n("Stereotype name:"), m_pGenGB);
109  genLayout->addWidget(m_pStereoTypeL, 1, 0);
110  m_pStereoTypeCB = new KComboBox(true, m_pGenGB);
111  genLayout->addWidget(m_pStereoTypeCB, 1, 1);
112 
113  m_pAbstractCB = new QCheckBox(i18n("&Abstract operation"), m_pGenGB);
114  m_pAbstractCB->setChecked(m_operation->isAbstract());
115  genLayout->addWidget(m_pAbstractCB, 2, 0);
116  m_pStaticCB = new QCheckBox(i18n("Classifier &scope (\"static\")"), m_pGenGB);
117  m_pStaticCB->setChecked(m_operation->isStatic());
118  genLayout->addWidget(m_pStaticCB, 2, 1);
119  m_pQueryCB = new QCheckBox(i18n("&Query (\"const\")"), m_pGenGB);
120  m_pQueryCB->setChecked(m_operation->getConst());
121  genLayout->addWidget(m_pQueryCB, 2, 2);
122 
123  m_pScopeGB = new QGroupBox(i18n("Visibility"), frame);
124 
125  QHBoxLayout * scopeLayout = new QHBoxLayout(m_pScopeGB);
126  scopeLayout->setMargin(margin);
127 
128  m_pPublicRB = new QRadioButton(i18nc("public visibility", "P&ublic"), m_pScopeGB);
129  scopeLayout->addWidget(m_pPublicRB);
130 
131  m_pPrivateRB = new QRadioButton(i18nc("private visibility", "P&rivate"), m_pScopeGB);
132  scopeLayout->addWidget(m_pPrivateRB);
133 
134  m_pProtectedRB = new QRadioButton(i18nc("protected visibility", "Prot&ected"), m_pScopeGB);
135  scopeLayout->addWidget(m_pProtectedRB);
136 
137  m_pImplementationRB = new QRadioButton(i18n("I&mplementation"), m_pScopeGB);
138  scopeLayout->addWidget(m_pImplementationRB);
139 
140  m_pParmsGB = new QGroupBox(i18n("Parameters"), frame);
141  QVBoxLayout* parmsLayout = new QVBoxLayout(m_pParmsGB);
142  parmsLayout->setMargin(margin);
143  parmsLayout->setSpacing(10);
144 
145  // horizontal box contains the list box and the move up/down buttons
146  QHBoxLayout* parmsHBoxLayout = new QHBoxLayout();
147  m_pParmsLW = new QListWidget(m_pParmsGB);
148  m_pParmsLW->setContextMenuPolicy(Qt::CustomContextMenu);
149 
150  // the move up/down buttons (another vertical box)
151  QVBoxLayout* buttonLayout = new QVBoxLayout();
152 
153  m_pUpButton = new QToolButton(m_pParmsGB);
154  m_pUpButton->setArrowType(Qt::UpArrow);
155  m_pUpButton->setEnabled(false);
156  buttonLayout->addWidget(m_pUpButton);
157 
158  m_pDownButton = new QToolButton(m_pParmsGB);
159  m_pDownButton->setArrowType(Qt::DownArrow);
160  m_pDownButton->setEnabled(false);
161  buttonLayout->addWidget(m_pDownButton);
162 
163  KDialogButtonBox* buttonBox = new KDialogButtonBox(m_pParmsGB);
164  buttonBox->addButton(i18n("Ne&w Parameter..."), KDialogButtonBox::ActionRole,
165  this, SLOT(slotNewParameter()));
166  m_pDeleteButton = buttonBox->addButton(i18n("&Delete"), KDialogButtonBox::ActionRole,
167  this, SLOT(slotDeleteParameter()));
168  m_pPropertiesButton = buttonBox->addButton(i18n("&Properties"), KDialogButtonBox::ActionRole,
169  this, SLOT(slotParameterProperties()));
170 
171  parmsHBoxLayout->addWidget(m_pParmsLW);
172  parmsHBoxLayout->addLayout(buttonLayout);
173 
174  parmsLayout->addLayout(parmsHBoxLayout);
175  parmsLayout->addWidget(buttonBox);
176 
177  topLayout->addWidget(m_pGenGB);
178  topLayout->addWidget(m_pScopeGB);
179  topLayout->addWidget(m_pParmsGB);
180 
181  m_pDeleteButton->setEnabled(false);
182  m_pPropertiesButton->setEnabled(false);
183  m_pUpButton->setEnabled(false);
184  m_pDownButton->setEnabled(false);
185 
186  m_pRtypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
187  m_pRtypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
188  // add the return types
189  insertTypesSorted(m_operation->getTypeName());
190 
191  // fill in parm list box
192  UMLAttributeList list = m_operation->getParmList();
193  foreach (UMLAttribute* pAtt, list) {
194  m_pParmsLW->addItem(pAtt->toString(Uml::SignatureType::SigNoVis));
195  }
196 
197  // set scope
198  switch (m_operation->visibility()) {
199  case Uml::Visibility::Public:
200  m_pPublicRB->setChecked(true);
201  break;
202  case Uml::Visibility::Private:
203  m_pPrivateRB->setChecked(true);
204  break;
205  case Uml::Visibility::Protected:
206  m_pProtectedRB->setChecked(true);
207  break;
208  case Uml::Visibility::Implementation:
209  m_pImplementationRB->setChecked(true);
210  break;
211  default:
212  break;
213  }
214 
215  // manage stereotypes
216  m_pStereoTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
217  m_pStereoTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
218  insertStereotypesSorted(m_operation->stereotype());
219 
220  // setup parm list box signals
221  connect(m_pUpButton, SIGNAL(clicked()), this, SLOT(slotParameterUp()));
222  connect(m_pDownButton, SIGNAL(clicked()), this, SLOT(slotParameterDown()));
223 
224  connect(m_pParmsLW, SIGNAL(itemClicked(QListWidgetItem*)),
225  this, SLOT(slotParamsBoxClicked(QListWidgetItem*)));
226  connect(m_pParmsLW, SIGNAL(customContextMenuRequested(QPoint)),
227  this, SLOT(slotParmRightButtonPressed(QPoint)));
228  connect(m_pParmsLW, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
229  this, SLOT(slotParmDoubleClick(QListWidgetItem*)));
230 
231  m_pNameLE->setFocus();
232  connect(m_pNameLE, SIGNAL(textChanged(QString)), SLOT(slotNameChanged(QString)));
233  slotNameChanged(m_pNameLE->text());
234 }
235 
236 void UMLOperationDialog::slotNameChanged(const QString &_text)
237 {
238  enableButtonOk(!_text.isEmpty());
239 }
240 
241 void UMLOperationDialog::slotParmRightButtonPressed(const QPoint &p)
242 {
243  ListPopupMenu::MenuType type = ListPopupMenu::mt_Undefined;
244  QListWidgetItem* item = m_pParmsLW->itemAt(p);
245  if (item) // pressed on an item
246  {
247  type = ListPopupMenu::mt_Parameter_Selected;
248  } else // pressed into fresh air
249  {
250  type = ListPopupMenu::mt_New_Parameter;
251  }
252  if (m_menu) {
253  m_menu->hide();
254  disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotMenuSelection(QAction*)));
255  delete m_menu;
256  m_menu = 0;
257  }
258  ListPopupMenu popup(this, type);
259  QAction *triggered = popup.exec(m_pParmsLW->mapToGlobal(p));
260  slotMenuSelection(triggered);
261 }
262 
263 void UMLOperationDialog::slotParmDoubleClick(QListWidgetItem *item)
264 {
265  if (!item) {
266  return;
267  }
268  // this happens, when there was no right click in the list widget
269  ListPopupMenu popup(this, ListPopupMenu::mt_Parameter_Selected);
270  QAction* action = popup.getAction(ListPopupMenu::mt_Properties);
271  slotMenuSelection(action);
272 }
273 
274 void UMLOperationDialog::slotMenuSelection(QAction* action)
275 {
276  ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action);
277  if(id == ListPopupMenu::mt_Rename || id == ListPopupMenu::mt_Properties) {
278  slotParameterProperties();
279  } else if(id == ListPopupMenu::mt_New_Parameter) {
280  slotNewParameter();
281  }
282  else if(id == ListPopupMenu::mt_Delete) {
283  slotDeleteParameter();
284  }
285 }
286 
287 void UMLOperationDialog::slotNewParameter()
288 {
289  UMLAttribute* pAtt = 0;
290 
291  QString currentName = m_operation->getUniqueParameterName();
292  UMLAttribute* newAttribute = new UMLAttribute(m_operation, currentName, Uml::ID::Reserved);
293 
294  QPointer<ParmPropDlg> dlg = new ParmPropDlg(this, m_doc, newAttribute);
295  if (dlg->exec()) {
296  pAtt = m_operation->findParm(newAttribute->name());
297 
298  if (!pAtt) {
299  newAttribute->setID(UniqueID::gen());
300  m_operation->addParm(newAttribute);
301  m_pParmsLW->addItem(newAttribute->toString(Uml::SignatureType::SigNoVis));
302  m_doc->setModified(true);
303  } else {
304  KMessageBox::sorry(this, i18n("The parameter name you have chosen\nis already being used in this operation."),
305  i18n("Parameter Name Not Unique"), 0);
306  delete newAttribute;
307  }
308  } else {
309  delete newAttribute;
310  }
311  delete dlg;
312 }
313 
314 void UMLOperationDialog::slotDeleteParameter()
315 {
316  UMLAttribute* pOldAtt = m_operation->getParmList().at(m_pParmsLW->row(m_pParmsLW->currentItem()));
317 
318  m_operation->removeParm(pOldAtt);
319  m_pParmsLW->takeItem(m_pParmsLW->currentRow());
320  m_doc->setModified(true);
321 
322  m_pDeleteButton->setEnabled(false);
323  m_pPropertiesButton->setEnabled(false);
324  m_pUpButton->setEnabled(false);
325  m_pDownButton->setEnabled(false);
326 }
327 
328 void UMLOperationDialog::slotParameterProperties()
329 {
330  UMLAttribute* pAtt = 0, * pOldAtt = 0;
331 
332  int position = m_pParmsLW->row(m_pParmsLW->currentItem());
333  pOldAtt = m_operation->getParmList().at(position);
334  if (!pOldAtt) {
335  uDebug() << "THE impossible has occurred for:" << m_pParmsLW->currentItem()->text();
336  return;
337  } // should never occur
338 
339  QString oldAttName = pOldAtt->name();
340  UMLAttribute* tempAttribute = static_cast<UMLAttribute*>(pOldAtt->clone()); // create a clone of the parameter
341 
342  // send the clone to the properties dialog box. it will fill in the new parameters.
343  QPointer<ParmPropDlg> dlg = new ParmPropDlg(this, m_doc, tempAttribute);
344  if (dlg->exec()) {
345  bool namingConflict = false;
346  QString newName = tempAttribute->name();
347 
348  pAtt = m_operation->findParm(newName); // search whether a parameter with this name already exists
349  if(pAtt && pAtt != pOldAtt) {
350  KMessageBox::error(this, i18n("The parameter name you have chosen is already being used in this operation."),
351  i18n("Parameter Name Not Unique"), 0);
352  namingConflict = true;
353  }
354 
355  tempAttribute->copyInto(pOldAtt); // copy all attributes from the clone
356  if (namingConflict) {
357  pOldAtt->setName(oldAttName); // reset the name if there was a naming conflict
358  }
359 
360  QListWidgetItem* item = m_pParmsLW->currentItem();
361  item->setText(pOldAtt->toString(Uml::SignatureType::SigNoVis));
362  m_doc->setModified(true);
363  }
364  delete tempAttribute;
365  delete dlg;
366 }
367 
368 void UMLOperationDialog::slotParameterUp()
369 {
370  int row = m_pParmsLW->currentRow();
371  QListWidgetItem* item = m_pParmsLW->currentItem();
372  if (item) {
373  UMLAttribute* pOldAtt = m_operation->getParmList().at(m_pParmsLW->row(item));
374 
375  m_operation->moveParmLeft(pOldAtt);
376  m_pParmsLW->takeItem(row);
377  m_pParmsLW->insertItem(row - 1, item);
378 
379  m_doc->setModified(true);
380  slotParamsBoxClicked(item);
381  }
382  else {
383  uDebug() << "No current item in list widget!?";
384  }
385 }
386 
387 void UMLOperationDialog::slotParameterDown()
388 {
389  int row = m_pParmsLW->currentRow();
390  QListWidgetItem* item = m_pParmsLW->currentItem();
391  if (item) {
392  UMLAttribute* pOldAtt = m_operation->getParmList().at(m_pParmsLW->row(item));
393 
394  m_operation->moveParmRight(pOldAtt);
395  m_pParmsLW->takeItem(row);
396  m_pParmsLW->insertItem(row + 1, item);
397 
398  m_doc->setModified(true);
399  slotParamsBoxClicked(item);
400  }
401  else {
402  uDebug() << "No current item in list widget!?";
403  }
404 }
405 
409 void UMLOperationDialog::slotParamsBoxClicked(QListWidgetItem* parameterItem)
410 {
411  if (parameterItem) {
412  m_pDeleteButton->setEnabled(true);
413  m_pPropertiesButton->setEnabled(true);
414  int row = m_pParmsLW->row(parameterItem);
415  bool hasNext = (row < m_pParmsLW->count() - 1);
416  bool hasPrev = (row > 0);
417  m_pUpButton->setEnabled(hasPrev);
418  m_pDownButton->setEnabled(hasNext);
419  } else {
420  m_pDeleteButton->setEnabled(false);
421  m_pPropertiesButton->setEnabled(false);
422  m_pUpButton->setEnabled(false);
423  m_pDownButton->setEnabled(false);
424  }
425 }
426 
431 bool UMLOperationDialog::apply()
432 {
433  QString name = m_pNameLE->text();
434  if(name.length() == 0) {
435  KMessageBox::error(this, i18n("You have entered an invalid operation name."),
436  i18n("Operation Name Invalid"), 0);
437  m_pNameLE->setText(m_operation->name());
438  return false;
439  }
440 
441  UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_operation->parent());
442  if(classifier != 0 &&
443  classifier->checkOperationSignature(name, m_operation->getParmList(), m_operation))
444  {
445  QString msg = i18n("An operation with that signature already exists in %1.\n", classifier->name())
446  +
447  i18n("Choose a different name or parameter list.");
448  KMessageBox::error(this, msg, i18n("Operation Name Invalid"), 0);
449  return false;
450  }
451  m_operation->setName(name);
452 
453  if(m_pPublicRB->isChecked())
454  m_operation->setVisibility(Uml::Visibility::Public);
455  else if(m_pPrivateRB->isChecked())
456  m_operation->setVisibility(Uml::Visibility::Private);
457  else if (m_pProtectedRB->isChecked())
458  m_operation->setVisibility(Uml::Visibility::Protected);
459  else if (m_pImplementationRB->isChecked())
460  m_operation->setVisibility(Uml::Visibility::Implementation);
461 
462  QString typeName = m_pRtypeCB->currentText();
463  UMLTemplate *tmplParam = 0;
464  if (classifier) {
465  tmplParam = classifier->findTemplate(typeName);
466  }
467  if (tmplParam)
468  m_operation->setType(tmplParam);
469  else
470  m_operation->setTypeName(typeName);
471 
472  m_operation->setStereotype(m_pStereoTypeCB->currentText());
473 
474  bool isAbstract = m_pAbstractCB->isChecked();
475  m_operation->setAbstract(isAbstract);
476  if (isAbstract) {
477  /* If any operation is abstract then the owning class needs
478  to be made abstract.
479  The inverse is not true: The fact that no operation is
480  abstract does not mean that the class must be non-abstract.
481  */
482  if (classifier) {
483  classifier->setAbstract(true);
484  }
485  }
486  m_operation->setStatic(m_pStaticCB->isChecked());
487  m_operation->setConst(m_pQueryCB->isChecked());
488 
489  return true;
490 }
491 
496 void UMLOperationDialog::slotApply()
497 {
498  apply();
499 }
500 
501 void UMLOperationDialog::slotOk()
502 {
503  if (apply()) {
504  accept();
505  }
506 }
507 
514 void UMLOperationDialog::insertTypesSorted(const QString& type)
515 {
516  QStringList types;
517  // Add "void". We use this for denoting "no return type" independent
518  // of the programming language.
519  // For example, the Ada generator would interpret the return type
520  // "void" as an instruction to generate a procedure instead of a
521  // function.
522  types << "void";
523  // add template parameters
524  UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_operation->parent());
525  if (classifier) {
526  UMLClassifierListItemList tmplParams(classifier->getFilteredList(UMLOperation::ot_Template));
527  foreach (UMLClassifierListItem* li, tmplParams) {
528  types << li->name();
529  }
530  }
531  // add the Classes and Interfaces (both are Concepts)
532  UMLClassifierList namesList(m_doc->concepts());
533  foreach (UMLClassifier* obj, namesList) {
534  types << obj->fullyQualifiedName();
535  }
536  // add the given parameter
537  if (!types.contains(type)) {
538  types << type;
539  }
540  types.sort();
541 
542  m_pRtypeCB->clear();
543  m_pRtypeCB->insertItems(-1, types);
544 
545  // select the given parameter
546  int currentIndex = m_pRtypeCB->findText(type);
547  if (currentIndex > -1) {
548  m_pRtypeCB->setCurrentIndex(currentIndex);
549  }
550 }
551 
558 void UMLOperationDialog::insertStereotypesSorted(const QString& type)
559 {
560  QStringList types;
561  foreach (UMLStereotype* currentSt, m_doc->stereotypes()) {
562  types << currentSt->name();
563  }
564  // add the given parameter
565  if (!types.contains(type)) {
566  types << type;
567  }
568  types.sort();
569 
570  m_pStereoTypeCB->clear();
571  m_pStereoTypeCB->insertItems(-1, types);
572 
573  // select the given parameter
574  int currentIndex = m_pStereoTypeCB->findText(type);
575  if (currentIndex > -1) {
576  m_pStereoTypeCB->setCurrentIndex(currentIndex);
577  }
578  m_pStereoTypeCB->completionObject()->addItem(type);
579 }
580 
581 #include "umloperationdialog.moc"
UMLOperationDialog::slotDeleteParameter
void slotDeleteParameter()
Definition: umloperationdialog.cpp:314
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Remove a parameter from the operation.
Definition: operation.cpp:151
UMLObject::setName
virtual void setName(const QString &strName)
Set the UMLObject's name.
Definition: umlobject.cpp:168
UMLOperationDialog::m_pRtypeCB
KComboBox * m_pRtypeCB
Definition: umloperationdialog.h:70
UMLOperation::getConst
bool getConst() const
Returns whether this operation is a query (C++ "const").
Definition: operation.cpp:411
dialog_utils.h
UMLClassifierListItemList
This sub-class adds copyInto and clone to the QPtrList base class...
Definition: umlclassifierlistitemlist.h:26
UMLOperationDialog::m_pStereoTypeL
QLabel * m_pStereoTypeL
Definition: umloperationdialog.h:69
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
UMLOperationDialog::m_pParmsLW
QListWidget * m_pParmsLW
Definition: umloperationdialog.h:61
UMLClassifierListItem
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
UMLOperationDialog::slotParameterProperties
void slotParameterProperties()
Definition: umloperationdialog.cpp:328
UMLOperationDialog::m_operation
UMLOperation * m_operation
The operation to represent.
Definition: umloperationdialog.h:54
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:435
UMLOperationDialog::m_pScopeGB
QGroupBox * m_pScopeGB
Definition: umloperationdialog.h:62
UMLOperationDialog::slotParmDoubleClick
void slotParmDoubleClick(QListWidgetItem *item)
Definition: umloperationdialog.cpp:263
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
UMLOperationDialog::slotParameterUp
void slotParameterUp()
Definition: umloperationdialog.cpp:368
UMLOperationDialog::m_pParmsGB
QGroupBox * m_pParmsGB
Definition: umloperationdialog.h:59
UMLObject::setVisibility
void setVisibility(Uml::Visibility::Enum visibility)
Sets the visibility of the object.
Definition: umlobject.cpp:445
ParmPropDlg
Displays a dialog box that displays properties of a parameter.
Definition: parmpropdlg.h:36
UMLOperationDialog::m_pStaticCB
QCheckBox * m_pStaticCB
Definition: umloperationdialog.h:74
UMLOperation::getUniqueParameterName
QString getUniqueParameterName()
Returns an unused parameter name for a new parameter.
Definition: operation.cpp:272
QWidget
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu types.
Definition: listpopupmenu.h:47
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
UMLOperationDialog::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: umloperationdialog.cpp:274
ListPopupMenu::mt_Rename
Definition: listpopupmenu.h:157
umloperationdialog.h
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
UMLOperationDialog::m_pNameLE
KLineEdit * m_pNameLE
Definition: umloperationdialog.h:72
UMLAttributeList
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
UMLAttribute::copyInto
virtual void copyInto(UMLObject *lhs) const
Copy the internal presentation of this object into the UMLAttribute object.
Definition: attribute.cpp:230
UMLTemplate
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
KDialog
UMLDoc::stereotypes
const UMLStereotypeList & stereotypes() const
Returns a list of the stereotypes in this UMLDoc.
Definition: umldoc.cpp:3022
UMLStereotype
This class is used to set up information for a stereotype.
Definition: stereotype.h:40
UMLObject::ot_Template
Definition: umlobject.h:61
UMLOperationDialog::slotParameterDown
void slotParameterDown()
Definition: umloperationdialog.cpp:387
classifier.h
UMLApp::document
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:872
UMLOperationDialog::apply
bool apply()
Checks if changes are valid and applies them if they are, else returns false.
Definition: umloperationdialog.cpp:431
UMLClassifier::checkOperationSignature
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=NULL)
Checks whether an operation is valid based on its signature - An operation is "valid" if the operatio...
Definition: classifier.cpp:136
debug_utils.h
Uml::Visibility::Private
Definition: basictypes.h:58
UMLOperation::setType
void setType(UMLObject *type)
Reimplement method from UMLClassifierListItem.
Definition: operation.cpp:87
UMLOperationDialog::slotOk
void slotOk()
Definition: umloperationdialog.cpp:501
UMLOperationDialog::m_pImplementationRB
QRadioButton * m_pImplementationRB
Definition: umloperationdialog.h:66
UMLOperationDialog::m_pPublicRB
QRadioButton * m_pPublicRB
Definition: umloperationdialog.h:63
Uml::SignatureType::SigNoVis
Definition: basictypes.h:137
UMLOperation::findParm
UMLAttribute * findParm(const QString &name)
Finds a parameter of the operation.
Definition: operation.cpp:182
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Add a parameter to the operation.
Definition: operation.cpp:259
listpopupmenu.h
UMLOperationDialog::setupDialog
void setupDialog()
Sets up the dialog.
Definition: umloperationdialog.cpp:81
ListPopupMenu::mt_Delete
Definition: listpopupmenu.h:158
parmpropdlg.h
UMLOperationDialog::m_pGenGB
QGroupBox * m_pGenGB
Definition: umloperationdialog.h:60
umlattributelist.h
UMLDoc::concepts
UMLClassifierList concepts(bool includeNested=true)
Returns a list of the concepts in this UMLDoc.
Definition: umldoc.cpp:2463
ListPopupMenu::mt_New_Parameter
Definition: listpopupmenu.h:116
template.h
UMLOperationDialog::slotParmRightButtonPressed
void slotParmRightButtonPressed(const QPoint &p)
Definition: umloperationdialog.cpp:241
Uml::Visibility::Implementation
Definition: basictypes.h:60
UMLOperationDialog::m_pUpButton
QToolButton * m_pUpButton
Definition: umloperationdialog.h:78
UMLOperationDialog::m_pDownButton
QToolButton * m_pDownButton
Definition: umloperationdialog.h:79
UMLOperationDialog::slotNewParameter
void slotNewParameter()
Definition: umloperationdialog.cpp:287
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
UMLOperationDialog::slotNameChanged
void slotNameChanged(const QString &)
Definition: umloperationdialog.cpp:236
stereotype.h
UMLOperationDialog::~UMLOperationDialog
~UMLOperationDialog()
Destructor.
Definition: umloperationdialog.cpp:74
uDebug
#define uDebug()
Definition: debug_utils.h:95
Dialog_Utils::makeLabeledEditField
KLineEdit * makeLabeledEditField(QGroupBox *containingBox, QGridLayout *layout, int row, QLabel *&label, const QString &labelText, KLineEdit *&editField, const QString &editFieldText)
Create a labeled text lineedit widget.
Definition: dialog_utils.cpp:43
UMLDoc::setModified
void setModified(bool modified=true)
Sets the modified flag for the document after a modifying action on the view connected to the documen...
Definition: umldoc.cpp:2607
UMLOperationDialog::m_pDeleteButton
QPushButton * m_pDeleteButton
Definition: umloperationdialog.h:76
UMLOperationDialog::m_pAbstractCB
QCheckBox * m_pAbstractCB
Definition: umloperationdialog.h:73
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Returns the stereotype.
Definition: umlobject.cpp:581
UMLOperation::setConst
void setConst(bool b)
Sets whether this operation is a query (C++ "const").
Definition: operation.cpp:403
Uml::Visibility::Public
Definition: basictypes.h:57
UMLOperationDialog::m_pProtectedRB
QRadioButton * m_pProtectedRB
Definition: umloperationdialog.h:65
UMLObject::isStatic
bool isStatic() const
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition: umlobject.cpp:335
operation.h
umldoc.h
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
UMLOperationDialog::m_menu
ListPopupMenu * m_menu
Menu used in parameter list box.
Definition: umloperationdialog.h:56
ListPopupMenu::mt_Properties
Definition: listpopupmenu.h:156
UMLOperation::moveParmLeft
void moveParmLeft(UMLAttribute *a)
Move a parameter one position to the left.
Definition: operation.cpp:99
UMLOperationDialog::insertStereotypesSorted
void insertStereotypesSorted(const QString &type)
Inserts stereotype into the stereotype-combobox as well as its completion object. ...
Definition: umloperationdialog.cpp:558
UMLOperationDialog::slotApply
void slotApply()
I don't think this is used, but if we had an apply button it would slot into here.
Definition: umloperationdialog.cpp:496
classifierlistitem.h
ListPopupMenu
A popup menu that depending on what type is set to will display a different menu. ...
Definition: listpopupmenu.h:40
ListPopupMenu::getAction
QAction * getAction(MenuType idx)
Get the action from the menu type as index.
Definition: listpopupmenu.cpp:1890
UMLOperationDialog::m_doc
UMLDoc * m_doc
The UMLDocument where all objects live.
Definition: umloperationdialog.h:55
ListPopupMenu::mt_Parameter_Selected
Definition: listpopupmenu.h:126
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
uniqueid.h
umlclassifierlistitemlist.h
UMLOperationDialog::slotParamsBoxClicked
void slotParamsBoxClicked(QListWidgetItem *parameterItem)
Enables or disables buttons.
Definition: umloperationdialog.cpp:409
UMLObject::setID
virtual void setID(Uml::ID::Type NewID)
Assigns a new Id to the object.
Definition: umlobject.cpp:159
QToolButton
UMLObject::setAbstract
void setAbstract(bool bAbstract)
Sets the paste state of the object.
Definition: umlobject.cpp:320
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1122
UMLOperationDialog::insertTypesSorted
void insertTypesSorted(const QString &type="")
Inserts type into the type-combobox.
Definition: umloperationdialog.cpp:514
UMLObject::isAbstract
bool isAbstract() const
Returns the abstract state of the object.
Definition: umlobject.cpp:312
UMLClassifier::findTemplate
UMLTemplate * findTemplate(const QString &name)
Seeks the template parameter of the given name.
Definition: classifier.cpp:1137
UMLObject::setStatic
void setStatic(bool bStatic)
Sets the value for m_bStatic.
Definition: umlobject.cpp:343
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Returns the fully qualified name, i.e.
Definition: umlobject.cpp:201
UMLOperationDialog::m_pRtypeL
QLabel * m_pRtypeL
Definition: umloperationdialog.h:67
UMLOperationDialog::m_pNameL
QLabel * m_pNameL
Definition: umloperationdialog.h:68
UMLOperationDialog::m_pPrivateRB
QRadioButton * m_pPrivateRB
Definition: umloperationdialog.h:64
UMLOperationDialog::m_pQueryCB
QCheckBox * m_pQueryCB
Definition: umloperationdialog.h:75
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
UMLAttribute::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the UMLAttribute.
Definition: attribute.cpp:132
UMLOperationDialog::m_pStereoTypeCB
KComboBox * m_pStereoTypeCB
Definition: umloperationdialog.h:71
Uml::ID::Reserved
const Type Reserved
special value for illegal ID
Definition: basictypes.h:320
Uml::Visibility::Protected
Definition: basictypes.h:59
UMLObject::setStereotype
void setStereotype(const QString &_name)
Sets the classes stereotype name.
Definition: umlobject.cpp:494
UMLOperationDialog::m_pPropertiesButton
QPushButton * m_pPropertiesButton
Definition: umloperationdialog.h:77
UMLClassifierListItem::setTypeName
void setTypeName(const QString &type)
Sets the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:139
ListPopupMenu::mt_Undefined
Definition: listpopupmenu.h:236
uml.h
UMLOperation::getParmList
UMLAttributeList getParmList() const
Returns a list of parameters.
Definition: operation.cpp:171
UMLOperationDialog::UMLOperationDialog
UMLOperationDialog(QWidget *parent, UMLOperation *pOperation)
Constructor.
Definition: umloperationdialog.cpp:54
UMLOperation::moveParmRight
void moveParmRight(UMLAttribute *a)
Move a parameter one position to the right.
Definition: operation.cpp:123
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 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