Changeset 561 for trunk/tools/qdoc3/cppcodemarker.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/qdoc3/cppcodemarker.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 */ 45 45 46 #include <qdebug.h> 46 47 #include "atom.h" 47 48 #include "cppcodemarker.h" … … 194 195 break; 195 196 case Node::Function: 197 case Node::QmlSignal: 198 case Node::QmlMethod: 196 199 func = (const FunctionNode *) node; 197 200 if (style != SeparateList && !func->returnType().isEmpty()) … … 284 287 else { 285 288 for (int i = 0; i < documentedItems.size(); ++i) { 286 if (i < MaxEnumValues - 2 || i == documentedItems.size() -1) {289 if (i < MaxEnumValues-2 || i == documentedItems.size()-1) { 287 290 if (i != 0) 288 291 synopsis += ", "; … … 345 348 } 346 349 350 #ifdef QDOC_QML 351 /*! 352 */ 353 QString CppCodeMarker::markedUpQmlItem(const Node* node, bool summary) 354 { 355 QString name = taggedQmlNode(node); 356 if (summary) { 357 name = linkTag(node,name); 358 } else if (node->type() == Node::QmlProperty) { 359 const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node); 360 if (pn->isAttached()) 361 name.prepend(pn->element() + QLatin1Char('.')); 362 } 363 name = "<@name>" + name + "</@name>"; 364 QString synopsis = name; 365 if (node->type() == Node::QmlProperty) { 366 const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(node); 367 synopsis += " : " + typified(pn->dataType()); 368 } 369 370 QString extra; 371 if (summary) { 372 if (node->status() == Node::Preliminary) { 373 extra += " (preliminary)"; 374 } 375 else if (node->status() == Node::Deprecated) { 376 extra += " (deprecated)"; 377 } 378 else if (node->status() == Node::Obsolete) { 379 extra += " (obsolete)"; 380 } 381 } 382 383 if (!extra.isEmpty()) { 384 extra.prepend("<@extra>"); 385 extra.append("</@extra>"); 386 } 387 return synopsis + extra; 388 } 389 #endif 390 347 391 QString CppCodeMarker::markedUpName(const Node *node) 348 392 { … … 412 456 } 413 457 458 #if 0 459 FastSection privateReimpFuncs(classe, 460 "Private Reimplemented Functions", 461 "private reimplemented function", 462 "private reimplemented functions"); 463 FastSection protectedReimpFuncs(classe, 464 "Protected Reimplemented Functions", 465 "protected reimplemented function", 466 "protected reimplemented functions"); 467 FastSection publicReimpFuncs(classe, 468 "Public Reimplemented Functions", 469 "public reimplemented function", 470 "public reimplemented functions"); 471 #endif 472 414 473 QList<Section> CppCodeMarker::sections(const InnerNode *inner, 415 474 SynopsisStyle style, … … 422 481 423 482 if (style == Summary) { 424 FastSection privateFunctions(classe, "Private Functions", "private function", 483 FastSection privateFunctions(classe, 484 "Private Functions", 485 "private function", 425 486 "private functions"); 426 487 FastSection privateSlots(classe, "Private Slots", "private slot", "private slots"); 427 488 FastSection privateTypes(classe, "Private Types", "private type", "private types"); 428 FastSection protectedFunctions(classe, "Protected Functions", "protected function", 489 FastSection protectedFunctions(classe, 490 "Protected Functions", 491 "protected function", 429 492 "protected functions"); 430 FastSection protectedSlots(classe, "Protected Slots", "protected slot", "protected slots"); 431 FastSection protectedTypes(classe, "Protected Types", "protected type", "protected types"); 432 FastSection protectedVariables(classe, "Protected Variables", "protected type", "protected variables"); 433 FastSection publicFunctions(classe, "Public Functions", "public function", 434 "public functions"); 493 FastSection protectedSlots(classe, 494 "Protected Slots", 495 "protected slot", 496 "protected slots"); 497 FastSection protectedTypes(classe, 498 "Protected Types", 499 "protected type", 500 "protected types"); 501 FastSection protectedVariables(classe, 502 "Protected Variables", 503 "protected type", 504 "protected variables"); 505 FastSection publicFunctions(classe, 506 "Public Functions", 507 "public function", 508 "public functions"); 435 509 FastSection publicSignals(classe, "Signals", "signal", "signals"); 436 510 FastSection publicSlots(classe, "Public Slots", "public slot", "public slots"); 437 511 FastSection publicTypes(classe, "Public Types", "public type", "public types"); 438 FastSection publicVariables(classe, "Public Variables", "public type", "public variables"); 512 FastSection publicVariables(classe, 513 "Public Variables", 514 "public type", 515 "public variables"); 439 516 FastSection properties(classe, "Properties", "property", "properties"); 440 FastSection relatedNonMembers(classe, "Related Non-Members", "related non-member", 517 FastSection relatedNonMembers(classe, 518 "Related Non-Members", 519 "related non-member", 441 520 "related non-members"); 442 FastSection staticPrivateMembers(classe, "Static Private Members", "static private member", 521 FastSection staticPrivateMembers(classe, 522 "Static Private Members", 523 "static private member", 443 524 "static private members"); 444 FastSection staticProtectedMembers(classe, "Static Protected Members", 445 "static protected member", "static protected members"); 446 FastSection staticPublicMembers(classe, "Static Public Members", "static public member", 525 FastSection staticProtectedMembers(classe, 526 "Static Protected Members", 527 "static protected member", 528 "static protected members"); 529 FastSection staticPublicMembers(classe, 530 "Static Public Members", 531 "static public member", 447 532 "static public members"); 448 533 FastSection macros(inner, "Macros", "macro", "macros"); … … 496 581 if ((*c)->type() != Node::Variable 497 582 || !(*c)->doc().isEmpty()) 498 insert(staticPublicMembers, *c, style,status);583 insert(staticPublicMembers,*c,style,status); 499 584 } 500 585 else if ((*c)->type() == Node::Property) { … … 506 591 } 507 592 else if ((*c)->type() == Node::Function) { 508 insert(publicFunctions, *c, style, status); 593 if (!insertReimpFunc(publicFunctions,*c,status)) 594 insert(publicFunctions, *c, style, status); 509 595 } 510 596 else { … … 519 605 if ((*c)->type() != Node::Variable 520 606 || !(*c)->doc().isEmpty()) 521 insert(staticProtectedMembers, *c, style,status);607 insert(staticProtectedMembers,*c,style,status); 522 608 } 523 609 else if ((*c)->type() == Node::Variable) { 524 610 if (!(*c)->doc().isEmpty()) 525 insert(protectedVariables, *c, style,status);611 insert(protectedVariables,*c,style,status); 526 612 } 527 613 else if ((*c)->type() == Node::Function) { 528 insert(protectedFunctions, *c, style, status); 614 if (!insertReimpFunc(protectedFunctions,*c,status)) 615 insert(protectedFunctions, *c, style, status); 529 616 } 530 617 else { … … 539 626 if ((*c)->type() != Node::Variable 540 627 || !(*c)->doc().isEmpty()) 541 insert(staticPrivateMembers, *c, style,status);628 insert(staticPrivateMembers,*c,style,status); 542 629 } 543 630 else if ((*c)->type() == Node::Function) { 544 insert(privateFunctions, *c, style, status); 631 if (!insertReimpFunc(privateFunctions,*c,status)) 632 insert(privateFunctions, *c, style, status); 545 633 } 546 634 else { 547 insert(privateTypes, *c, style,status);635 insert(privateTypes,*c,style,status); 548 636 } 549 637 } … … 662 750 "namespace", 663 751 "namespaces"); 664 FastSection classes(inner, "Classes", "class", "classes"); 752 FastSection classes(inner, 753 "Classes", 754 "class", 755 "classes"); 665 756 FastSection types(inner, 666 style == Summary ? "Types" : "Type Documentation", 757 style == Summary ? 758 "Types" : "Type Documentation", 667 759 "type", 668 760 "types"); 669 761 FastSection functions(inner, 670 style == Summary ? "Functions" : "Function Documentation", 762 style == Summary ? 763 "Functions" : "Function Documentation", 671 764 "function", 672 765 "functions"); 673 766 FastSection macros(inner, 674 style == Summary ? "Macros" : "Macro Documentation", 767 style == Summary ? 768 "Macros" : "Macro Documentation", 675 769 "macro", 676 770 "macros"); … … 1007 1101 } 1008 1102 1103 #ifdef QDOC_QML 1104 /*! 1105 This function is for documenting QML properties. It returns 1106 the list of documentation sections for the children of the 1107 \a qmlClassNode. 1108 1109 Currently, it only handles QML property groups. 1110 */ 1111 QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, 1112 SynopsisStyle style) 1113 { 1114 QList<Section> sections; 1115 if (qmlClassNode) { 1116 if (style == Summary) { 1117 FastSection qmlproperties(qmlClassNode, 1118 "Properties", 1119 "property", 1120 "properties"); 1121 FastSection qmlattachedproperties(qmlClassNode, 1122 "Attached Properties", 1123 "property", 1124 "properties"); 1125 FastSection qmlsignals(qmlClassNode, 1126 "Signals", 1127 "signal", 1128 "signals"); 1129 FastSection qmlattachedsignals(qmlClassNode, 1130 "QML Attached Signals", 1131 "signal", 1132 "signals"); 1133 FastSection qmlmethods(qmlClassNode, 1134 "Methods", 1135 "method", 1136 "methods"); 1137 FastSection qmlattachedmethods(qmlClassNode, 1138 "QML Attached Methods", 1139 "method", 1140 "methods"); 1141 1142 NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); 1143 while (c != qmlClassNode->childNodes().end()) { 1144 if ((*c)->subType() == Node::QmlPropertyGroup) { 1145 const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c); 1146 NodeList::ConstIterator p = qpgn->childNodes().begin(); 1147 while (p != qpgn->childNodes().end()) { 1148 if ((*p)->type() == Node::QmlProperty) { 1149 const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p); 1150 if (pn->isAttached()) 1151 insert(qmlattachedproperties,*p,style,Okay); 1152 else 1153 insert(qmlproperties,*p,style,Okay); 1154 } 1155 ++p; 1156 } 1157 } 1158 else if ((*c)->type() == Node::QmlSignal) { 1159 const FunctionNode* sn = static_cast<const FunctionNode*>(*c); 1160 if (sn->isAttached()) 1161 insert(qmlattachedsignals,*c,style,Okay); 1162 else 1163 insert(qmlsignals,*c,style,Okay); 1164 } 1165 else if ((*c)->type() == Node::QmlMethod) { 1166 const FunctionNode* mn = static_cast<const FunctionNode*>(*c); 1167 if (mn->isAttached()) 1168 insert(qmlattachedmethods,*c,style,Okay); 1169 else 1170 insert(qmlmethods,*c,style,Okay); 1171 } 1172 ++c; 1173 } 1174 append(sections,qmlproperties); 1175 append(sections,qmlattachedproperties); 1176 append(sections,qmlsignals); 1177 append(sections,qmlattachedsignals); 1178 append(sections,qmlmethods); 1179 append(sections,qmlattachedmethods); 1180 } 1181 else if (style == Detailed) { 1182 FastSection qmlproperties(qmlClassNode, "Property Documentation"); 1183 FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation"); 1184 FastSection qmlsignals(qmlClassNode,"Signal Documentation"); 1185 FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation"); 1186 FastSection qmlmethods(qmlClassNode,"Method Documentation"); 1187 FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation"); 1188 NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); 1189 while (c != qmlClassNode->childNodes().end()) { 1190 if ((*c)->subType() == Node::QmlPropertyGroup) { 1191 const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c); 1192 if (pgn->isAttached()) 1193 insert(qmlattachedproperties,*c,style,Okay); 1194 else 1195 insert(qmlproperties,*c,style,Okay); 1196 } 1197 else if ((*c)->type() == Node::QmlSignal) { 1198 const FunctionNode* sn = static_cast<const FunctionNode*>(*c); 1199 if (sn->isAttached()) 1200 insert(qmlattachedsignals,*c,style,Okay); 1201 else 1202 insert(qmlsignals,*c,style,Okay); 1203 } 1204 else if ((*c)->type() == Node::QmlMethod) { 1205 const FunctionNode* mn = static_cast<const FunctionNode*>(*c); 1206 if (mn->isAttached()) 1207 insert(qmlattachedmethods,*c,style,Okay); 1208 else 1209 insert(qmlmethods,*c,style,Okay); 1210 } 1211 ++c; 1212 } 1213 append(sections,qmlproperties); 1214 append(sections,qmlattachedproperties); 1215 append(sections,qmlsignals); 1216 append(sections,qmlattachedsignals); 1217 append(sections,qmlmethods); 1218 append(sections,qmlattachedmethods); 1219 } 1220 } 1221 1222 return sections; 1223 } 1224 #endif 1225 1009 1226 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.