From 40479a41ce6e51f32c4120f290cbe36b3d7424b0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 22 Sep 2010 12:57:25 +0200 Subject: qdoc: Added the summary sections to the cxxClass. --- tools/qdoc3/ditaxmlgenerator.cpp | 71 ++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 3efd98b..02be9fd 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1525,12 +1525,56 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark xmlWriter().writeEndElement(); // xmlWriter().writeEndElement(); // + bool needOtherSection = false; QList
summarySections; summarySections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); - + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty() && s->reimpMembers.isEmpty()) { + if (!s->inherited.isEmpty()) + needOtherSection = true; + } + else { + if (!s->members.isEmpty()) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters(protectEnc((*s).name)); + xmlWriter().writeEndElement(); // + generateSection(s->members, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); //
+ } + if (!s->reimpMembers.isEmpty()) { + QString name = QString("Reimplemented ") + (*s).name; + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h2"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters(protectEnc(name)); + xmlWriter().writeEndElement(); // + generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); + generateSectionInheritedList(*s, inner, marker); + xmlWriter().writeEndElement(); // + } + } + ++s; + } + if (needOtherSection) { + xmlWriter().writeStartElement("section"); + xmlWriter().writeAttribute("outputclass","h3"); + xmlWriter().writeStartElement("title"); + xmlWriter().writeCharacters("Additional Inherited Members"); + xmlWriter().writeEndElement(); // + s = summarySections.begin(); + while (s != summarySections.end()) { + if (s->members.isEmpty()) + generateSectionInheritedList(*s, inner, marker); + ++s; + } + } + writeDetailedDescription(cn, marker, false, QString("Detailed Description")); - // zzz writeSections() gores here. // not included: or xmlWriter().writeEndElement(); // @@ -3022,7 +3066,7 @@ void DitaXmlGenerator::generateSection(const NodeList& nl, } /*! - Writes the "inherited from" lists to the current XML stream. + Writes the "inherited from" list to the current XML stream. */ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, const Node* relative, @@ -3031,19 +3075,26 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section, if (section.inherited.isEmpty()) return; xmlWriter().writeStartElement("ul"); - QList >::ConstIterator p = section.inherited.begin(); + QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { xmlWriter().writeStartElement("li"); xmlWriter().writeAttribute("outputclass","fn"); - QString text = (*p).second + " "; + QString text; + text.setNum((*p).second); + text += " "; if ((*p).second == 1) text += section.singularMember; else text += section.pluralMember; - text += " inherited from "; - text += protectEnc(marker->plainFullName((*p).first, relative)) + ""; + text += " inherited from "; + xmlWriter().writeCharacters(text); + xmlWriter().writeStartElement("xref"); + text = fileName((*p).first) + "#"; + text += DitaXmlGenerator::cleanRef(section.name.toLower()); + xmlWriter().writeAttribute("href",text); + text = protectEnc(marker->plainFullName((*p).first, relative)); xmlWriter().writeCharacters(text); + xmlWriter().writeEndElement(); // ++p; } xmlWriter().writeEndElement(); // @@ -5177,14 +5228,14 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node, if (apiDesc) { inApiDesc = true; xmlWriter().writeStartElement(APIDESC); - xmlWriter().writeAttribute("id",node->guid()); + // zzz xmlWriter().writeAttribute("id",node->guid()); if (!title.isEmpty()) xmlWriter().writeAttribute("spectitle",title); } else { inSection = true; xmlWriter().writeStartElement("section"); - xmlWriter().writeAttribute("id",node->guid()); + // zzz xmlWriter().writeAttribute("id",node->guid()); if (!title.isEmpty()) { xmlWriter().writeStartElement("title"); xmlWriter().writeCharacters(title); -- cgit v0.12