umbrello: umbrello/codegenerators/codemethodblock.h Source File

umbrello 2.32.1 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 * 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 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
8 * copyright (C) 2004-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef CODEMETHODBLOCK_H
13 #define CODEMETHODBLOCK_H
14
15 #include "basictypes.h"
16 #include "ownedcodeblock.h"
17 #include "codeblockwithcomments.h"
18
19 #include <QString>
20
21 class ClassifierCodeDocument;
22 class QXmlStreamWriter;
23
29 class CodeMethodBlock : public OwnedCodeBlock, public CodeBlockWithComments
30 {
31 friend class CodeGenObjectWithTextBlocks;
32 Q_OBJECT
33 public:
34
38 CodeMethodBlock (ClassifierCodeDocument * doc, UMLObject * parentObj,
39 const QString & body = QString(), const QString & comment = QString());
40
44 virtual ~CodeMethodBlock ();
45
46 virtual QString toString () const;
47
48 QString getStartMethodText () const;
49
50 QString getEndMethodText () const;
51
52 CodeDocument * getParentDocument();
53
59 virtual void updateContent () = 0;
60
61 protected:
62
63 virtual void release ();
64
65 void setStartMethodText (const QString &value);
66
67 void setEndMethodText (const QString &value);
68
74 virtual void updateMethodDeclaration () = 0;
75
76 virtual void setAttributesOnNode (QXmlStreamWriter& writer);
77
78 virtual void setAttributesFromNode (QDomElement & element);
79
80 virtual void setAttributesFromObject (TextBlock * obj);
81
82 private:
83
84 QString m_startMethod;
85 QString m_endMethod;
86
87 public slots:
88
89 virtual void syncToParent();
90 };
91
92 #endif // CODEMETHODBLOCK_H
basictypes.h
ClassifierCodeDocument
Definition: classifiercodedocument.h:33
CodeBlockWithComments
Definition: codeblockwithcomments.h:24
CodeDocument
Definition: codedocument.h:34
CodeGenObjectWithTextBlocks
Definition: codegenobjectwithtextblocks.h:33
CodeMethodBlock
Definition: codemethodblock.h:30
CodeMethodBlock::setAttributesOnNode
virtual void setAttributesOnNode(QXmlStreamWriter &writer)
Definition: codemethodblock.cpp:89
CodeMethodBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codemethodblock.cpp:108
CodeMethodBlock::CodeMethodBlock
CodeMethodBlock(ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
Definition: codemethodblock.cpp:21
CodeMethodBlock::updateMethodDeclaration
virtual void updateMethodDeclaration()=0
CodeMethodBlock::toString
virtual QString toString() const
Definition: codemethodblock.cpp:141
CodeMethodBlock::getEndMethodText
QString getEndMethodText() const
Definition: codemethodblock.cpp:52
CodeMethodBlock::syncToParent
virtual void syncToParent()
Definition: codemethodblock.cpp:171
CodeMethodBlock::setEndMethodText
void setEndMethodText(const QString &value)
Definition: codemethodblock.cpp:68
CodeMethodBlock::getParentDocument
CodeDocument * getParentDocument()
Definition: codemethodblock.cpp:35
CodeMethodBlock::release
virtual void release()
Definition: codemethodblock.cpp:78
CodeMethodBlock::updateContent
virtual void updateContent()=0
CodeMethodBlock::m_endMethod
QString m_endMethod
Definition: codemethodblock.h:85
CodeMethodBlock::setStartMethodText
void setStartMethodText(const QString &value)
Definition: codemethodblock.cpp:60
CodeMethodBlock::getStartMethodText
QString getStartMethodText() const
Definition: codemethodblock.cpp:44
CodeMethodBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codemethodblock.cpp:126
CodeMethodBlock::m_startMethod
QString m_startMethod
Definition: codemethodblock.h:84
CodeMethodBlock::~CodeMethodBlock
virtual ~CodeMethodBlock()
Definition: codemethodblock.cpp:28
OwnedCodeBlock
Definition: ownedcodeblock.h:28
TextBlock
Definition: textblock.h:27
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
codeblockwithcomments.h
ownedcodeblock.h