umbrello: umbrello/codegenerators/codemethodblock.h Source File

umbrello 2.31.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
28 class CodeMethodBlock : public OwnedCodeBlock, public CodeBlockWithComments
29 {
30 friend class CodeGenObjectWithTextBlocks;
31 Q_OBJECT
32 public:
33
37 CodeMethodBlock (ClassifierCodeDocument * doc, UMLObject * parentObj,
38 const QString & body = QString(), const QString & comment = QString());
39
43 virtual ~CodeMethodBlock ();
44
45 virtual QString toString () const;
46
47 QString getStartMethodText () const;
48
49 QString getEndMethodText () const;
50
51 CodeDocument * getParentDocument();
52
58 virtual void updateContent () = 0;
59
60 protected:
61
62 virtual void release ();
63
64 void setStartMethodText (const QString &value);
65
66 void setEndMethodText (const QString &value);
67
73 virtual void updateMethodDeclaration () = 0;
74
75 virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & blockElement);
76
77 virtual void setAttributesFromNode (QDomElement & element);
78
79 virtual void setAttributesFromObject (TextBlock * obj);
80
81 private:
82
83 QString m_startMethod;
84 QString m_endMethod;
85
86 public slots:
87
88 virtual void syncToParent();
89 };
90
91 #endif // CODEMETHODBLOCK_H
ownedcodeblock.h
CodeMethodBlock::updateMethodDeclaration
virtual void updateMethodDeclaration()=0
codeclassfield.h
TextBlock::getWriteOutText
bool getWriteOutText() const
Definition: textblock.cpp:141
OwnedCodeBlock
Definition: ownedcodeblock.h:27
CodeMethodBlock::getStartMethodText
QString getStartMethodText() const
Definition: codemethodblock.cpp:42
TextBlock::toString
virtual QString toString() const
Definition: textblock.cpp:407
CodeMethodBlock::m_endMethod
QString m_endMethod
Definition: codemethodblock.h:84
codeblockwithcomments.h
CodeMethodBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Definition: codemethodblock.cpp:87
TextBlock::encodeText
static QString encodeText(const QString &text, const QString &endLine)
Definition: textblock.cpp:381
CodeMethodBlock::m_startMethod
QString m_startMethod
Definition: codemethodblock.h:83
CodeMethodBlock::syncToParent
virtual void syncToParent()
Definition: codemethodblock.cpp:169
UMLApp::commonPolicy
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2274
CodeMethodBlock::CodeMethodBlock
CodeMethodBlock(ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
Definition: codemethodblock.cpp:19
TextBlock::getIndentationString
QString getIndentationString(int level=0) const
Definition: textblock.cpp:193
CodeBlockWithComments::getComment
CodeComment * getComment() const
Definition: codeblockwithcomments.cpp:47
CodeMethodBlock::getParentDocument
CodeDocument * getParentDocument()
Definition: codemethodblock.cpp:33
CodeDocument
Definition: codedocument.h:33
CodeMethodBlock::toString
virtual QString toString() const
Definition: codemethodblock.cpp:139
TextBlock::decodeText
static QString decodeText(const QString &text, const QString &endLine)
Definition: textblock.cpp:395
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
CodeMethodBlock::getEndMethodText
QString getEndMethodText() const
Definition: codemethodblock.cpp:50
ClassifierCodeDocument
Definition: classifiercodedocument.h:33
OwnedCodeBlock::getParentObject
UMLObject * getParentObject()
Definition: ownedcodeblock.cpp:64
OwnedCodeBlock::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Definition: ownedcodeblock.cpp:81
CodeMethodBlock::release
virtual void release()
Definition: codemethodblock.cpp:76
CodeMethodBlock::updateContent
virtual void updateContent()=0
CodeGenObjectWithTextBlocks
Definition: codegenobjectwithtextblocks.h:32
CodeMethodBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codemethodblock.cpp:106
classifiercodedocument.h
basictypes.h
codegenerationpolicy.h
CodeMethodBlock::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codemethodblock.cpp:124
CodeBlockWithComments
Definition: codeblockwithcomments.h:24
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
CodeBlock::contentType
ContentType contentType() const
Definition: codeblock.cpp:54
TextBlock::release
virtual void release()
Definition: textblock.cpp:275
CodeBlock::AutoGenerated
@ AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:46
CodeBlockWithComments::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: codeblockwithcomments.cpp:106
TextBlock::formatMultiLineText
static QString formatMultiLineText(const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true)
Definition: textblock.cpp:288
CodeMethodBlock::setEndMethodText
void setEndMethodText(const QString &value)
Definition: codemethodblock.cpp:66
OwnedCodeBlock::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Definition: ownedcodeblock.cpp:106
CodeMethodBlock::~CodeMethodBlock
virtual ~CodeMethodBlock()
Definition: codemethodblock.cpp:26
uml.h
OwnedCodeBlock::release
virtual void release()
Definition: ownedcodeblock.cpp:52
CodeGenerationPolicy::getNewLineEndingChars
QString getNewLineEndingChars() const
Definition: codegenerationpolicy.cpp:253
TextBlock::getParentDocument
CodeDocument * getParentDocument() const
Definition: textblock.cpp:70
codemethodblock.h
TextBlock
Definition: textblock.h:25
CodeMethodBlock::setStartMethodText
void setStartMethodText(const QString &value)
Definition: codemethodblock.cpp:58
CodeBlockWithComments::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Definition: codeblockwithcomments.cpp:69
TextBlock::setText
void setText(const QString &text)
Definition: textblock.cpp:80
TextBlock::getIndentationLevel
int getIndentationLevel() const
Definition: textblock.cpp:163
TextBlock::getText
QString getText() const
Definition: textblock.cpp:99
CodeMethodBlock
Definition: codemethodblock.h:29
CodeBlockWithComments::setAttributesFromObject
virtual void setAttributesFromObject(TextBlock *obj)
Definition: codeblockwithcomments.cpp:84