umbrello: umbrello/uml1model/operation.h Source File

umbrello 2.32.2 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 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef OPERATION_H
7#define OPERATION_H
8
9#include "umlattributelist.h"
10#include "classifierlistitem.h"
11
12class UMLClassifier;
13
19 class UMLOperation : public UMLClassifierListItem
20{
21 Q_OBJECT
22public:
23 UMLOperation(UMLClassifier * parent, const QString& name,
24 Uml::ID::Type id = Uml::ID::None,
25 Uml::Visibility::Enum s = Uml::Visibility::Public,
26 UMLObject *rt = 0);
27 explicit UMLOperation(UMLClassifier * parent);
28 virtual ~UMLOperation();
29
30 bool operator==(const UMLOperation & rhs) const;
31
32 virtual void copyInto(UMLObject *lhs) const;
33
34 virtual UMLObject* clone() const;
35
36 void setType(UMLObject* type);
37
38 void moveParmLeft(UMLAttribute *a);
39 void moveParmRight(UMLAttribute *a);
40
41 void removeParm(UMLAttribute *a, bool emitModifiedSignal = true);
42
43 UMLAttributeList getParmList() const;
44
45 UMLAttribute * findParm(const QString &name);
46
47 QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig, bool withStereotype=false);
48
49 void addParm(UMLAttribute *parameter, int position = -1);
50
51 bool resolveRef();
52
53 QString getUniqueParameterName();
54
55 virtual bool showPropertiesDialog(QWidget* parent = 0);
56
57 bool isConstructorOperation();
58 bool isDestructorOperation();
59 bool isLifeOperation();
60
61 void setConst(bool b);
62 bool getConst() const;
63 void setOverride(bool b);
64 bool getOverride() const;
65 void setVirtual(bool b);
66 bool isVirtual() const;
67 void setInline(bool b);
68 bool isInline() const;
69
70 void setSourceCode(const QString& code);
71 QString getSourceCode() const;
72
73 void saveToXMI1(QXmlStreamWriter& writer);
74
75protected:
76 bool load1(QDomElement & element);
77
78private:
79 Uml::ID::Type m_returnId;
80 UMLAttributeList m_List;
81 bool m_bConst;
82 bool m_Override;
83 bool m_virtual;
84 bool m_inline;
85 QString m_Code;
86};
87
88#endif
UMLAttributeList
Definition: umlattributelist.h:21
UMLAttribute
Sets up attribute information.
Definition: attribute.h:23
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:25
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLObject::name
QString name() const
Definition: umlobject.cpp:206
UMLOperation
Definition: operation.h:20
UMLOperation::m_bConst
bool m_bConst
Holds the isQuery attribute of the <UML:Operation>
Definition: operation.h:81
UMLOperation::isConstructorOperation
bool isConstructorOperation()
Definition: operation.cpp:364
UMLOperation::setType
void setType(UMLObject *type)
Definition: operation.cpp:89
UMLOperation::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: operation.cpp:510
UMLOperation::resolveRef
bool resolveRef()
Definition: operation.cpp:348
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:173
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:40
UMLOperation::addParm
void addParm(UMLAttribute *parameter, int position=-1)
Definition: operation.cpp:271
UMLOperation::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: operation.cpp:321
UMLOperation::setConst
void setConst(bool b)
Definition: operation.cpp:417
UMLOperation::setVirtual
void setVirtual(bool b)
Definition: operation.cpp:449
UMLOperation::load1
bool load1(QDomElement &element)
Definition: operation.cpp:563
UMLOperation::moveParmLeft
void moveParmLeft(UMLAttribute *a)
Definition: operation.cpp:101
UMLOperation::setInline
void setInline(bool b)
Definition: operation.cpp:465
UMLOperation::setSourceCode
void setSourceCode(const QString &code)
Definition: operation.cpp:494
UMLOperation::m_List
UMLAttributeList m_List
Parameter list.
Definition: operation.h:80
UMLOperation::isLifeOperation
bool isLifeOperation()
Definition: operation.cpp:409
UMLOperation::setOverride
void setOverride(bool b)
Definition: operation.cpp:433
UMLOperation::isInline
bool isInline() const
Definition: operation.cpp:473
UMLOperation::isDestructorOperation
bool isDestructorOperation()
Definition: operation.cpp:386
UMLOperation::getSourceCode
QString getSourceCode() const
Definition: operation.cpp:502
UMLOperation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: operation.cpp:483
UMLOperation::removeParm
void removeParm(UMLAttribute *a, bool emitModifiedSignal=true)
Definition: operation.cpp:153
UMLOperation::getOverride
bool getOverride() const
Definition: operation.cpp:441
UMLOperation::m_inline
bool m_inline
Holds the inline attribute of the <UML:Operation>
Definition: operation.h:84
UMLOperation::m_Override
bool m_Override
Holds the override attribute of the <UML:Operation>
Definition: operation.h:82
UMLOperation::clone
virtual UMLObject * clone() const
Definition: operation.cpp:333
UMLOperation::isVirtual
bool isVirtual() const
Definition: operation.cpp:457
UMLOperation::getConst
bool getConst() const
Definition: operation.cpp:425
UMLOperation::m_Code
QString m_Code
Holds the entered source code.
Definition: operation.h:85
UMLOperation::m_virtual
bool m_virtual
Holds the virtual attribute of the <UML:Operation>
Definition: operation.h:83
UMLOperation::moveParmRight
void moveParmRight(UMLAttribute *a)
Definition: operation.cpp:125
UMLOperation::getUniqueParameterName
QString getUniqueParameterName()
Definition: operation.cpp:284
UMLOperation::~UMLOperation
virtual ~UMLOperation()
Definition: operation.cpp:80
UMLOperation::operator==
bool operator==(const UMLOperation &rhs) const
Definition: operation.cpp:297
UMLOperation::findParm
UMLAttribute * findParm(const QString &name)
Definition: operation.cpp:184
UMLOperation::toString
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig, bool withStereotype=false)
Definition: operation.cpp:200
UMLOperation::m_returnId
Uml::ID::Type m_returnId
Holds the xmi.id of the <UML:Parameter kind="return">
Definition: operation.h:79
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:373
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
Uml::SignatureType::Enum
Enum
Definition: basictypes.h:160
Uml::SignatureType::NoSig
@ NoSig
Definition: basictypes.h:161
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
Uml::Visibility::Public
@ Public
Definition: basictypes.h:46
a
QString a
Definition: petalnode.cpp:13
umlattributelist.h