• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
  • cpp
cppsourcecodeclassfielddeclarationblock.cpp
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-2013 *
9  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10  ***************************************************************************/
11 
12 #include "cppsourcecodeclassfielddeclarationblock.h"
13 
14 #include "cppcodeclassfield.h"
15 #include "model_utils.h"
16 
17 CPPSourceCodeClassFieldDeclarationBlock::CPPSourceCodeClassFieldDeclarationBlock (CodeClassField * parent)
18  : CodeClassFieldDeclarationBlock (parent)
19 {
20  setOverallIndentationLevel(1);
21 }
22 
23 CPPSourceCodeClassFieldDeclarationBlock::~CPPSourceCodeClassFieldDeclarationBlock ()
24 {
25 }
26 
27 void CPPSourceCodeClassFieldDeclarationBlock::updateContent()
28 {
29  CodeClassField * cf = getParentClassField();
30  CPPCodeClassField * jcf = dynamic_cast<CPPCodeClassField*>(cf);
31 
32  // Set the comment
33  QString notes = getParentObject()->doc();
34  getComment()->setText(notes);
35 
36  // Set the body
37  QString staticValue = getParentObject()->isStatic() ? "static " : "";
38  QString scopeStr = Uml::Visibility::toString(getParentObject()->visibility());
39 
40  QString typeName = jcf->getTypeName();
41  QString fieldName = jcf->getFieldName();
42  QString initialV = jcf->getInitialValue();
43 
44  QString body = staticValue+scopeStr + ' ' + typeName + ' ' + fieldName;
45  if (!initialV.isEmpty())
46  body.append(" = " + initialV);
47  setText(body + ';');
48 }
49 
50 #include "cppsourcecodeclassfielddeclarationblock.moc"
CPPCodeClassField::getFieldName
QString getFieldName()
Definition: cppcodeclassfield.cpp:39
CodeClassField
class CodeClassField a special type of parameter.
Definition: codeclassfield.h:29
CodeBlockWithComments::getComment
CodeComment * getComment() const
Get the Comment object.
Definition: codeblockwithcomments.cpp:46
cppcodeclassfield.h
TextBlock::setText
void setText(const QString &text)
Set the value of m_text The actual text of this code block.
Definition: textblock.cpp:80
CodeBlockWithComments::setOverallIndentationLevel
void setOverallIndentationLevel(int level)
A utility method that causes the comment and body of the code block to have the same indentation leve...
Definition: codeblockwithcomments.cpp:163
CodeClassFieldDeclarationBlock
Used to declare classifier fields (e.g.
Definition: codeclassfielddeclarationblock.h:29
CodeClassFieldDeclarationBlock::getParentObject
UMLObject * getParentObject()
A utility method to get the parent object of the parentCodeClassfield.
Definition: codeclassfielddeclarationblock.cpp:48
CPPSourceCodeClassFieldDeclarationBlock::updateContent
void updateContent()
This will be called by syncToParent whenever the parent object is "modified".
Definition: cppsourcecodeclassfielddeclarationblock.cpp:27
model_utils.h
CPPSourceCodeClassFieldDeclarationBlock::CPPSourceCodeClassFieldDeclarationBlock
CPPSourceCodeClassFieldDeclarationBlock(CodeClassField *parent)
Constructor.
Definition: cppsourcecodeclassfielddeclarationblock.cpp:17
CPPSourceCodeClassFieldDeclarationBlock::~CPPSourceCodeClassFieldDeclarationBlock
virtual ~CPPSourceCodeClassFieldDeclarationBlock()
Empty Destructor.
Definition: cppsourcecodeclassfielddeclarationblock.cpp:23
CPPCodeClassField::getInitialValue
QString getInitialValue()
Get the value of m_initialValue The initial value of this code parameter.
Definition: cppcodeclassfield.cpp:65
CPPCodeClassField
Definition: cppcodeclassfield.h:21
Uml::Visibility::toString
QString toString(Enum item, bool mnemonic)
Convert Visibility item into QString representation.
Definition: basictypes.cpp:99
cppsourcecodeclassfielddeclarationblock.h
UMLObject::isStatic
bool isStatic() const
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition: umlobject.cpp:335
CodeClassFieldDeclarationBlock::getParentClassField
CodeClassField * getParentClassField()
Get the value of m_parentclassfield.
Definition: codeclassfielddeclarationblock.cpp:40
CodeClassField::getTypeName
QString getTypeName()
Get the value of m_dialog.
Definition: codeclassfield.cpp:94
UMLObject::doc
QString doc() const
Returns the documentation for the object.
Definition: umlobject.cpp:404
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal