umbrello: umbrello/uml1model/operation.h Source File

umbrello 2.32.1 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(QXmlStreamWriter& writer);
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
UMLAttributeList
Definition: umlattributelist.h:27
UMLAttribute
Sets up attribute information.
Definition: attribute.h:28
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:30
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
UMLOperation
Definition: operation.h:25
UMLOperation::m_bConst
bool m_bConst
Holds the isQuery attribute of the <UML:Operation>
Definition: operation.h:86
UMLOperation::isConstructorOperation
bool isConstructorOperation()
Definition: operation.cpp:369
UMLOperation::setType
void setType(UMLObject *type)
Definition: operation.cpp:94
UMLOperation::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: operation.cpp:515
UMLOperation::resolveRef
bool resolveRef()
Definition: operation.cpp:353
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
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
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Definition: operation.cpp:276
UMLOperation::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: operation.cpp:326
UMLOperation::setConst
void setConst(bool b)
Definition: operation.cpp:422
UMLOperation::setVirtual
void setVirtual(bool b)
Definition: operation.cpp:454
UMLOperation::load1
bool load1(QDomElement &element)
Definition: operation.cpp:568
UMLOperation::moveParmLeft
void moveParmLeft(UMLAttribute *a)
Definition: operation.cpp:106
UMLOperation::setInline
void setInline(bool b)
Definition: operation.cpp:470
UMLOperation::setSourceCode
void setSourceCode(const QString &code)
Definition: operation.cpp:499
UMLOperation::m_List
UMLAttributeList m_List
Parameter list.
Definition: operation.h:85
UMLOperation::isLifeOperation
bool isLifeOperation()
Definition: operation.cpp:414
UMLOperation::setOverride
void setOverride(bool b)
Definition: operation.cpp:438
UMLOperation::isInline
bool isInline() const
Definition: operation.cpp:478
UMLOperation::isDestructorOperation
bool isDestructorOperation()
Definition: operation.cpp:391
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:507
UMLOperation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: operation.cpp:488
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Definition: operation.cpp:158
UMLOperation::getOverride
bool getOverride() const
Definition: operation.cpp:446
UMLOperation::m_inline
bool m_inline
Holds the inline attribute of the <UML:Operation>
Definition: operation.h:89
UMLOperation::m_Override
bool m_Override
Holds the override attribute of the <UML:Operation>
Definition: operation.h:87
UMLOperation::clone
virtual UMLObject * clone() const
Definition: operation.cpp:338
UMLOperation::isVirtual
bool isVirtual() const
Definition: operation.cpp:462
UMLOperation::getConst
bool getConst() const
Definition: operation.cpp:430
UMLOperation::m_Code
QString m_Code
Holds the entered source code.
Definition: operation.h:90
UMLOperation::m_virtual
bool m_virtual
Holds the virtual attribute of the <UML:Operation>
Definition: operation.h:88
UMLOperation::moveParmRight
void moveParmRight(UMLAttribute *a)
Definition: operation.cpp:130
UMLOperation::getUniqueParameterName
QString getUniqueParameterName()
Definition: operation.cpp:289
UMLOperation::~UMLOperation
virtual ~UMLOperation()
Definition: operation.cpp:85
UMLOperation::operator==
bool operator==(const UMLOperation &rhs) const
Definition: operation.cpp:302
UMLOperation::findParm
UMLAttribute * findParm(const QString &name)
Definition: operation.cpp:189
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: operation.cpp:205
UMLOperation::m_returnId
Uml::ID::Type m_returnId
Holds the xmi.id of the <UML:Parameter kind="return">
Definition: operation.h:84
classifierlistitem.h
b
bool b
Definition: cxx11-null-pointer-constant.h:6
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
Uml::ID::Type
std::string Type
Definition: basictypes.h:385
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:174
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:175
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
Uml::Visibility::Public
@ Public
Definition: basictypes.h:60
a
QString a
Definition: petalnode.cpp:18
umlattributelist.h