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

operation.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) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef OPERATION_H
12 #define OPERATION_H
13
14 #include "umlattributelist.h"
15 #include "classifierlistitem.h"
16
17 class UMLClassifier;
18
24 class UMLOperation : public UMLClassifierListItem
25 {
26 Q_OBJECT
27 public:
28 UMLOperation(UMLClassifier * parent, const QString& name,
29 Uml::ID::Type id = Uml::ID::None,
30 Uml::Visibility::Enum s = Uml::Visibility::Public,
31 UMLObject *rt = 0);
32 explicit UMLOperation(UMLClassifier * parent);
33 virtual ~UMLOperation();
34
35 bool operator==(const UMLOperation & rhs) const;
36
37 virtual void copyInto(UMLObject *lhs) const;
38
39 virtual UMLObject* clone() const;
40
41 void setType(UMLObject* type);
42
43 void moveParmLeft(UMLAttribute *a);
44 void moveParmRight(UMLAttribute *a);
45
46 void removeParm(UMLAttribute *a, bool emitModifiedSignal = true);
47
48 UMLAttributeList getParmList() const;
49
50 UMLAttribute * findParm(const QString &name);
51
52 QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig, bool withStereotype=false);
53
54 void addParm(UMLAttribute *parameter, int position = -1);
55
56 bool resolveRef();
57
58 QString getUniqueParameterName();
59
60 virtual bool showPropertiesDialog(QWidget* parent = 0);
61
62 bool isConstructorOperation();
63 bool isDestructorOperation();
64 bool isLifeOperation();
65
66 void setConst(bool b);
67 bool getConst() const;
68 void setOverride(bool b);
69 bool getOverride() const;
70 void setVirtual(bool b);
71 bool isVirtual() const;
72 void setInline(bool b);
73 bool isInline() const;
74
75 void setSourceCode(const QString& code);
76 QString getSourceCode() const;
77
78 void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
79
80 protected:
81 bool load1(QDomElement & element);
82
83 private:
84 Uml::ID::Type m_returnId;
85 UMLAttributeList m_List;
86 bool m_bConst;
87 bool m_Override;
88 bool m_virtual;
89 bool m_inline;
90 QString m_Code;
91 };
92
93 #endif
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
UMLOperation::operator==
bool operator==(const UMLOperation &rhs) const
Definition: operation.cpp:302
umlattributelist.h
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1309
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Definition: operation.cpp:276
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:271
Uml::SignatureType::NoSigNoVis
@ NoSigNoVis
Definition: basictypes.h:166
UMLOperation::setInline
void setInline(bool b)
Definition: operation.cpp:470
UMLObject::asUMLOperation
UMLOperation * asUMLOperation()
Definition: umlobject.cpp:1324
UMLAttributeList
Definition: umlattributelist.h:27
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
Uml::ProgrammingLanguage::Pascal
@ Pascal
Definition: basictypes.h:281
Uml::ParameterDirection::In
@ In
Definition: basictypes.h:257
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
UMLOperation::m_List
UMLAttributeList m_List
Parameter list.
Definition: operation.h:85
UMLOperation::~UMLOperation
virtual ~UMLOperation()
Definition: operation.cpp:85
UMLOperation::moveParmLeft
void moveParmLeft(UMLAttribute *a)
Definition: operation.cpp:106
UMLAttribute::setParmKind
void setParmKind(Uml::ParameterDirection::Enum pk)
Definition: attribute.cpp:117
UMLOperation::m_Code
QString m_Code
Holds the entered source code.
Definition: operation.h:90
UMLOperation::m_returnId
Uml::ID::Type m_returnId
Holds the xmi.id of the <UML:Parameter kind="return">
Definition: operation.h:84
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Definition: operation.cpp:158
UMLObject::resolveRef
virtual bool resolveRef()
Definition: umlobject.cpp:739
UMLOperation::isConstructorOperation
bool isConstructorOperation()
Definition: operation.cpp:369
operation.h
UMLClassifierListItem::getType
UMLClassifier * getType() const
Definition: classifierlistitem.cpp:102
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Definition: classifierlistitem.cpp:112
UMLOperation::isDestructorOperation
bool isDestructorOperation()
Definition: operation.cpp:391
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
umloperationdialog.h
UMLObject::m_SecondaryId
QString m_SecondaryId
Definition: umlobject.h:286
UMLOperation::moveParmRight
void moveParmRight(UMLAttribute *a)
Definition: operation.cpp:130
UMLOperation::getConst
bool getConst() const
Definition: operation.cpp:430
Uml::SignatureType::SigNoVis
@ SigNoVis
Definition: basictypes.h:165
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
UMLObject::emitModified
void emitModified()
Definition: umlobject.cpp:385
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:671
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: operation.cpp:205
UMLObject::m_visibility
Uml::Visibility::Enum m_visibility
objects visibility
Definition: umlobject.h:277
UMLObject::umlPackage
UMLPackage * umlPackage() const
Definition: umlobject.cpp:646
Uml::ParameterDirection::Enum
Enum
Definition: basictypes.h:256
Model_Utils::getXmiId
QString getXmiId(QDomElement element)
Definition: model_utils.cpp:747
UMLOperation::m_inline
bool m_inline
Holds the inline attribute of the <UML:Operation>
Definition: operation.h:89
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
UMLOperation::getUniqueParameterName
QString getUniqueParameterName()
Definition: operation.cpp:289
UMLOperation::m_bConst
bool m_bConst
Holds the isQuery attribute of the <UML:Operation>
Definition: operation.h:86
codeblock.h
model_utils.h
UMLOperation::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: operation.cpp:515
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::m_pSecondary
QPointer< UMLObject > m_pSecondary
Definition: umlobject.h:282
Uml::ParameterDirection::InOut
@ InOut
Definition: basictypes.h:258
UMLObject::m_BaseType
ObjectType m_BaseType
objects type
Definition: umlobject.h:276
UMLOperation::resolveRef
bool resolveRef()
Definition: operation.cpp:353
UMLAttributeList::copyInto
virtual void copyInto(UMLAttributeList *rhs) const
Definition: umlattributelist.cpp:34
Uml::Visibility::Public
@ Public
Definition: basictypes.h:60
Uml::ID::fromString
ID::Type fromString(const QString &id)
Definition: basictypes.cpp:1268
UMLAttribute::getParmKind
Uml::ParameterDirection::Enum getParmKind() const
Definition: attribute.cpp:122
UMLOperation::setConst
void setConst(bool b)
Definition: operation.cpp:422
UMLOperation::setSourceCode
void setSourceCode(const QString &code)
Definition: operation.cpp:499
UMLOperation::findParm
UMLAttribute * findParm(const QString &name)
Definition: operation.cpp:189
classifierlistitem.h
UMLOperation::isLifeOperation
bool isLifeOperation()
Definition: operation.cpp:414
uniqueid.h
UMLOperation::getOverride
bool getOverride() const
Definition: operation.cpp:446
attribute.h
a
QString a
Definition: petalnode.cpp:18
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Definition: basictypes.cpp:107
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Definition: umlobject.cpp:227
UMLObject::save1
QDomElement save1(const QString &tag, QDomDocument &qDoc)
Definition: umlobject.cpp:845
i18n
#define i18n
Definition: main.cpp:39
UMLOperation::load1
bool load1(QDomElement &element)
Definition: operation.cpp:566
UMLClassifierListItem::setType
virtual void setType(UMLObject *type)
Definition: classifierlistitem.cpp:127
UMLOperation::UMLOperation
UMLOperation(UMLClassifier *parent, const QString &name, Uml::ID::Type id=Uml::ID::None, Uml::Visibility::Enum s=Uml::Visibility::Public, UMLObject *rt=0)
Definition: operation.cpp:45
Uml::ProgrammingLanguage::Ada
@ Ada
Definition: basictypes.h:273
uDebug
#define uDebug()
Definition: debug_utils.h:122
UMLOperationDialog
Definition: umloperationdialog.h:41
Uml::ParameterDirection::Out
@ Out
Definition: basictypes.h:259
UMLObject::modified
void modified()
Definition: moc_umlobject.cpp:217
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:162
UMLOperation::clone
virtual UMLObject * clone() const
Definition: operation.cpp:338
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UniqueID::gen
Uml::ID::Type gen()
Definition: uniqueid.cpp:26
UMLDoc::tagEq
static bool tagEq(const QString &tag, const QString &pattern)
Definition: umldoc.cpp:3582
UMLOperation::setVirtual
void setVirtual(bool b)
Definition: operation.cpp:454
codedocument.h
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:25
UMLObject::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &element)
Definition: umlobject.cpp:955
uml.h
Uml::SignatureType::ShowSig
@ ShowSig
Definition: basictypes.h:164
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLOperation::isInline
bool isInline() const
Definition: operation.cpp:478
UMLOperation::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: operation.cpp:326
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:163
UMLOperation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: operation.cpp:488
UMLAttribute::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: attribute.cpp:133
codegenerator.h
b
bool b
Definition: cxx11-null-pointer-constant.h:6
UMLObject::ot_Operation
@ ot_Operation
Definition: umlobject.h:93
UMLOperation::setType
void setType(UMLObject *type)
Definition: operation.cpp:94
UMLApp::activeLanguage
Uml::ProgrammingLanguage::Enum activeLanguage() const
Definition: uml.cpp:2523
UMLOperation::isVirtual
bool isVirtual() const
Definition: operation.cpp:462
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Definition: umlobject.cpp:559
UMLOperation::setOverride
void setOverride(bool b)
Definition: operation.cpp:438
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLOperation::m_virtual
bool m_virtual
Holds the virtual attribute of the <UML:Operation>
Definition: operation.h:88
umldoc.h
UMLClassifierListItem::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: classifierlistitem.cpp:75
UMLOperation::m_Override
bool m_Override
Holds the override attribute of the <UML:Operation>
Definition: operation.h:87
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:507
UMLPackage
Non-graphical information for a Package.
Definition: package.h:33