umbrello: umbrello/codegenerators/codemethodblock.h Source File

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

codemethodblock.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov>
5 SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef CODEMETHODBLOCK_H
9#define CODEMETHODBLOCK_H
10
11#include "basictypes.h"
12#include "ownedcodeblock.h"
13#include "codeblockwithcomments.h"
14
15#include <QString>
16
17class ClassifierCodeDocument;
18class QXmlStreamWriter;
19
25 class CodeMethodBlock : public OwnedCodeBlock, public CodeBlockWithComments
26{
27 friend class CodeGenObjectWithTextBlocks;
28 Q_OBJECT
29public:
30
34 CodeMethodBlock (ClassifierCodeDocument * doc, UMLObject * parentObj,
35 const QString & body = QString(), const QString & comment = QString());
36
40 virtual ~CodeMethodBlock ();
41
42 virtual QString toString () const;
43
44 QString getStartMethodText () const;
45
46 QString getEndMethodText () const;
47
48 CodeDocument * getParentDocument();
49
55 virtual void updateContent () = 0;
56
57protected:
58 virtual void release ();
59
60 void setStartMethodText (const QString &value);
61
62 void setEndMethodText (const QString &value);
63
69 virtual void updateMethodDeclaration () = 0;
70
71 virtual void setAttributesOnNode (QXmlStreamWriter& writer);
72
73 virtual void setAttributesFromNode (QDomElement & element);
74
75 virtual void setAttributesFromObject (TextBlock * obj);
76
77private:
78 QString m_startMethod;
79 QString m_endMethod;
80
81public Q_SLOTS:
82 virtual void syncToParent();
83};
84
85#endif // CODEMETHODBLOCK_H
basictypes.h
ClassifierCodeDocument
Definition classifiercodedocument.h:29
CodeBlockWithComments::CodeBlockWithComments
CodeBlockWithComments(CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
Definition codeblockwithcomments.cpp:22
CodeDocument
Definition codedocument.h:30
CodeMethodBlock::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition codemethodblock.cpp:85
CodeMethodBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition codemethodblock.cpp:104
CodeMethodBlock::CodeMethodBlock
CodeMethodBlock(ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
Definition codemethodblock.cpp:17
CodeMethodBlock::updateMethodDeclaration
virtual void updateMethodDeclaration()=0
CodeMethodBlock::toString
virtual QString toString() const
Definition codemethodblock.cpp:137
CodeMethodBlock::getEndMethodText
QString getEndMethodText() const
Definition codemethodblock.cpp:48
CodeMethodBlock::syncToParent
virtual void syncToParent()
Definition codemethodblock.cpp:167
CodeMethodBlock::CodeGenObjectWithTextBlocks
friend class CodeGenObjectWithTextBlocks
Definition codemethodblock.h:27
CodeMethodBlock::setEndMethodText
void setEndMethodText(const QString &value)
Definition codemethodblock.cpp:64
CodeMethodBlock::getParentDocument
CodeDocument * getParentDocument()
Definition codemethodblock.cpp:31
CodeMethodBlock::release
virtual void release()
Definition codemethodblock.cpp:74
CodeMethodBlock::updateContent
virtual void updateContent()=0
CodeMethodBlock::m_endMethod
QString m_endMethod
Definition codemethodblock.h:79
CodeMethodBlock::setStartMethodText
void setStartMethodText(const QString &value)
Definition codemethodblock.cpp:56
CodeMethodBlock::getStartMethodText
QString getStartMethodText() const
Definition codemethodblock.cpp:40
CodeMethodBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition codemethodblock.cpp:122
CodeMethodBlock::m_startMethod
QString m_startMethod
Definition codemethodblock.h:78
CodeMethodBlock::~CodeMethodBlock
virtual ~CodeMethodBlock()
Definition codemethodblock.cpp:24
OwnedCodeBlock::OwnedCodeBlock
OwnedCodeBlock(UMLObject *parent)
Definition ownedcodeblock.cpp:27
TextBlock::ClassifierCodeDocument
friend class ClassifierCodeDocument
Definition textblock.h:25
TextBlock::TextBlock
TextBlock(CodeDocument *parent, const QString &text=QString())
Definition textblock.cpp:24
UMLObject
The base class for UML objects.
Definition umlobject.h:70
codeblockwithcomments.h
ownedcodeblock.h