• 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.14
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
  • idl
idlwriter.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-2014 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #include "idlwriter.h"
12 
13 #include "umldoc.h"
14 #include "classifier.h"
15 #include "debug_utils.h"
16 #include "enum.h"
17 #include "classifierlistitem.h"
18 #include "umlclassifierlistitemlist.h"
19 #include "package.h"
20 #include "association.h"
21 #include "attribute.h"
22 #include "operation.h"
23 
24 #include <kmessagebox.h>
25 
26 #include <QFile>
27 #include <QRegExp>
28 #include <QTextStream>
29 
30 IDLWriter::IDLWriter() : SimpleCodeGenerator(false)
31 {
32 }
33 
34 IDLWriter::~IDLWriter()
35 {
36 }
37 
38 bool IDLWriter::isOOClass(UMLClassifier *c)
39 {
40  QString stype = c->stereotype();
41  if (stype == QLatin1String("CORBAConstant") || stype == QLatin1String("CORBAEnum") ||
42  stype == QLatin1String("CORBAStruct") || stype == QLatin1String("CORBAUnion") ||
43  stype == QLatin1String("CORBASequence") || stype == QLatin1String("CORBAArray") ||
44  stype == QLatin1String("CORBATypedef"))
45  return false;
46 
47  // CORBAValue, CORBAInterface, and all empty/unknown stereotypes are
48  // assumed to be OO classes.
49  return true;
50 }
51 
52 bool IDLWriter::assocTypeIsMappableToAttribute(Uml::AssociationType::Enum at)
53 {
54  return (at == Uml::AssociationType::Aggregation || at == Uml::AssociationType::Association ||
55  at == Uml::AssociationType::Composition || at == Uml::AssociationType::UniAssociation);
56 }
57 
61 Uml::ProgrammingLanguage::Enum IDLWriter::language() const
62 {
63  return Uml::ProgrammingLanguage::IDL;
64 }
65 
66 void IDLWriter::computeAssocTypeAndRole(UMLAssociation *a, UMLClassifier *c,
67  QString& typeName, QString& roleName)
68 {
69  // Determine which is the "remote" end of the association:
70  bool IAmRoleA = true;
71  UMLObject *other = a->getObject(Uml::RoleType::B);
72  Uml::AssociationType::Enum at = a->getAssocType();
73  if (c->name() == other->name()) {
74  if (at == Uml::AssociationType::Aggregation || at == Uml::AssociationType::Composition ||
75  at == Uml::AssociationType::UniAssociation) {
76  // Assuming unidirectional association, and we are
77  // at the "wrong" side.
78  // Returning roleName = QString() tells caller to
79  // skip this association at this side.
80  roleName.clear();
81  return;
82  }
83  IAmRoleA = false;
84  other = a->getObject(Uml::RoleType::A);
85  }
86  // Construct the type name:
87  typeName = cleanName(other->name());
88  QString multiplicity;
89  if (IAmRoleA)
90  multiplicity = a->getMultiplicity(Uml::RoleType::B);
91  else
92  multiplicity = a->getMultiplicity(Uml::RoleType::A);
93  if (!multiplicity.isEmpty() && multiplicity != QLatin1String("1"))
94  typeName.append(QLatin1String("Vector"));
95  // Construct the member name:
96  if (IAmRoleA)
97  roleName = a->getRoleName(Uml::RoleType::B);
98  else
99  roleName = a->getRoleName(Uml::RoleType::A);
100  if (roleName.isEmpty()) {
101  roleName = a->name();
102  if (roleName.isEmpty()) {
103  roleName = QLatin1String("m_") + typeName;
104  }
105  }
106 }
107 
112 void IDLWriter::writeClass(UMLClassifier *c)
113 {
114  if (!c) {
115  uDebug() << "Cannot write class of NULL concept!";
116  return;
117  }
118 
119  const bool isClass = !c->isInterface();
120  QString classname = cleanName(c->name());
121 
122  //find an appropriate name for our file
123  QString fileName = findFileName(c, QLatin1String(".idl"));
124  if (fileName.isEmpty()) {
125  emit codeGenerated(c, false);
126  return;
127  }
128 
129  QFile file;
130  if (!openFile(file, fileName)) {
131  emit codeGenerated(c, false);
132  return;
133  }
134 
135  // Start generating the code.
136 
137  QTextStream idl(&file);
138  //try to find a heading file(license, comments, etc)
139  QString str;
140  str = getHeadingFile(QLatin1String(".idl"));
141  if (!str.isEmpty()) {
142  str.replace(QRegExp(QLatin1String("%filename%")), fileName);
143  str.replace(QRegExp(QLatin1String("%filepath%")), file.fileName());
144  idl << str << m_endl;
145  }
146 
147  // Write includes.
148  UMLPackageList includes;
149  findObjectsRelated(c, includes);
150  if (includes.count()) {
151  foreach (UMLPackage* conc, includes) {
152  if (conc->baseType() == UMLObject::ot_Datatype)
153  continue;
154  QString incName = findFileName(conc, QLatin1String(".idl"));
155  if (!incName.isEmpty())
156  idl << "#include \"" << incName << "\"" << m_endl;
157  }
158  idl << m_endl;
159  }
160 
161  // Generate the module declaration(s) for the package(s) in which
162  // we are embedded.
163  UMLPackageList pkgList = c->packages();
164 
165  foreach (UMLPackage* pkg, pkgList) {
166  idl << indent() << "module " << pkg->name() << " {" << m_endl << m_endl;
167  m_indentLevel++;
168  }
169 
170  // Write class Documentation if non-empty or if force option set.
171  if (forceDoc() || !c->doc().isEmpty()) {
172  idl << "//" << m_endl;
173  idl << "// class " << classname << m_endl;
174  idl << formatDoc(c->doc(), QLatin1String("// "));
175  idl << m_endl;
176  }
177 
178  if (c->baseType() == UMLObject::ot_Enum) {
179  UMLClassifierListItemList litList = c->getFilteredList(UMLObject::ot_EnumLiteral);
180  uint i = 0;
181  idl << indent() << "enum " << classname << " {" << m_endl;
182  m_indentLevel++;
183  foreach (UMLClassifierListItem *lit, litList) {
184  QString enumLiteral = cleanName(lit->name());
185  idl << indent() << enumLiteral;
186  if (++i < (uint)litList.count())
187  idl << ",";
188  idl << m_endl;
189  }
190  m_indentLevel--;
191  idl << indent() << "};" << m_endl << m_endl;
192  // Close the modules inside which we might be nested.
193  for (int i = 0; i < pkgList.count(); ++i) {
194  m_indentLevel--;
195  idl << indent() << "};" << m_endl << m_endl;
196  }
197  return;
198  }
199  if (! isOOClass(c)) {
200  QString stype = c->stereotype();
201  if (stype == QLatin1String("CORBAConstant")) {
202  uError() << "The stereotype " << stype << " cannot be applied to "
203  << c->name() << ", but only to attributes.";
204  return;
205  }
206  if (!isClass) {
207  uError() << "The stereotype " << stype
208  << " cannot be applied to " << c->name()
209  << ", but only to classes.";
210  return;
211  }
212  if (stype == QLatin1String("CORBAEnum")) {
213  UMLAttributeList atl = c->getAttributeList();
214 
215  idl << indent() << "enum " << classname << " {" << m_endl;
216  m_indentLevel++;
217  uint i = 0;
218  foreach (UMLAttribute* at, atl) {
219  QString enumLiteral = cleanName(at->name());
220  idl << indent() << enumLiteral;
221  if (++i < (uint)atl.count())
222  idl << ",";
223  idl << m_endl;
224  }
225  m_indentLevel--;
226  idl << indent() << "};" << m_endl << m_endl;
227  } else if (stype == QLatin1String("CORBAStruct")) {
228  UMLAttributeList atl = c->getAttributeList();
229 
230  idl << indent() << "struct " << classname << " {" << m_endl;
231  m_indentLevel++;
232  foreach (UMLAttribute* at, atl) {
233  QString name = cleanName(at->name());
234  idl << indent() << at->getTypeName() << " " << name << ";" << m_endl;
235  // Initial value not possible in IDL.
236  }
237  UMLAssociationList compositions = c->getCompositions();
238  if (!compositions.isEmpty()) {
239  idl << indent() << "// Compositions." << m_endl;
240  foreach (UMLAssociation *a, compositions) {
241  QString memberType, memberName;
242  computeAssocTypeAndRole(a, c, memberType, memberName);
243  idl << indent() << memberType << " " << memberName << ";" << m_endl;
244  }
245  }
246  UMLAssociationList aggregations = c->getAggregations();
247  if (!aggregations.isEmpty()) {
248  idl << indent() << "// Aggregations." << m_endl;
249  foreach (UMLAssociation *a, aggregations) {
250  QString memberType, memberName;
251  computeAssocTypeAndRole(a, c, memberType, memberName);
252  idl << indent() << memberType << " " << memberName << ";" << m_endl;
253  }
254  }
255  m_indentLevel--;
256  idl << indent() << "};" << m_endl << m_endl;
257  } else if (stype == QLatin1String("CORBAUnion")) {
258  idl << indent() << "// " << stype << " " << c->name()
259  << " is Not Yet Implemented" << m_endl << m_endl;
260  } else if (stype == QLatin1String("CORBATypedef")) {
261  UMLClassifierList superclasses = c->getSuperClasses();
262  UMLClassifier* firstParent = superclasses.first();
263  idl << indent() << "typedef " << firstParent->name() << " "
264  << c->name() << ";" << m_endl << m_endl;
265  } else {
266  idl << indent() << "// " << stype << ": Unknown stereotype" << m_endl << m_endl;
267  }
268  // Close the modules inside which we might be nested.
269  for (int i = 0; i < pkgList.count(); ++i) {
270  m_indentLevel--;
271  idl << indent() << "};" << m_endl << m_endl;
272  }
273  return;
274  }
275 
276  idl << indent();
277  if (c->isAbstract())
278  idl << "abstract ";
279  bool isValuetype = (c->stereotype() == QLatin1String("CORBAValue"));
280  if (isValuetype)
281  idl << "valuetype ";
282  else
283  idl << "interface ";
284  idl << c->name();
285  UMLClassifierList superclasses = c->getSuperClasses();
286  if (! superclasses.isEmpty()) {
287  idl << " : ";
288  int count = superclasses.count();
289  foreach(UMLClassifier* parent, superclasses) {
290  count--;
291  idl << parent->fullyQualifiedName(QLatin1String("::"));
292  if (count)
293  idl << ", ";
294  }
295  }
296  idl << " {" << m_endl << m_endl;
297  m_indentLevel++;
298 
299  // Generate auxiliary declarations for multiplicity of associations
300 
301  bool didComment = false;
302  UMLAssociationList assocs = c->getAssociations();
303  foreach (UMLAssociation *a, assocs) {
304  if (! assocTypeIsMappableToAttribute(a->getAssocType()))
305  continue;
306  QString multiplicity = a->getMultiplicity(Uml::RoleType::A);
307  if (multiplicity.isEmpty() || multiplicity == QLatin1String("1"))
308  continue;
309  if (!didComment) {
310  idl << indent() << "// Types for association multiplicities" << m_endl << m_endl;
311  didComment = true;
312  }
313  UMLClassifier* other = (UMLClassifier*)a->getObject(Uml::RoleType::A);
314  QString bareName = cleanName(other->name());
315  idl << indent() << "typedef sequence<" << other->fullyQualifiedName(QLatin1String("::"))
316  << "> " << bareName << "Vector;" << m_endl << m_endl;
317  }
318 
319  // Generate public attributes.
320  if (isClass) {
321  UMLAttributeList atl = c->getAttributeList();
322  if (forceSections() || atl.count()) {
323  idl << indent() << "// Attributes:" << m_endl << m_endl;
324  foreach (UMLAttribute *at, atl) {
325  QString attName = cleanName(at->name());
326  Uml::Visibility::Enum scope = at->visibility();
327  idl << indent();
328  if (isValuetype) {
329  if (scope == Uml::Visibility::Public)
330  idl << "public ";
331  else
332  idl << "private ";
333  } else {
334  if (scope != Uml::Visibility::Public) {
335  idl << "// visibility should be: "
336  << Uml::Visibility::toString(scope)
337  << m_endl;
338  idl << indent();
339  }
340  idl << "attribute ";
341  }
342  idl << at->getTypeName() << " " << attName << ";"
343  << m_endl << m_endl;
344  }
345  }
346  }
347 
348  // Generate public operations.
349  UMLOperationList opl(c->getOpList());
350  UMLOperationList oppub;
351 
352  foreach (UMLOperation* op, opl) {
353  if (op->visibility() == Uml::Visibility::Public)
354  oppub.append(op);
355  }
356  if (forceSections() || oppub.count()) {
357  idl << indent() << "// Public methods:" << m_endl << m_endl;
358  foreach (UMLOperation* op, oppub)
359  writeOperation(op, idl);
360  idl << m_endl;
361  }
362 
363  if (forceSections() || !assocs.isEmpty()) {
364  idl << indent() << "// Associations:" << m_endl << m_endl;
365  foreach (UMLAssociation* a, assocs) {
366  Uml::AssociationType::Enum at = a->getAssocType();
367  if (! assocTypeIsMappableToAttribute(at))
368  continue;
369  QString typeName, roleName;
370  computeAssocTypeAndRole(a, c, typeName, roleName);
371  if (roleName.isEmpty()) // presumably because we are at the "wrong" end
372  continue;
373  idl << indent() << "// " << Uml::AssociationType::toString(at) << m_endl;
374  idl << indent();
375  if (isValuetype)
376  idl << "public ";
377  else
378  idl << "attribute ";
379  idl << typeName << " " << roleName << ";" << m_endl;
380  }
381  idl << m_endl;
382  }
383 
384  m_indentLevel--;
385  idl << indent() << "};" << m_endl << m_endl;
386 
387  // Close the modules inside which we might be nested.
388  for (int i = 0; i < pkgList.count(); ++i) {
389  m_indentLevel--;
390  idl << indent() << "};" << m_endl << m_endl;
391  }
392  file.close();
393  emit codeGenerated(c, true);
394  emit showGeneratedFile(file.fileName());
395 }
396 
402 void IDLWriter::writeOperation(UMLOperation *op, QTextStream &idl, bool is_comment)
403 {
404  UMLAttributeList atl = op->getParmList();
405  QString rettype = op->getTypeName();
406 
407  if (rettype.isEmpty())
408  rettype = QLatin1String("void");
409  idl << indent();
410  if (is_comment)
411  idl << "// ";
412  idl << rettype << " " << cleanName(op->name()) << " (";
413  if (atl.count()) {
414  idl << m_endl;
415  m_indentLevel++;
416  uint i = 0;
417  foreach (UMLAttribute *at, atl) {
418  idl << indent();
419  if (is_comment)
420  idl << "// ";
421  Uml::ParameterDirection::Enum pk = at->getParmKind();
422  if (pk == Uml::ParameterDirection::Out)
423  idl << "out ";
424  else if (pk == Uml::ParameterDirection::InOut)
425  idl << "inout ";
426  else
427  idl << "in ";
428  idl << at->getTypeName() << " " << cleanName(at->name());
429  if (++i < (uint)atl.count())
430  idl << "," << m_endl;
431  }
432  m_indentLevel--;
433  }
434  idl << ");" << m_endl << m_endl;
435 }
436 
437 QStringList IDLWriter::defaultDatatypes()
438 {
439  QStringList l;
440  l.append(QLatin1String("boolean"));
441  l.append(QLatin1String("char"));
442  l.append(QLatin1String("octet"));
443  l.append(QLatin1String("short"));
444  l.append(QLatin1String("unsigned short"));
445  l.append(QLatin1String("long"));
446  l.append(QLatin1String("unsigned long"));
447  l.append(QLatin1String("float"));
448  l.append(QLatin1String("double"));
449  l.append(QLatin1String("string"));
450  l.append(QLatin1String("any"));
451  return l;
452 }
453 
457 QStringList IDLWriter::reservedKeywords() const
458 {
459  static QStringList keywords;
460 
461  if (keywords.isEmpty()) {
462  keywords
463  << QLatin1String("any")
464  << QLatin1String("attribute")
465  << QLatin1String("boolean")
466  << QLatin1String("case")
467  << QLatin1String("char")
468  << QLatin1String("const")
469  << QLatin1String("context")
470  << QLatin1String("default")
471  << QLatin1String("double")
472  << QLatin1String("enum")
473  << QLatin1String("exception")
474  << QLatin1String("FALSE")
475  << QLatin1String("float")
476  << QLatin1String("in")
477  << QLatin1String("inout")
478  << QLatin1String("interface")
479  << QLatin1String("long")
480  << QLatin1String("module")
481  << QLatin1String("octet")
482  << QLatin1String("oneway")
483  << QLatin1String("out")
484  << QLatin1String("raises")
485  << QLatin1String("readonly")
486  << QLatin1String("sequence")
487  << QLatin1String("short")
488  << QLatin1String("string")
489  << QLatin1String("struct")
490  << QLatin1String("switch")
491  << QLatin1String("TRUE")
492  << QLatin1String("typedef")
493  << QLatin1String("union")
494  << QLatin1String("unsigned")
495  << QLatin1String("void");
496  }
497 
498  return keywords;
499 }
Uml::AssociationType::Aggregation
Definition: basictypes.h:103
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Shorthand for getSpecificAssocs(Uml::at_Aggregation)
Definition: umlcanvasobject.cpp:423
UMLObject::packages
UMLPackageList packages(bool includeRoot=false) const
Return a list of the packages in which this class is embedded.
Definition: umlobject.cpp:621
UMLAssociation::getObject
UMLObject * getObject(Uml::RoleType::Enum role) const
Returns the UMLObject assigned to the given role.
Definition: association.cpp:497
UMLObject::ot_EnumLiteral
Definition: umlobject.h:61
UMLPackage
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
UMLClassifierListItemList
This sub-class adds copyInto and clone to the QPtrList base class...
Definition: umlclassifierlistitemlist.h:26
QString::append
QString & append(QChar ch)
IDLWriter::~IDLWriter
virtual ~IDLWriter()
Definition: idlwriter.cpp:34
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
IDLWriter::IDLWriter
IDLWriter()
Definition: idlwriter.cpp:30
Uml::ProgrammingLanguage::IDL
Definition: basictypes.h:253
UMLClassifierListItem
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
association.h
Uml::RoleType::A
Definition: basictypes.h:215
Uml::Visibility::Enum
Enum
Definition: basictypes.h:56
UMLAttribute::getParmKind
Uml::ParameterDirection::Enum getParmKind() const
Definition: attribute.cpp:122
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:431
UMLClassifier::getFilteredList
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Returns the entries in m_List that are of the requested type.
Definition: classifier.cpp:1027
Uml::AssociationType::UniAssociation
Definition: basictypes.h:114
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Opens a file named "name" for writing in the outputDirectory.
Definition: codegenerator.cpp:601
UMLObject::ot_Enum
Definition: umlobject.h:56
SimpleCodeGenerator::findFileName
QString findFileName(UMLPackage *concept, const QString &ext)
Determine the file name.
Definition: simplecodegenerator.cpp:89
a
QString a
Definition: petalnode.cpp:18
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:247
Uml::RoleType::B
Definition: basictypes.h:216
QFile::fileName
QString fileName() const
IDLWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Returns "IDL".
Definition: idlwriter.cpp:61
SimpleCodeGenerator
A simple code generator interface designed to work with the existing codewriters. ...
Definition: simplecodegenerator.h:27
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
UMLAttributeList
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Gets the heading file (as a string) to be inserted at the beginning of the generated file...
Definition: codegenerator.cpp:497
classifier.h
QFile
debug_utils.h
QTextStream
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
UMLAssociation
This class contains the non-graphic representation of an association.
Definition: association.h:32
QString::clear
void clear()
SimpleCodeGenerator::m_indentLevel
int m_indentLevel
Definition: simplecodegenerator.h:74
CodeGenerator::forceDoc
bool forceDoc() const
Definition: codegenerator.cpp:859
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:75
UMLCanvasObject::getAssociations
UMLAssociationList getAssociations()
Return the list of associations for the CanvasObject.
Definition: umlcanvasobject.cpp:337
QRegExp
QObject::name
const char * name() const
QList::count
int count(const T &value) const
QList::append
void append(const T &value)
UMLClassifier::isInterface
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:117
attribute.h
enum.h
Uml::AssociationType::toString
QString toString(Enum item)
Convert AssociationType item into QString representation.
Definition: basictypes.cpp:269
QList::isEmpty
bool isEmpty() const
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
QString::isEmpty
bool isEmpty() const
UMLAssociation::getAssocType
Uml::AssociationType::Enum getAssocType() const
Returns the AssociationType::Enum of the UMLAssociation.
Definition: association.cpp:103
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Shorthand for getSpecificAssocs(Uml::at_Composition)
Definition: umlcanvasobject.cpp:433
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:101
Uml::AssociationType::Association
Definition: basictypes.h:105
QList::first
T & first()
QString
QList
uDebug
#define uDebug()
Definition: debug_utils.h:105
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Convert Visibility item into QString representation.
Definition: basictypes.cpp:99
Uml::ParameterDirection::Out
Definition: basictypes.h:235
QStringList
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Finds all classes in the current document to which objects of class c are in some way related...
Definition: codegenerator.cpp:700
Uml::AssociationType::Composition
Definition: basictypes.h:112
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Returns the stereotype.
Definition: umlobject.cpp:579
Uml::Visibility::Public
Definition: basictypes.h:57
QFile::close
virtual void close()
UMLObject::baseType
ObjectType baseType() const
Returns the type of the object.
Definition: umlobject.cpp:362
QString::replace
QString & replace(int position, int n, QChar after)
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:449
operation.h
umldoc.h
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
IDLWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Get list of reserved keywords.
Definition: idlwriter.cpp:457
QLatin1String
package.h
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Return a list of the superclasses of this concept.
Definition: umlcanvasobject.cpp:360
classifierlistitem.h
uError
#define uError()
Definition: debug_utils.h:106
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:968
UMLAssociation::getRoleName
QString getRoleName(Uml::RoleType::Enum role) const
Returns the name assigned to the role A.
Definition: association.cpp:568
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:186
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:869
CodeGenerator::formatDoc
static QString formatDoc(const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80)
Format documentation for output in source files.
Definition: codegenerator.cpp:790
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Replaces spaces with underscores and capitalises as defined in m_modname.
Definition: codegenerator.cpp:627
umlclassifierlistitemlist.h
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
UMLObject::isAbstract
bool isAbstract() const
Returns the abstract state of the object.
Definition: umlobject.cpp:313
UMLAssociation::getMultiplicity
QString getMultiplicity(Uml::RoleType::Enum role) const
Returns the multiplicity assigned to the given role.
Definition: association.cpp:559
QObject::parent
QObject * parent() const
Uml::ParameterDirection::InOut
Definition: basictypes.h:234
Uml::ParameterDirection::Enum
Enum
Definition: basictypes.h:232
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Returns the fully qualified name, i.e.
Definition: umlobject.cpp:202
IDLWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Call this method to generate IDL code for a UMLClassifier.
Definition: idlwriter.cpp:112
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
IDLWriter::defaultDatatypes
QStringList defaultDatatypes()
Return the default datatypes for your language (bool, int etc).
Definition: idlwriter.cpp:437
UMLObject::ot_Datatype
Definition: umlobject.h:55
idlwriter.h
SimpleCodeGenerator::indent
QString indent()
Returns the current indent string based on m_indentLevel and m_indentation.
Definition: simplecodegenerator.cpp:74
UMLObject::doc
QString doc() const
Returns the documentation for the object.
Definition: umlobject.cpp:400
UMLOperation::getParmList
UMLAttributeList getParmList() const
Returns a list of parameters.
Definition: operation.cpp:172
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:26 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
  • 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