cppheadercodeclassfielddeclarationblock.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "cppheadercodeclassfielddeclarationblock.h"
00017
00018 #include "cppcodeclassfield.h"
00019 #include "cppheadercodedocument.h"
00020
00021
00022
00023
00024 CPPHeaderCodeClassFieldDeclarationBlock::CPPHeaderCodeClassFieldDeclarationBlock ( CodeClassField * parent )
00025 : CodeClassFieldDeclarationBlock ( parent )
00026 {
00027 setOverallIndentationLevel(1);
00028 updateContent();
00029 }
00030
00031 CPPHeaderCodeClassFieldDeclarationBlock::~CPPHeaderCodeClassFieldDeclarationBlock ( ) { }
00032
00033
00034
00035
00036
00037
00038
00039
00042 void CPPHeaderCodeClassFieldDeclarationBlock::updateContent( )
00043 {
00044 UMLObject *umlparent = CodeClassFieldDeclarationBlock::getParentObject();
00045 if (umlparent == NULL) {
00046 return;
00047 }
00048
00049 CodeClassField * cf = getParentClassField();
00050 CPPCodeClassField * hcppcf = dynamic_cast<CPPCodeClassField*>(cf);
00051
00052
00053 QString notes = umlparent->getDoc();
00054 getComment()->setText(notes);
00055 if(notes.isEmpty())
00056 getComment()->setWriteOutText(false);
00057 else
00058 getComment()->setWriteOutText(true);
00059
00060
00061
00062 QString staticValue = umlparent->getStatic() ? "static " : "";
00063 QString typeName = hcppcf->getTypeName();
00064 QString fieldName = hcppcf->getFieldName();
00065
00066
00067 if (!cf->parentIsAttribute() && !cf->fieldIsSingleValue())
00068 typeName = hcppcf->getListFieldClassName();
00069
00070 QString body = staticValue + ' ' + typeName + ' ' + fieldName + ';';
00071
00072 setText(body);
00073
00074 }
00075
00076
00077
00078 #include "cppheadercodeclassfielddeclarationblock.moc"
This file is part of the documentation for umbrello Version 3.1.0.