case Node::Property:
tag = QLatin1String("@property");
break;
- case Node::Fake:
+ case Node::Document:
/*
Remove the "QML:" prefix, if present.
There shouldn't be any of these "QML:"
bool inheritedMember = false;
InnerNode* parent = node->parent();
- if (parent && (parent->type() == Node::Fake) &&
+ if (parent && (parent->type() == Node::Document) &&
(parent->subType() == Node::QmlPropertyGroup)) {
parent = parent->parent();
}
fastSection.memberMap.insert(key, node);
}
else {
- if ((parent->type() == Node::Fake) && (parent->subType() == Node::QmlClass)) {
+ if ((parent->type() == Node::Document) && (parent->subType() == Node::QmlClass)) {
if (fastSection.inherited.isEmpty()
|| fastSection.inherited.last().first != parent) {
QPair<InnerNode*, int> p(parent, 0);
return stringList;
}
case Node::Namespace:
- case Node::Fake:
+ case Node::Document:
default:
return QStringList();
}
}
else if (command == COMMAND_INQMLMODULE) {
node->setQmlModule(arg);
- FakeNode* fn = FakeNode::lookupQmlModuleNode(tree, arg);
+ DocNode* fn = DocNode::lookupQmlModuleNode(tree, arg);
fn->addQmlModuleMember(node);
QString qmid = node->qmlModuleIdentifier();
QmlClassNode* qcn = static_cast<QmlClassNode*>(node);
node->addPageKeywords(arg.first);
}
else if (command == COMMAND_SUBTITLE) {
- if (node->type() == Node::Fake) {
- FakeNode *fake = static_cast<FakeNode *>(node);
- fake->setSubTitle(arg.first);
+ if (node->type() == Node::Document) {
+ DocNode *dn = static_cast<DocNode *>(node);
+ dn->setSubTitle(arg.first);
}
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
node->setThreadSafeness(Node::ThreadSafe);
}
else if (command == COMMAND_TITLE) {
- if (node->type() == Node::Fake) {
- FakeNode *fake = static_cast<FakeNode *>(node);
- fake->setTitle(arg.first);
- if (fake->subType() == Node::Example) {
- ExampleNode::exampleNodeMap.insert(fake->title(),static_cast<ExampleNode*>(fake));
+ if (node->type() == Node::Document) {
+ DocNode *dn = static_cast<DocNode *>(node);
+ dn->setTitle(arg.first);
+ if (dn->subType() == Node::Example) {
+ ExampleNode::exampleNodeMap.insert(dn->title(),static_cast<ExampleNode*>(dn));
}
- nameToTitle.insert(fake->name(),arg.first);
+ nameToTitle.insert(dn->name(),arg.first);
}
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
}
++c;
}
- const FakeNode* fn = current->qmlBase();
- if (fn) {
- if (fn->subType() == Node::QmlClass)
- current = static_cast<const QmlClassNode*>(fn);
+ const DocNode* dn = current->qmlBase();
+ if (dn) {
+ if (dn->subType() == Node::QmlClass)
+ current = static_cast<const QmlClassNode*>(dn);
else {
- fn->doc().location().warning(tr("Base class of QML class '%1' is ambgiguous")
- .arg(current->name()));
+ dn->doc().location().warning(tr("Base class of QML class '%1' is ambgiguous").arg(current->name()));
current = 0;
}
}
if (parentPath.isEmpty() && !lastPath.isEmpty())
func = tree_->findFunctionNode(lastPath, clone);
if (func == 0) {
- doc.location().warning(tr("Cannot find '%1' in '\\%2'")
+ doc.location().warning(tr("Cannot find '%1' in '\\%2' %3")
.arg(clone->name() + "(...)")
- .arg(COMMAND_FN),
+ .arg(COMMAND_FN)
+ .arg(arg.first),
tr("I cannot find any function of that name with the "
"specified signature. Make sure that the signature "
"is identical to the declaration, including 'const' "
*/
Node::Type type = nodeTypeMap[command];
Node::SubType subtype = Node::NoSubType;
- if (type == Node::Fake)
+ if (type == Node::Document)
subtype = Node::QmlClass;
QStringList paths = arg.first.split(QLatin1Char(' '));
}
}
else if (command == COMMAND_EXTERNALPAGE) {
- FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DocNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_FILE) {
- FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DocNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_GROUP) {
- FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DocNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_HEADERFILE) {
- FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DocNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_MODULE) {
- FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DocNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_QMLMODULE) {
- FakeNode* fn = FakeNode::lookupQmlModuleNode(tree_, arg);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = DocNode::lookupQmlModuleNode(tree_, arg);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if (command == COMMAND_PAGE) {
Node::PageType ptype = Node::ArticlePage;
node and return that one.
*/
NameCollisionNode* ncn = tree_->checkForCollision(args[0]);
- FakeNode* fn = 0;
+ DocNode* dn = 0;
if (ptype == Node::DitaMapPage)
- fn = new DitaMapNode(tree_->root(), args[0]);
+ dn = new DitaMapNode(tree_->root(), args[0]);
else
- fn = new FakeNode(tree_->root(), args[0], Node::Page, ptype);
- fn->setLocation(doc.startLocation());
+ dn = new DocNode(tree_->root(), args[0], Node::Page, ptype);
+ dn->setLocation(doc.startLocation());
if (ncn) {
- ncn->addCollision(fn);
+ ncn->addCollision(dn);
}
- return fn;
+ return dn;
}
else if (command == COMMAND_DITAMAP) {
- FakeNode* fn = new DitaMapNode(tree_->root(), arg.first);
- fn->setLocation(doc.startLocation());
- return fn;
+ DocNode* dn = new DitaMapNode(tree_->root(), arg.first);
+ dn->setLocation(doc.startLocation());
+ return dn;
}
else if ((command == COMMAND_QMLCLASS) || (command == COMMAND_QMLTYPE)) {
if (command == COMMAND_QMLCLASS)
/*
It should be a header file, I think.
*/
- n = tree_->findNodeByNameAndType(QStringList(arg), Node::Fake, Node::NoSubType, 0);
+ n = tree_->findNodeByNameAndType(QStringList(arg), Node::Document, Node::NoSubType, 0);
}
else {
/*
}
}
else if (command == COMMAND_QMLINSTANTIATES) {
- if ((node->type() == Node::Fake) && (node->subType() == Node::QmlClass)) {
+ if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) {
ClassNode* classNode = tree_->findClassNode(arg.split("::"));
if (classNode)
node->setClassNode(classNode);
QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
qpn->setDefault();
}
- else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) {
+ else if (node->type() == Node::Document && node->subType() == Node::QmlPropertyGroup) {
QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node);
NodeList::ConstIterator p = qpgn->childNodes().constBegin();
while (p != qpgn->childNodes().constEnd()) {
QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
qpn->setReadOnly(1);
}
- else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) {
+ else if (node->type() == Node::Document && node->subType() == Node::QmlPropertyGroup) {
QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node);
NodeList::ConstIterator p = qpgn->childNodes().constBegin();
while (p != qpgn->childNodes().constEnd()) {
}
}
else if (command == COMMAND_QMLABSTRACT) {
- if ((node->type() == Node::Fake) && (node->subType() == Node::QmlClass)) {
+ if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) {
node->setAbstract(true);
}
}
readToken(); // skip '{'
bool matched = matchDeclList(ns);
-
return matched && match(Tok_RightBrace);
}
foreach (const QString& usedNamespace_, activeNamespaces_) {
QStringList newPath = usedNamespace_.split("::") + parentPath;
func = tree_->findFunctionNode(newPath, clone);
- if (func)
+ if (func) {
break;
+ }
}
if (func == 0)
func = tree_->findFunctionNode(parentPath, clone);
matchDeclList(tree_->root());
}
-void CppCodeParser::createExampleFileNodes(FakeNode *fake)
+void CppCodeParser::createExampleFileNodes(DocNode *dn)
{
- QString examplePath = fake->name();
+ QString examplePath = dn->name();
QString proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".pro";
QString userFriendlyFilePath;
- QString fullPath = Config::findFile(fake->doc().location(),
+ QString fullPath = Config::findFile(dn->doc().location(),
exampleFiles,
exampleDirs,
proFileName,
QString tmp = proFileName;
proFileName = examplePath + QLatin1Char('/') + "qbuild.pro";
userFriendlyFilePath.clear();
- fullPath = Config::findFile(fake->doc().location(),
+ fullPath = Config::findFile(dn->doc().location(),
exampleFiles,
exampleDirs,
proFileName,
if (fullPath.isEmpty()) {
proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".qmlproject";
userFriendlyFilePath.clear();
- fullPath = Config::findFile(fake->doc().location(),
+ fullPath = Config::findFile(dn->doc().location(),
exampleFiles,
exampleDirs,
proFileName,
userFriendlyFilePath);
if (fullPath.isEmpty()) {
- fake->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
- fake->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
+ dn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
+ dn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
return;
}
}
}
foreach (const QString &exampleFile, exampleFiles) {
- new FakeNode(fake,
- exampleFile.mid(sizeOfBoringPartOfName),
- Node::File,
- Node::NoPageType);
+ new DocNode(dn,
+ exampleFile.mid(sizeOfBoringPartOfName),
+ Node::File,
+ Node::NoPageType);
}
foreach (const QString &imageFile, imageFiles) {
- new FakeNode(fake,
- imageFile.mid(sizeOfBoringPartOfName),
- Node::Image,
- Node::NoPageType);
+ new DocNode(dn,
+ imageFile.mid(sizeOfBoringPartOfName),
+ Node::Image,
+ Node::NoPageType);
}
}
const QString &includeFile,
const QString ¯oDef,
Tree *tree);
- void createExampleFileNodes(FakeNode *fake);
+ void createExampleFileNodes(DocNode *dn);
protected:
QMap<QString, Node::Type> nodeTypeMap;
}
break;
case Atom::BriefRight:
- // if (relative->type() != Node::Fake)
+ // if (relative->type() != Node::Document)
writeEndTag(); // </shortdesc> or </p>
if (in_para)
in_para = false;
generateAnnotatedList(relative, marker, namespaceIndex);
}
else if (atom->string() == "related") {
- const FakeNode *fake = static_cast<const FakeNode *>(relative);
- if (fake && !fake->groupMembers().isEmpty()) {
+ const DocNode *dn = static_cast<const DocNode *>(relative);
+ if (dn && !dn->groupMembers().isEmpty()) {
NodeMap groupMembersMap;
- foreach (const Node *node, fake->groupMembers()) {
- if (node->type() == Node::Fake)
+ foreach (const Node *node, dn->groupMembers()) {
+ if (node->type() == Node::Document)
groupMembersMap[fullName(node, relative, marker)] = node;
}
- generateAnnotatedList(fake, marker, groupMembersMap);
+ generateAnnotatedList(dn, marker, groupMembersMap);
}
}
break;
while (n != nsmap.value().constEnd()) {
const Node* node = n.value();
switch (node->type()) {
- case Node::Fake:
+ case Node::Document:
if (node->subType() == Node::QmlClass) {
sections[QmlClass].appendMember((Node*)node);
}
images.append(QLatin1Char('/'));
fileName = images + atom->string();
}
- if (relative && (relative->type() == Node::Fake) &&
+ if (relative && (relative->type() == Node::Document) &&
(relative->subType() == Node::Example)) {
const ExampleNode* cen = static_cast<const ExampleNode*>(relative);
if (cen->imageFileName().isEmpty()) {
generateLowStatusMembers(inner,marker,CodeMarker::Compat);
writeEndTag(); // </cxxClass>
}
- else if ((inner->type() == Node::Fake) && (inner->subType() == Node::HeaderFile)) {
- const FakeNode* fn = const_cast<FakeNode*>(static_cast<const FakeNode*>(inner));
+ else if ((inner->type() == Node::Document) && (inner->subType() == Node::HeaderFile)) {
+ const DocNode* dn = const_cast<DocNode*>(static_cast<const DocNode*>(inner));
rawTitle = marker->plainName(inner);
fullTitle = marker->plainFullName(inner);
title = rawTitle;
writeStartTag(DT_cxxClassDetail);
enterDesc(DT_apiDesc,QString(),title);
- generateStatus(fn, marker);
- generateThreadSafeness(fn, marker);
- generateSince(fn, marker);
- generateSince(fn, marker);
+ generateStatus(dn, marker);
+ generateThreadSafeness(dn, marker);
+ generateSince(dn, marker);
+ generateSince(dn, marker);
enterSection(QString(), QString());
- generateBody(fn, marker);
- generateAlsoList(fn, marker);
+ generateBody(dn, marker);
+ generateAlsoList(dn, marker);
leaveSection();
leaveSection(); // </apiDesc>
s = detailSections.constBegin();
while (s != detailSections.constEnd()) {
if ((*s).name == "Classes") {
- writeNestedClasses((*s),fn);
+ writeNestedClasses((*s),dn);
break;
}
++s;
s = detailSections.constBegin();
while (s != detailSections.constEnd()) {
if ((*s).name == "Function Documentation") {
- writeFunctions((*s),fn,marker);
+ writeFunctions((*s),dn,marker);
}
else if ((*s).name == "Type Documentation") {
writeEnumerations((*s),marker);
generateLowStatusMembers(inner,marker,CodeMarker::Compat);
writeEndTag(); // </cxxClass>
}
- else if ((inner->type() == Node::Fake) && (inner->subType() == Node::QmlClass)) {
+ else if ((inner->type() == Node::Document) && (inner->subType() == Node::QmlClass)) {
QmlClassNode* qcn = const_cast<QmlClassNode*>(static_cast<const QmlClassNode*>(inner));
ClassNode* cn = qcn->classNode();
rawTitle = marker->plainName(inner);
Generate the DITA page for a qdoc file that doesn't map
to an underlying c++ file.
*/
-void DitaXmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker)
+void DitaXmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
{
/*
- If the fake node is a page node, and if the page type
+ If the dn node is a page node, and if the page type
is DITA map page, write the node's contents as a dita
map and return without doing anything else.
*/
- if (fake->subType() == Node::Page && fake->pageType() == Node::DitaMapPage) {
- const DitaMapNode* dmn = static_cast<const DitaMapNode*>(fake);
+ if (dn->subType() == Node::Page && dn->pageType() == Node::DitaMapPage) {
+ const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
writeDitaMap(dmn);
return;
}
QList<Section> sections;
QList<Section>::const_iterator s;
- QString fullTitle = fake->fullTitle();
+ QString fullTitle = dn->fullTitle();
- if (fake->subType() == Node::QmlBasicType) {
+ if (dn->subType() == Node::QmlBasicType) {
fullTitle = "QML Basic Type: " + fullTitle;
}
- else if (fake->subType() == Node::Collision) {
+ else if (dn->subType() == Node::Collision) {
fullTitle = "Name Collision: " + fullTitle;
}
- generateHeader(fake, fullTitle);
- generateBrief(fake, marker); // <shortdesc>
- writeProlog(fake);
+ generateHeader(dn, fullTitle);
+ generateBrief(dn, marker); // <shortdesc>
+ writeProlog(dn);
writeStartTag(DT_body);
enterSection(QString(), QString());
- if (fake->subType() == Node::Module) {
- generateStatus(fake, marker);
- if (moduleNamespaceMap.contains(fake->name())) {
+ if (dn->subType() == Node::Module) {
+ generateStatus(dn, marker);
+ if (moduleNamespaceMap.contains(dn->name())) {
enterSection("h2","Namespaces");
- generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
+ generateAnnotatedList(dn, marker, moduleNamespaceMap[dn->name()]);
leaveSection();
}
- if (moduleClassMap.contains(fake->name())) {
+ if (moduleClassMap.contains(dn->name())) {
enterSection("h2","Classes");
- generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
+ generateAnnotatedList(dn, marker, moduleClassMap[dn->name()]);
leaveSection();
}
}
- if (fake->doc().isEmpty()) {
- if (fake->subType() == Node::File) {
+ if (dn->doc().isEmpty()) {
+ if (dn->subType() == Node::File) {
Text text;
Quoter quoter;
writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass", "small-subtitle");
- text << fake->subTitle();
- generateText(text, fake, marker);
+ text << dn->subTitle();
+ generateText(text, dn, marker);
writeEndTag(); // </p>
- Doc::quoteFromFile(fake->doc().location(), quoter, fake->name());
- QString code = quoter.quoteTo(fake->location(), "", "");
+ Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
+ QString code = quoter.quoteTo(dn->location(), "", "");
text.clear();
text << Atom(Atom::Code, code);
- generateText(text, fake, marker);
+ generateText(text, dn, marker);
}
}
else {
- if (fake->subType() == Node::Module) {
+ if (dn->subType() == Node::Module) {
enterSection(QString(), QString());
- generateBody(fake, marker);
+ generateBody(dn, marker);
leaveSection();
}
else {
- generateBody(fake, marker);
+ generateBody(dn, marker);
}
- generateAlsoList(fake, marker);
+ generateAlsoList(dn, marker);
- if ((fake->subType() == Node::QmlModule) && !fake->qmlModuleMembers().isEmpty()) {
+ if ((dn->subType() == Node::QmlModule) && !dn->qmlModuleMembers().isEmpty()) {
NodeMap qmlModuleMembersMap;
- foreach (const Node* node, fake->qmlModuleMembers()) {
- if (node->type() == Node::Fake && node->subType() == Node::QmlClass)
+ foreach (const Node* node, dn->qmlModuleMembers()) {
+ if (node->type() == Node::Document && node->subType() == Node::QmlClass)
qmlModuleMembersMap[node->name()] = node;
}
- generateAnnotatedList(fake, marker, qmlModuleMembersMap);
+ generateAnnotatedList(dn, marker, qmlModuleMembersMap);
}
- else if (!fake->groupMembers().isEmpty()) {
+ else if (!dn->groupMembers().isEmpty()) {
NodeMap groupMembersMap;
- foreach (const Node *node, fake->groupMembers()) {
+ foreach (const Node *node, dn->groupMembers()) {
if (node->type() == Node::Class || node->type() == Node::Namespace)
groupMembersMap[node->name()] = node;
}
- generateAnnotatedList(fake, marker, groupMembersMap);
+ generateAnnotatedList(dn, marker, groupMembersMap);
}
}
leaveSection(); // </section>
if (!writeEndTag()) { // </body>
- fake->doc().location().warning(tr("Pop of empty XML tag stack; generating DITA for '%1'").arg(fake->name()));
+ dn->doc().location().warning(tr("Pop of empty XML tag stack; generating DITA for '%1'").arg(dn->name()));
return;
}
- writeRelatedLinks(fake, marker);
+ writeRelatedLinks(dn, marker);
writeEndTag(); // </topic>
}
value of the \e role attribute is \c{parent} for the
\c{start} link.
*/
-void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marker)
+void DitaXmlGenerator::writeRelatedLinks(const DocNode* node, CodeMarker* marker)
{
const Node* linkNode = 0;
QPair<QString,QString> linkPair;
if (node->links().contains(Node::PreviousLink)) {
linkPair = node->links()[Node::PreviousLink];
linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (linkNode && linkNode->type() == Node::Fake) {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
- linkPair.second = fakeNode->title();
+ if (linkNode && linkNode->type() == Node::Document) {
+ const DocNode *docNode = static_cast<const DocNode*>(linkNode);
+ linkPair.second = docNode->title();
}
writeLink(linkNode, linkPair.second, "previous");
}
if (node->links().contains(Node::NextLink)) {
linkPair = node->links()[Node::NextLink];
linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (linkNode && linkNode->type() == Node::Fake) {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
- linkPair.second = fakeNode->title();
+ if (linkNode && linkNode->type() == Node::Document) {
+ const DocNode *docNode = static_cast<const DocNode*>(linkNode);
+ linkPair.second = docNode->title();
}
writeLink(linkNode, linkPair.second, "next");
}
if (node->links().contains(Node::StartLink)) {
linkPair = node->links()[Node::StartLink];
linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (linkNode && linkNode->type() == Node::Fake) {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(linkNode);
- linkPair.second = fakeNode->title();
+ if (linkNode && linkNode->type() == Node::Document) {
+ const DocNode *docNode = static_cast<const DocNode*>(linkNode);
+ linkPair.second = docNode->title();
}
writeLink(linkNode, linkPair.second, "parent");
}
version + "//EN\" \"" + dtd + "\">";
outputclass = "namespace";
}
- else if (node->type() == Node::Fake || subpage) {
+ else if (node->type() == Node::Document || subpage) {
if (node->subType() == Node::HeaderFile) {
mainTag = DT_cxxClass;
nameTag = DT_apiName;
writeEndTag(); // </p>
writeEndTag(); // <entry>
- if (!(node->type() == Node::Fake)) {
+ if (!(node->type() == Node::Document)) {
Text brief = node->doc().trimmedBriefText(name);
if (!brief.isEmpty()) {
writeStartTag(DT_entry);
*/
void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /* marker */)
{
- QMap<const FakeNode*, QMap<QString, FakeNode*> > fakeNodeMap;
- QMap<QString, const FakeNode*> groupTitlesMap;
- QMap<QString, FakeNode*> uncategorizedNodeMap;
+ QMap<const DocNode*, QMap<QString, DocNode*> > docNodeMap;
+ QMap<QString, const DocNode*> groupTitlesMap;
+ QMap<QString, DocNode*> uncategorizedNodeMap;
QRegExp singleDigit("\\b([0-9])\\b");
const NodeList children = tree_->root()->childNodes();
foreach (Node* child, children) {
- if (child->type() == Node::Fake && child != relative) {
- FakeNode* fakeNode = static_cast<FakeNode*>(child);
+ if (child->type() == Node::Document && child != relative) {
+ DocNode* docNode = static_cast<DocNode*>(child);
// Check whether the page is part of a group or is the group
// definition page.
QString group;
bool isGroupPage = false;
- if (fakeNode->doc().metaCommandsUsed().contains("group")) {
- group = fakeNode->doc().metaCommandArgs("group")[0].first;
+ if (docNode->doc().metaCommandsUsed().contains("group")) {
+ group = docNode->doc().metaCommandArgs("group")[0].first;
isGroupPage = true;
}
// there are too many examples; they would clutter the list
- if (fakeNode->subType() == Node::Example)
+ if (docNode->subType() == Node::Example)
continue;
// not interested either in individual (Qt Designer etc.) manual chapters
- if (fakeNode->links().contains(Node::ContentsLink))
+ if (docNode->links().contains(Node::ContentsLink))
continue;
// Discard external nodes.
- if (fakeNode->subType() == Node::ExternalPage)
+ if (docNode->subType() == Node::ExternalPage)
continue;
- QString sortKey = fakeNode->fullTitle().toLower();
+ QString sortKey = docNode->fullTitle().toLower();
if (sortKey.startsWith("the "))
sortKey.remove(0, 4);
sortKey.replace(singleDigit, "0\\1");
if (isGroupPage) {
// If we encounter a group definition page, we add all
// the pages in that group to the list for that group.
- foreach (Node* member, fakeNode->groupMembers()) {
- if (member->type() != Node::Fake)
+ foreach (Node* member, docNode->groupMembers()) {
+ if (member->type() != Node::Document)
continue;
- FakeNode* page = static_cast<FakeNode*>(member);
+ DocNode* page = static_cast<DocNode*>(member);
if (page) {
QString sortKey = page->fullTitle().toLower();
if (sortKey.startsWith("the "))
sortKey.remove(0, 4);
sortKey.replace(singleDigit, "0\\1");
- fakeNodeMap[const_cast<const FakeNode*>(fakeNode)].insert(sortKey, page);
- groupTitlesMap[fakeNode->fullTitle()] = const_cast<const FakeNode*>(fakeNode);
+ docNodeMap[const_cast<const DocNode*>(docNode)].insert(sortKey, page);
+ groupTitlesMap[docNode->fullTitle()] = const_cast<const DocNode*>(docNode);
}
}
}
else if (!isGroupPage) {
// If we encounter a page that belongs to a group then
// we add that page to the list for that group.
- const FakeNode* gn = tree_->findGroupNode(QStringList(group));
+ const DocNode* gn = tree_->findGroupNode(QStringList(group));
if (gn)
- fakeNodeMap[gn].insert(sortKey, fakeNode);
+ docNodeMap[gn].insert(sortKey, docNode);
}
}
}
// incomplete. However, if the group definition page was listed, all the
// pages in that group are listed for completeness.
- if (!fakeNodeMap.isEmpty()) {
+ if (!docNodeMap.isEmpty()) {
foreach (const QString& groupTitle, groupTitlesMap.keys()) {
- const FakeNode* groupNode = groupTitlesMap[groupTitle];
+ const DocNode* groupNode = groupTitlesMap[groupTitle];
writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","h3");
writeStartTag(DT_xref);
writeCharacters(protectEnc(groupNode->fullTitle()));
writeEndTag(); // </xref>
writeEndTag(); // </p>
- if (fakeNodeMap[groupNode].count() == 0)
+ if (docNodeMap[groupNode].count() == 0)
continue;
writeStartTag(DT_ul);
- foreach (const FakeNode* fakeNode, fakeNodeMap[groupNode]) {
- QString title = fakeNode->fullTitle();
+ foreach (const DocNode* docNode, docNodeMap[groupNode]) {
+ QString title = docNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
writeStartTag(DT_li);
writeStartTag(DT_xref);
// formathtml
- xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative));
+ xmlWriter().writeAttribute("href",linkForNode(docNode, relative));
writeCharacters(protectEnc(title));
writeEndTag(); // </xref>
writeEndTag(); // </li>
xmlWriter().writeCharacters("Miscellaneous");
writeEndTag(); // </p>
writeStartTag(DT_ul);
- foreach (const FakeNode *fakeNode, uncategorizedNodeMap) {
- QString title = fakeNode->fullTitle();
+ foreach (const DocNode *docNode, uncategorizedNodeMap) {
+ QString title = docNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
writeStartTag(DT_li);
writeStartTag(DT_xref);
// formathtml
- xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative));
+ xmlWriter().writeAttribute("href",linkForNode(docNode, relative));
writeCharacters(protectEnc(title));
writeEndTag(); // </xref>
writeEndTag(); // </li>
}
return fn->guid();
}
- case Node::Fake:
+ case Node::Document:
if (node->subType() != Node::QmlPropertyGroup)
break;
case Node::QmlProperty:
*/
QString DitaXmlGenerator::fileName(const Node* node)
{
- if (node->type() == Node::Fake) {
- if (static_cast<const FakeNode*>(node)->pageType() == Node::DitaMapPage)
+ if (node->type() == Node::Document) {
+ if (static_cast<const DocNode*>(node)->pageType() == Node::DitaMapPage)
return node->name();
- if (static_cast<const FakeNode*>(node)->subType() == Node::ExternalPage)
+ if (static_cast<const DocNode*>(node)->subType() == Node::ExternalPage)
return node->name();
- if (static_cast<const FakeNode*>(node)->subType() == Node::Image)
+ if (static_cast<const DocNode*>(node)->subType() == Node::Image)
return node->name();
}
return Generator::fileName(node);
if (!serviceName.isEmpty())
serviceClasses.insert(serviceName, *c);
}
- else if ((*c)->type() == Node::Fake &&
+ else if ((*c)->type() == Node::Document &&
(*c)->subType() == Node::QmlClass &&
!(*c)->doc().isEmpty()) {
QString qmlClassName = (*c)->name();
case Node::Namespace:
case Node::Class:
return 2;
- case Node::Fake:
+ case Node::Document:
return 1;
case Node::Enum:
case Node::Typedef:
node = relative;
}
else if (target.endsWith(".html")) {
- node = tree_->root()->findChildNodeByNameAndType(target, Node::Fake);
+ node = tree_->root()->findChildNodeByNameAndType(target, Node::Document);
}
else if (marker) {
node = marker->resolveTarget(target, tree_, relative);
if (!node)
- node = tree_->findFakeNodeByTitle(target, relative);
+ node = tree_->findDocNodeByTitle(target, relative);
if (!node && atom) {
node = tree_->findUnambiguousTarget(target, *const_cast<Atom**>(&atom), relative);
}
{
QPair<QString,QString> anchorPair;
anchorPair.first = Generator::fileName(node);
- if (node->type() == Node::Fake) {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(node);
- anchorPair.second = fakeNode->title();
+ if (node->type() == Node::Document) {
+ const DocNode *docNode = static_cast<const DocNode*>(node);
+ anchorPair.second = docNode->title();
}
return anchorPair;
*node = relative;
}
else if (first.endsWith(".html")) {
- *node = tree_->root()->findChildNodeByNameAndType(first, Node::Fake);
+ *node = tree_->root()->findChildNodeByNameAndType(first, Node::Document);
}
else {
*node = marker->resolveTarget(first, tree_, relative);
if (!*node)
- *node = tree_->findFakeNodeByTitle(first, relative);
+ *node = tree_->findDocNodeByTitle(first, relative);
if (!*node)
*node = tree_->findUnambiguousTarget(first, targetAtom, relative);
}
if (relative && (relative->parent() != *node) &&
(relative->status() != Node::Obsolete)) {
bool porting = false;
- if (relative->type() == Node::Fake) {
- const FakeNode* fake = static_cast<const FakeNode*>(relative);
+ if (relative->type() == Node::Document) {
+ const DocNode* fake = static_cast<const DocNode*>(relative);
if (fake->title().startsWith("Porting"))
porting = true;
}
<< "We strongly advise against "
<< "using it in new code. See ";
- const FakeNode *fakeNode = tree_->findFakeNodeByTitle("Porting To Qt 4");
+ const DocNode *docNode = tree_->findDocNodeByTitle("Porting To Qt 4");
Atom *targetAtom = 0;
- if (fakeNode && node->type() == Node::Class) {
+ if (docNode && node->type() == Node::Class) {
QString oldName(node->name());
oldName.remove(QLatin1Char('3'));
- targetAtom = tree_->findTarget(oldName,fakeNode);
+ targetAtom = tree_->findTarget(oldName,docNode);
}
if (targetAtom) {
- QString fn = fileName(fakeNode);
- QString guid = lookupGuid(fn,refForAtom(targetAtom,fakeNode));
+ QString fn = fileName(docNode);
+ QString guid = lookupGuid(fn,refForAtom(targetAtom,docNode));
text << Atom(Atom::GuidLink, fn + QLatin1Char('#') + guid);
}
else
{
if (!qcn)
return;
- const FakeNode* base = qcn->qmlBase();
+ const DocNode* base = qcn->qmlBase();
if (base) {
writeStartTag(DT_qmlInherits);
//writeStartTag(DT_qmlTypeDef);
if (!node->url().isNull())
return;
- if (node->type() == Node::Fake) {
- FakeNode* fakeNode = static_cast<FakeNode*>(node);
- if (fakeNode->subType() == Node::ExternalPage)
+ if (node->type() == Node::Document) {
+ DocNode* docNode = static_cast<DocNode*>(node);
+ if (docNode->subType() == Node::ExternalPage)
return;
- if (fakeNode->subType() == Node::Image)
+ if (docNode->subType() == Node::Image)
return;
- if (fakeNode->subType() == Node::QmlPropertyGroup)
+ if (docNode->subType() == Node::QmlPropertyGroup)
return;
- if (fakeNode->subType() == Node::Page) {
+ if (docNode->subType() == Node::Page) {
if (node->count() > 0)
- qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title()));
+ qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
}
}
later in generateCollisionPages(). Each one is
appended to a list for later.
*/
- if ((node->type() == Node::Fake) && (node->subType() == Node::Collision)) {
+ if ((node->type() == Node::Document) && (node->subType() == Node::Collision)) {
NameCollisionNode* ncn = static_cast<NameCollisionNode*>(node);
collisionNodes.append(const_cast<NameCollisionNode*>(ncn));
}
if (node->type() == Node::Namespace || node->type() == Node::Class) {
generateClassLikeNode(node, marker);
}
- else if (node->type() == Node::Fake) {
+ else if (node->type() == Node::Document) {
if (node->subType() == Node::HeaderFile)
generateClassLikeNode(node, marker);
else if (node->subType() == Node::QmlClass)
generateClassLikeNode(node, marker);
else
- generateFakeNode(static_cast<FakeNode*>(node), marker);
+ generateDocNode(static_cast<DocNode*>(node), marker);
}
if (!node->name().endsWith(".ditamap"))
endSubPage();
QString message;
for (int i=0; i<children.size(); ++i) {
Node* child = children[i];
- if ((child->type() == Node::Fake) && (child->subType() == Node::Collision)) {
- const FakeNode* fake = static_cast<const FakeNode*>(child);
+ if ((child->type() == Node::Document) && (child->subType() == Node::Collision)) {
+ const DocNode* fake = static_cast<const DocNode*>(child);
Node* n = collectNodesByTypeAndSubtype(fake);
if (n)
rootPageNode = n;
if (!isDuplicate(nodeTypeMaps[Node::Class],child->name(),child))
nodeTypeMaps[Node::Class]->insert(child->name(),child);
break;
- case Node::Fake:
+ case Node::Document:
switch (child->subType()) {
case Node::Example:
if (!isDuplicate(nodeSubtypeMaps[Node::Example],child->title(),child))
writeStartTag(DT_topicref);
xmlWriter().writeAttribute("navtitle",t->navtitle());
if (t->href().isEmpty()) {
- const FakeNode* fn = tree_->findFakeNodeByTitle(t->navtitle());
- if (fn)
- xmlWriter().writeAttribute("href",fileName(fn));
+ const DocNode* dn = tree_->findDocNodeByTitle(t->navtitle());
+ if (dn)
+ xmlWriter().writeAttribute("href",fileName(dn));
}
else
xmlWriter().writeAttribute("href",t->href());
category = "Class reference";
else if (inner->type() == Node::Namespace)
category = "Namespace";
- else if (inner->type() == Node::Fake) {
+ else if (inner->type() == Node::Document) {
if (inner->subType() == Node::QmlClass)
category = "QML Reference";
else if (inner->subType() == Node::QmlBasicType)
writeEndTag(); // </othermeta>
}
if ((tagStack.first() == DT_cxxClass && !inner->includes().isEmpty()) ||
- (inner->type() == Node::Fake && inner->subType() == Node::HeaderFile)) {
+ (inner->type() == Node::Document && inner->subType() == Node::HeaderFile)) {
writeStartTag(DT_othermeta);
xmlWriter().writeAttribute("name","includeFile");
QString text;
const Node* relative,
CodeMarker* marker);
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateFakeNode(FakeNode* fake, CodeMarker* marker);
+ virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
virtual QString fileExtension() const;
virtual QString guidForNode(const Node* node);
virtual QString linkForNode(const Node* node, const Node* relative);
CodeMarker* marker,
const QString& attribute = QString());
void writePropertyParameter(const QString& tag, const NodeList& nlist);
- void writeRelatedLinks(const FakeNode* fake, CodeMarker* marker);
+ void writeRelatedLinks(const DocNode* dn, CodeMarker* marker);
void writeLink(const Node* node, const QString& tex, const QString& role);
void writeProlog(const InnerNode* inner);
bool writeMetadataElement(const InnerNode* inner,
class DocPrivate;
class Quoter;
class Text;
-class FakeNode;
class DitaRef;
typedef QPair<QString, Location> ArgLocPair;
(p->subType() == Node::QmlBasicType)) {
base.prepend(outputPrefix(QLatin1String("QML")));
}
- if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
+ if (!pp || pp->name().isEmpty() || pp->type() == Node::Document)
break;
base.prepend(QLatin1Char('-'));
p = pp;
}
- if (node->type() == Node::Fake) {
+ if (node->type() == Node::Document) {
if (node->subType() == Node::Collision) {
const NameCollisionNode* ncn = static_cast<const NameCollisionNode*>(node);
if (ncn->currentChild())
else
return QString();
}
- else if (node->type() == Node::Fake) {
+ else if (node->type() == Node::Document) {
if ((node->subType() == Node::QmlClass) ||
(node->subType() == Node::QmlBasicType)) {
QString fb = fileBase(node);
case Node::Variable:
anchorRef = QLatin1Char('#') + node->name() + "-var";
break;
- case Node::Fake:
+ case Node::Document:
{
- /*
- Use fileBase(node) for fake nodes because they are represented
- by pages whose file names are lower-case.
- */
parentName = fileBase(node);
parentName.replace(QLatin1Char('/'), QLatin1Char('-')).replace(QLatin1Char('.'), QLatin1Char('-'));
parentName += QLatin1Char('.') + currentGenerator()->fileExtension();
const Node *relative,
CodeMarker *marker) const
{
- if (node->type() == Node::Fake) {
- const FakeNode* fn = static_cast<const FakeNode *>(node);
+ if (node->type() == Node::Document) {
+ const DocNode* fn = static_cast<const DocNode *>(node);
// Only print modulename::type on collision pages.
if (!fn->qmlModuleIdentifier().isEmpty() && relative != 0 && relative->isCollisionNode())
{
bool quiet = false;
- if (node->type() == Node::Fake) {
- const FakeNode *fake = static_cast<const FakeNode *>(node);
- if ((fake->subType() == Node::File) || (fake->subType() == Node::Image)) {
+ if (node->type() == Node::Document) {
+ const DocNode *dn = static_cast<const DocNode *>(node);
+ if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) {
quiet = true;
}
}
}
}
- if (node->type() == Node::Fake) {
- const FakeNode *fake = static_cast<const FakeNode *>(node);
- if (fake->subType() == Node::Example) {
- generateExampleFiles(fake, marker);
+ if (node->type() == Node::Document) {
+ const DocNode *dn = static_cast<const DocNode *>(node);
+ if (dn->subType() == Node::Example) {
+ generateExampleFiles(dn, marker);
}
- else if (fake->subType() == Node::File) {
+ else if (dn->subType() == Node::File) {
Text text;
Quoter quoter;
- Doc::quoteFromFile(fake->doc().location(), quoter, fake->name());
- QString code = quoter.quoteTo(fake->location(), QString(), QString());
- CodeMarker *codeMarker = CodeMarker::markerForFileName(fake->name());
+ Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
+ QString code = quoter.quoteTo(dn->location(), QString(), QString());
+ CodeMarker *codeMarker = CodeMarker::markerForFileName(dn->name());
text << Atom(codeMarker->atomType(), code);
- generateText(text, fake, codeMarker);
+ generateText(text, dn, codeMarker);
}
}
}
{
}
-void Generator::generateExampleFiles(const FakeNode *fake, CodeMarker *marker)
+void Generator::generateExampleFiles(const DocNode *dn, CodeMarker *marker)
{
- if (fake->childNodes().isEmpty())
+ if (dn->childNodes().isEmpty())
return;
- generateFileList(fake, marker, Node::File, QString("Files:"));
- generateFileList(fake, marker, Node::Image, QString("Images:"));
+ generateFileList(dn, marker, Node::File, QString("Files:"));
+ generateFileList(dn, marker, Node::Image, QString("Images:"));
}
-void Generator::generateFakeNode(FakeNode* /* fake */, CodeMarker* /* marker */)
+void Generator::generateDocNode(DocNode* /* dn */, CodeMarker* /* marker */)
{
}
by the example. The images are copied into a subtree of
\c{...doc/html/images/used-in-examples/...}
*/
-void Generator::generateFileList(const FakeNode* fake,
+void Generator::generateFileList(const DocNode* dn,
CodeMarker* marker,
Node::SubType subtype,
const QString& tag)
text << Atom::ParaLeft << tag << Atom::ParaRight
<< Atom(Atom::ListLeft, openedList.styleString());
- foreach (const Node* child, fake->childNodes()) {
+ foreach (const Node* child, dn->childNodes()) {
if (child->subType() == subtype) {
++count;
QString file = child->name();
if (!file.isEmpty()) {
QDir dirInfo;
QString userFriendlyFilePath;
- QString srcPath = Config::findFile(fake->location(),
+ QString srcPath = Config::findFile(dn->location(),
QStringList(),
exampleDirs,
file,
QString imgOutDir = outDir_ + "/images/used-in-examples/" + userFriendlyFilePath;
if (!dirInfo.mkpath(imgOutDir))
- fake->location().fatal(tr("Cannot create output directory '%1'")
+ dn->location().fatal(tr("Cannot create output directory '%1'")
.arg(imgOutDir));
- QString imgOutName = Config::copyFile(fake->location(),
+ QString imgOutName = Config::copyFile(dn->location(),
srcPath,
file,
imgOutDir);
}
text << Atom(Atom::ListRight, openedList.styleString());
if (count > 0)
- generateText(text, fake, marker);
+ generateText(text, dn, marker);
}
void Generator::generateInheritedBy(const ClassNode *classe, CodeMarker *marker)
if (!node->url().isNull())
return;
- if (node->type() == Node::Fake) {
- FakeNode* fakeNode = static_cast<FakeNode*>(node);
- if (fakeNode->subType() == Node::ExternalPage)
+ if (node->type() == Node::Document) {
+ DocNode* docNode = static_cast<DocNode*>(node);
+ if (docNode->subType() == Node::ExternalPage)
return;
- if (fakeNode->subType() == Node::Image)
+ if (docNode->subType() == Node::Image)
return;
- if (fakeNode->subType() == Node::QmlPropertyGroup)
+ if (docNode->subType() == Node::QmlPropertyGroup)
return;
- if (fakeNode->subType() == Node::Page) {
+ if (docNode->subType() == Node::Page) {
if (node->count() > 0)
- qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title()));
+ qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
}
}
later in generateCollisionPages(). Each one is
appended to a list for later.
*/
- if ((node->type() == Node::Fake) && (node->subType() == Node::Collision)) {
+ if ((node->type() == Node::Document) && (node->subType() == Node::Collision)) {
NameCollisionNode* ncn = static_cast<NameCollisionNode*>(node);
collisionNodes.append(const_cast<NameCollisionNode*>(ncn));
}
if (node->type() == Node::Namespace || node->type() == Node::Class) {
generateClassLikeNode(node, marker);
}
- else if (node->type() == Node::Fake) {
- generateFakeNode(static_cast<FakeNode*>(node), marker);
+ else if (node->type() == Node::Document) {
+ generateDocNode(static_cast<DocNode*>(node), marker);
}
endSubPage();
}
return "namespace";
case Node::Class:
return "class";
- case Node::Fake:
+ case Node::Document:
{
switch (node->subType()) {
case Node::QmlClass:
class ClassNode;
class Config;
class CodeMarker;
-class FakeNode;
+class DocNode;
class FunctionNode;
class InnerNode;
class Location;
CodeMarker *marker);
virtual void generateBody(const Node *node, CodeMarker *marker);
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateFakeNode(FakeNode* fake, CodeMarker* marker);
+ virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
virtual void generateInheritedBy(const ClassNode *classe,
CodeMarker *marker);
virtual void generateInherits(const ClassNode *classe,
CodeMarker *marker,
bool generate,
int& numGeneratedAtoms);
- void generateExampleFiles(const FakeNode *fake, CodeMarker *marker);
- void generateFileList(const FakeNode* fake,
+ void generateExampleFiles(const DocNode *dn, CodeMarker *marker);
+ void generateFileList(const DocNode* dn,
CodeMarker* marker,
Node::SubType subtype,
const QString& tag);
QHash<QString, Node::Type> typeHash;
typeHash["namespace"] = Node::Namespace;
typeHash["class"] = Node::Class;
- typeHash["fake"] = Node::Fake;
+ typeHash["fake"] = Node::Document;
typeHash["enum"] = Node::Enum;
typeHash["typedef"] = Node::Typedef;
typeHash["function"] = Node::Function;
// "id"
details << node->parent()->name()+"::"+node->name();
}
- else if (node->type() == Node::Fake) {
- const FakeNode *fake = static_cast<const FakeNode *>(node);
+ else if (node->type() == Node::Document) {
+ const DocNode *fake = static_cast<const DocNode *>(node);
if (fake->subType() == Node::QmlClass) {
details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle());
details << "QML." + fake->name();
return false;
QString objName;
- if (node->type() == Node::Fake) {
- const FakeNode *fake = static_cast<const FakeNode *>(node);
+ if (node->type() == Node::Document) {
+ const DocNode *fake = static_cast<const DocNode *>(node);
objName = fake->fullTitle();
}
else
}
else if (subproject.selectors.contains(node->type())) {
// Accept only the node types in the selectors hash.
- if (node->type() != Node::Fake)
+ if (node->type() != Node::Document)
project.subprojects[name].nodes[objName] = node;
else {
// Accept only fake nodes with subtypes contained in the selector's
// mask.
- const FakeNode *fakeNode = static_cast<const FakeNode *>(node);
- if (subproject.selectors[node->type()].contains(fakeNode->subType()) &&
- fakeNode->subType() != Node::ExternalPage &&
- !fakeNode->fullTitle().isEmpty()) {
+ const DocNode *docNode = static_cast<const DocNode *>(node);
+ if (subproject.selectors[node->type()].contains(docNode->subType()) &&
+ docNode->subType() != Node::ExternalPage &&
+ !docNode->fullTitle().isEmpty()) {
project.subprojects[name].nodes[objName] = node;
}
}
break;
- // Fake nodes (such as manual pages) contain subtypes, titles and other
+ // Document nodes (such as manual pages) contain subtypes, titles and other
// attributes.
- case Node::Fake: {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(node);
- if (fakeNode->subType() != Node::ExternalPage &&
- !fakeNode->fullTitle().isEmpty()) {
-
- if (fakeNode->subType() != Node::File) {
- if (fakeNode->doc().hasKeywords()) {
- foreach (const Atom *keyword, fakeNode->doc().keywords()) {
+ case Node::Document: {
+ const DocNode *docNode = static_cast<const DocNode*>(node);
+ if (docNode->subType() != Node::ExternalPage &&
+ !docNode->fullTitle().isEmpty()) {
+
+ if (docNode->subType() != Node::File) {
+ if (docNode->doc().hasKeywords()) {
+ foreach (const Atom *keyword, docNode->doc().keywords()) {
if (!keyword->string().isEmpty()) {
QStringList details;
details << keyword->string()
QLatin1Char('#') + Doc::canonicalTitle(keyword->string());
project.keywords.append(details);
} else
- fakeNode->doc().location().warning(
+ docNode->doc().location().warning(
tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,true))
);
}
foreach (const Node *node, inner->childNodes()) {
if (node->access() == Node::Private)
continue;
- if (node->type() == Node::Fake) {
+ if (node->type() == Node::Document) {
/*
Don't visit QML property group nodes,
but visit their children, which are all
}
}
else
- childMap[static_cast<const FakeNode *>(node)->fullTitle()] = node;
+ childMap[static_cast<const DocNode *>(node)->fullTitle()] = node;
}
else {
if (node->type() == Node::Function) {
writer.writeEndElement(); // section
break;
- case Node::Fake: {
- // Fake nodes (such as manual pages) contain subtypes, titles and other
+ case Node::Document: {
+ // Document nodes (such as manual pages) contain subtypes, titles and other
// attributes.
- const FakeNode *fakeNode = static_cast<const FakeNode*>(node);
+ const DocNode *docNode = static_cast<const DocNode*>(node);
writer.writeStartElement("section");
writer.writeAttribute("ref", href);
- if (fakeNode->subType() == Node::QmlClass)
- writer.writeAttribute("title", tr("%1 Type Reference").arg(fakeNode->fullTitle()));
+ if (docNode->subType() == Node::QmlClass)
+ writer.writeAttribute("title", tr("%1 Type Reference").arg(docNode->fullTitle()));
else
- writer.writeAttribute("title", fakeNode->fullTitle());
+ writer.writeAttribute("title", docNode->fullTitle());
- if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) {
+ if ((docNode->subType() == Node::HeaderFile) || (docNode->subType() == Node::QmlClass)) {
// Write subsections for all members, obsolete members and Qt 3
// members.
- if (!project.memberStatus[node].isEmpty() || (fakeNode->subType() == Node::QmlClass)) {
+ if (!project.memberStatus[node].isEmpty() || (docNode->subType() == Node::QmlClass)) {
QString membersPath = href.left(href.size()-5) + "-members.html";
writer.writeStartElement("section");
writer.writeAttribute("ref", membersPath);
{
const Node *rootNode;
if (!project.indexRoot.isEmpty())
- rootNode = tree->findFakeNodeByTitle(project.indexRoot);
+ rootNode = tree->findDocNodeByTitle(project.indexRoot);
else
rootNode = tree->root();
writer.writeStartElement("toc");
writer.writeStartElement("section");
- const Node* node = tree->findFakeNodeByTitle(project.indexTitle);
+ const Node* node = tree->findDocNodeByTitle(project.indexTitle);
if (node == 0)
node = tree->findNode(QStringList("index.html"));
QString indexPath;
if (subproject.type == QLatin1String("manual")) {
- const FakeNode *indexPage = tree->findFakeNodeByTitle(subproject.indexTitle);
+ const DocNode *indexPage = tree->findDocNodeByTitle(subproject.indexTitle);
if (indexPage) {
Text indexBody = indexPage->doc().body();
const Atom *atom = indexBody.firstAtom();
if (sectionStack.top() > 0)
writer.writeEndElement(); // section
- const FakeNode *page = tree->findFakeNodeByTitle(atom->string());
+ const DocNode *page = tree->findDocNodeByTitle(atom->string());
writer.writeStartElement("section");
QString indexPath = gen_->fullDocumentLocation(page,true);
writer.writeAttribute("ref", indexPath);
if (!name.isEmpty()) {
writer.writeStartElement("section");
- QString indexPath = gen_->fullDocumentLocation(tree->findFakeNodeByTitle(subproject.indexTitle),true);
+ QString indexPath = gen_->fullDocumentLocation(tree->findDocNodeByTitle(subproject.indexTitle),true);
writer.writeAttribute("ref", indexPath);
writer.writeAttribute("title", subproject.title);
project.files.insert(indexPath);
if (!nextTitle.isEmpty() &&
node->links().value(Node::ContentsLink).first.isEmpty()) {
- FakeNode *nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
+ DocNode *nextPage = const_cast<DocNode *>(tree->findDocNodeByTitle(nextTitle));
// Write the contents node.
writeNode(project, writer, node);
nextTitle = nextPage->links().value(Node::NextLink).first;
if (nextTitle.isEmpty() || visited.contains(nextTitle))
break;
- nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
+ nextPage = const_cast<DocNode *>(tree->findDocNodeByTitle(nextTitle));
visited.insert(nextTitle);
}
break;
{
QString title;
QString indexTitle;
- QHash<Node::Type, QSet<FakeNode::SubType> > selectors;
+ QHash<Node::Type, QSet<DocNode::SubType> > selectors;
bool sortPages;
QString type;
QHash<QString, const Node *> nodes;
case Atom::BaseName:
break;
case Atom::BriefLeft:
- if (relative->type() == Node::Fake) {
+ if (relative->type() == Node::Document) {
if (relative->subType() != Node::Example) {
skipAhead = skipAtoms(atom, Atom::BriefRight);
break;
}
break;
case Atom::BriefRight:
- if (relative->type() != Node::Fake)
+ if (relative->type() != Node::Document)
out() << "</p>\n";
break;
case Atom::C:
generateAnnotatedList(relative, marker, namespaceIndex);
}
else if (atom->string() == "related") {
- const FakeNode *fake = static_cast<const FakeNode *>(relative);
- if (fake && !fake->groupMembers().isEmpty()) {
+ const DocNode *dn = static_cast<const DocNode *>(relative);
+ if (dn && !dn->groupMembers().isEmpty()) {
NodeMap groupMembersMap;
- foreach (const Node *node, fake->groupMembers()) {
- if (node->type() == Node::Fake)
+ foreach (const Node *node, dn->groupMembers()) {
+ if (node->type() == Node::Document)
groupMembersMap[fullName(node, relative, marker)] = node;
}
- generateAnnotatedList(fake, marker, groupMembersMap);
+ generateAnnotatedList(dn, marker, groupMembersMap);
}
}
else if (atom->string() == "relatedinline") {
- const FakeNode *fake = static_cast<const FakeNode *>(relative);
- if (fake && !fake->groupMembers().isEmpty()) {
+ const DocNode *dn = static_cast<const DocNode *>(relative);
+ if (dn && !dn->groupMembers().isEmpty()) {
// Reverse the list into the original scan order.
// Should be sorted. But on what? It may not be a
// regular class or page definition.
QList<const Node *> list;
- foreach (const Node *node, fake->groupMembers())
+ foreach (const Node *node, dn->groupMembers())
list.prepend(node);
foreach (const Node *node, list)
generateBody(node, marker);
const Node* node = n.value();
switch (node->type()) {
- case Node::Fake:
+ case Node::Document:
if (node->subType() == Node::QmlClass) {
sections[QmlClass].appendMember((Node*)node);
}
out() << " alt=\"\"";
out() << " />";
helpProjectWriter->addExtraFile(fileName);
- if ((relative->type() == Node::Fake) &&
+ if ((relative->type() == Node::Document) &&
(relative->subType() == Node::Example)) {
const ExampleNode* cen = static_cast<const ExampleNode*>(relative);
if (cen->imageFileName().isEmpty()) {
Generate the HTML page for an entity that doesn't map
to any underlying parsable C++ class or QML component.
*/
-void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker)
+void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
{
/*
- If the fake node is a page node, and if the page type
+ If the document node is a page node, and if the page type
is DITA map page, write the node's contents as a dita
map and return without doing anything else.
*/
- if (fake->subType() == Node::Page && fake->pageType() == Node::DitaMapPage) {
- const DitaMapNode* dmn = static_cast<const DitaMapNode*>(fake);
+ if (dn->subType() == Node::Page && dn->pageType() == Node::DitaMapPage) {
+ const DitaMapNode* dmn = static_cast<const DitaMapNode*>(dn);
writeDitaMap(dmn);
return;
}
SubTitleSize subTitleSize = LargeSubTitle;
QList<Section> sections;
QList<Section>::const_iterator s;
- QString fullTitle = fake->fullTitle();
+ QString fullTitle = dn->fullTitle();
QString htmlTitle = fullTitle;
- if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) {
+ if (dn->subType() == Node::File && !dn->subTitle().isEmpty()) {
subTitleSize = SmallSubTitle;
- htmlTitle += " (" + fake->subTitle() + QLatin1Char(')');
+ htmlTitle += " (" + dn->subTitle() + QLatin1Char(')');
}
- else if (fake->subType() == Node::QmlBasicType) {
+ else if (dn->subType() == Node::QmlBasicType) {
fullTitle = "QML Basic Type: " + fullTitle;
htmlTitle = fullTitle;
marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
}
- generateHeader(htmlTitle, fake, marker);
+ generateHeader(htmlTitle, dn, marker);
/*
Generate the TOC for the new doc format.
Don't generate a TOC for the home page.
*/
QmlClassNode* qml_cn = 0;
- if (fake->subType() == Node::QmlClass) {
- qml_cn = static_cast<QmlClassNode*>(fake);
+ if (dn->subType() == Node::QmlClass) {
+ qml_cn = static_cast<QmlClassNode*>(dn);
sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
- generateTableOfContents(fake,marker,§ions);
+ generateTableOfContents(dn,marker,§ions);
// Replace the marker with a QML code marker.
marker = CodeMarker::markerForLanguage(QLatin1String("QML"));
}
- else if (fake->subType() != Node::Collision && fake->name() != QString("index.html"))
- generateTableOfContents(fake,marker,0);
+ else if (dn->subType() != Node::Collision && dn->name() != QString("index.html"))
+ generateTableOfContents(dn,marker,0);
generateTitle(fullTitle,
- Text() << fake->subTitle(),
+ Text() << dn->subTitle(),
subTitleSize,
- fake,
+ dn,
marker);
- if (fake->subType() == Node::Module) {
+ if (dn->subType() == Node::Module) {
// Generate brief text and status for modules.
- generateBrief(fake, marker);
- generateStatus(fake, marker);
- generateSince(fake, marker);
+ generateBrief(dn, marker);
+ generateStatus(dn, marker);
+ generateSince(dn, marker);
- if (moduleNamespaceMap.contains(fake->name())) {
+ if (moduleNamespaceMap.contains(dn->name())) {
out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << '\n';
out() << "<h2>Namespaces</h2>\n";
- generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
+ generateAnnotatedList(dn, marker, moduleNamespaceMap[dn->name()]);
}
- if (moduleClassMap.contains(fake->name())) {
+ if (moduleClassMap.contains(dn->name())) {
out() << "<a name=\"" << registerRef("classes") << "\"></a>" << divNavTop << '\n';
out() << "<h2>Classes</h2>\n";
- generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
+ generateAnnotatedList(dn, marker, moduleClassMap[dn->name()]);
}
}
- else if (fake->subType() == Node::HeaderFile) {
+ else if (dn->subType() == Node::HeaderFile) {
// Generate brief text and status for modules.
- generateBrief(fake, marker);
- generateStatus(fake, marker);
- generateSince(fake, marker);
+ generateBrief(dn, marker);
+ generateStatus(dn, marker);
+ generateSince(dn, marker);
out() << "<ul>\n";
- QString membersLink = generateListOfAllMemberFile(fake, marker);
+ QString membersLink = generateListOfAllMemberFile(dn, marker);
if (!membersLink.isEmpty())
out() << "<li><a href=\"" << membersLink << "\">"
<< "List of all members, including inherited members</a></li>\n";
- QString obsoleteLink = generateLowStatusMemberFile(fake,
+ QString obsoleteLink = generateLowStatusMemberFile(dn,
marker,
CodeMarker::Obsolete);
if (!obsoleteLink.isEmpty())
out() << "<li><a href=\"" << obsoleteLink << "\">"
<< "Obsolete members</a></li>\n";
- QString compatLink = generateLowStatusMemberFile(fake,
+ QString compatLink = generateLowStatusMemberFile(dn,
marker,
CodeMarker::Compat);
if (!compatLink.isEmpty())
out() << "</ul>\n";
}
- else if (fake->subType() == Node::QmlClass) {
- const_cast<FakeNode*>(fake)->setCurrentChild();
+ else if (dn->subType() == Node::QmlClass) {
+ const_cast<DocNode*>(dn)->setCurrentChild();
ClassNode* cn = qml_cn->classNode();
generateBrief(qml_cn, marker);
generateQmlInherits(qml_cn, marker);
out() << "<a name=\"" << registerRef((*s).name.toLower())
<< "\"></a>" << divNavTop << '\n';
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
- generateQmlSummary(*s,fake,marker);
+ generateQmlSummary(*s,dn,marker);
++s;
}
- generateExtractionMark(fake, DetailedDescriptionMark);
+ generateExtractionMark(dn, DetailedDescriptionMark);
out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << '\n';
out() << "<h2>" << "Detailed Description" << "</h2>\n";
- generateBody(fake, marker);
+ generateBody(dn, marker);
if (cn)
- generateQmlText(cn->doc().body(), cn, marker, fake->name());
- generateAlsoList(fake, marker);
- generateExtractionMark(fake, EndMark);
+ generateQmlText(cn->doc().body(), cn, marker, dn->name());
+ generateAlsoList(dn, marker);
+ generateExtractionMark(dn, EndMark);
//out() << "<hr />\n";
sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
NodeList::ConstIterator m = (*s).members.constBegin();
while (m != (*s).members.constEnd()) {
- generateDetailedQmlMember(*m, fake, marker);
+ generateDetailedQmlMember(*m, dn, marker);
out() << "<br/>\n";
++m;
}
++s;
}
- generateFooter(fake);
- const_cast<FakeNode*>(fake)->clearCurrentChild();
+ generateFooter(dn);
+ const_cast<DocNode*>(dn)->clearCurrentChild();
return;
}
- sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay);
+ sections = marker->sections(dn, CodeMarker::Summary, CodeMarker::Okay);
s = sections.constBegin();
while (s != sections.constEnd()) {
out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << '\n';
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
- generateSectionList(*s, fake, marker, CodeMarker::Summary);
+ generateSectionList(*s, dn, marker, CodeMarker::Summary);
++s;
}
- Text brief = fake->doc().briefText();
- if (fake->subType() == Node::Module && !brief.isEmpty()) {
- generateExtractionMark(fake, DetailedDescriptionMark);
+ Text brief = dn->doc().briefText();
+ if (dn->subType() == Node::Module && !brief.isEmpty()) {
+ generateExtractionMark(dn, DetailedDescriptionMark);
out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << '\n';
out() << "<div class=\"descr\">\n"; // QTBUG-9504
out() << "<h2>" << "Detailed Description" << "</h2>\n";
}
else {
- generateExtractionMark(fake, DetailedDescriptionMark);
+ generateExtractionMark(dn, DetailedDescriptionMark);
out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
}
- generateBody(fake, marker);
+ generateBody(dn, marker);
out() << "</div>\n"; // QTBUG-9504
- generateAlsoList(fake, marker);
- generateExtractionMark(fake, EndMark);
+ generateAlsoList(dn, marker);
+ generateExtractionMark(dn, EndMark);
- if ((fake->subType() == Node::Group) && !fake->groupMembers().isEmpty()) {
+ if ((dn->subType() == Node::Group) && !dn->groupMembers().isEmpty()) {
NodeMap groupMembersMap;
- foreach (const Node *node, fake->groupMembers()) {
+ foreach (const Node *node, dn->groupMembers()) {
if (node->type() == Node::Class || node->type() == Node::Namespace)
groupMembersMap[node->name()] = node;
}
- generateAnnotatedList(fake, marker, groupMembersMap);
+ generateAnnotatedList(dn, marker, groupMembersMap);
}
- else if ((fake->subType() == Node::QmlModule) && !fake->qmlModuleMembers().isEmpty()) {
+ else if ((dn->subType() == Node::QmlModule) && !dn->qmlModuleMembers().isEmpty()) {
NodeMap qmlModuleMembersMap;
- foreach (const Node* node, fake->qmlModuleMembers()) {
- if (node->type() == Node::Fake && node->subType() == Node::QmlClass)
+ foreach (const Node* node, dn->qmlModuleMembers()) {
+ if (node->type() == Node::Document && node->subType() == Node::QmlClass)
qmlModuleMembersMap[node->name()] = node;
}
- generateAnnotatedList(fake, marker, qmlModuleMembersMap);
+ generateAnnotatedList(dn, marker, qmlModuleMembersMap);
}
- sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay);
+ sections = marker->sections(dn, CodeMarker::Detailed, CodeMarker::Okay);
s = sections.constBegin();
while (s != sections.constEnd()) {
//out() << "<hr />\n";
NodeList::ConstIterator m = (*s).members.constBegin();
while (m != (*s).members.constEnd()) {
- generateDetailedMember(*m, fake, marker);
+ generateDetailedMember(*m, dn, marker);
++m;
}
++s;
}
- generateFooter(fake);
+ generateFooter(dn);
}
/*!
<< Atom(Atom::String, protectEnc(cn->name()))
<< Atom(Atom::ListItemRight);
}
- else if (node->type() == Node::Fake) {
- const FakeNode* fn = static_cast<const FakeNode*>(node);
+ else if (node->type() == Node::Document) {
+ const DocNode* fn = static_cast<const DocNode*>(node);
if (node->subType() == Node::Module) {
breadcrumbs << Atom(Atom::ListItemLeft)
<< Atom(Atom::Link, QLatin1String("All Modules"))
generateFullName(node, relative, marker);
out() << "</p></td>";
- if (!(node->type() == Node::Fake)) {
+ if (!(node->type() == Node::Document)) {
Text brief = node->doc().trimmedBriefText(name);
if (!brief.isEmpty()) {
out() << "<td class=\"tblDescr\"><p>";
void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* marker */)
{
- QMap<const FakeNode *, QMap<QString, FakeNode *> > fakeNodeMap;
- QMap<QString, const FakeNode *> groupTitlesMap;
- QMap<QString, FakeNode *> uncategorizedNodeMap;
+ QMap<const DocNode *, QMap<QString, DocNode *> > docNodeMap;
+ QMap<QString, const DocNode *> groupTitlesMap;
+ QMap<QString, DocNode *> uncategorizedNodeMap;
QRegExp singleDigit("\\b([0-9])\\b");
const NodeList children = tree_->root()->childNodes();
foreach (Node *child, children) {
- if (child->type() == Node::Fake && child != relative) {
- FakeNode *fakeNode = static_cast<FakeNode *>(child);
+ if (child->type() == Node::Document && child != relative) {
+ DocNode *docNode = static_cast<DocNode *>(child);
// Check whether the page is part of a group or is the group
// definition page.
QString group;
bool isGroupPage = false;
- if (fakeNode->doc().metaCommandsUsed().contains("group")) {
- group = fakeNode->doc().metaCommandArgs("group")[0].first;
+ if (docNode->doc().metaCommandsUsed().contains("group")) {
+ group = docNode->doc().metaCommandArgs("group")[0].first;
isGroupPage = true;
}
// there are too many examples; they would clutter the list
- if (fakeNode->subType() == Node::Example)
+ if (docNode->subType() == Node::Example)
continue;
// not interested either in individual (Qt Designer etc.) manual chapters
- if (fakeNode->links().contains(Node::ContentsLink))
+ if (docNode->links().contains(Node::ContentsLink))
continue;
// Discard external nodes.
- if (fakeNode->subType() == Node::ExternalPage)
+ if (docNode->subType() == Node::ExternalPage)
continue;
- QString sortKey = fakeNode->fullTitle().toLower();
+ QString sortKey = docNode->fullTitle().toLower();
if (sortKey.startsWith("the "))
sortKey.remove(0, 4);
sortKey.replace(singleDigit, "0\\1");
if (isGroupPage) {
// If we encounter a group definition page, we add all
// the pages in that group to the list for that group.
- foreach (Node *member, fakeNode->groupMembers()) {
- if (member->type() != Node::Fake)
+ foreach (Node *member, docNode->groupMembers()) {
+ if (member->type() != Node::Document)
continue;
- FakeNode *page = static_cast<FakeNode *>(member);
+ DocNode *page = static_cast<DocNode *>(member);
if (page) {
QString sortKey = page->fullTitle().toLower();
if (sortKey.startsWith("the "))
sortKey.remove(0, 4);
sortKey.replace(singleDigit, "0\\1");
- fakeNodeMap[const_cast<const FakeNode *>(fakeNode)].insert(sortKey, page);
- groupTitlesMap[fakeNode->fullTitle()] = const_cast<const FakeNode *>(fakeNode);
+ docNodeMap[const_cast<const DocNode *>(docNode)].insert(sortKey, page);
+ groupTitlesMap[docNode->fullTitle()] = const_cast<const DocNode *>(docNode);
}
}
}
else if (!isGroupPage) {
// If we encounter a page that belongs to a group then
// we add that page to the list for that group.
- const FakeNode* gn = tree_->findGroupNode(QStringList(group));
+ const DocNode* gn = tree_->findGroupNode(QStringList(group));
if (gn)
- fakeNodeMap[gn].insert(sortKey, fakeNode);
+ docNodeMap[gn].insert(sortKey, docNode);
}
}
}
// incomplete. However, if the group definition page was listed, all the
// pages in that group are listed for completeness.
- if (!fakeNodeMap.isEmpty()) {
+ if (!docNodeMap.isEmpty()) {
foreach (const QString &groupTitle, groupTitlesMap.keys()) {
- const FakeNode *groupNode = groupTitlesMap[groupTitle];
+ const DocNode *groupNode = groupTitlesMap[groupTitle];
out() << QString("<h3><a href=\"%1\">%2</a></h3>\n").arg(
linkForNode(groupNode, relative)).arg(
protectEnc(groupNode->fullTitle()));
- if (fakeNodeMap[groupNode].count() == 0)
+ if (docNodeMap[groupNode].count() == 0)
continue;
out() << "<ul>\n";
- foreach (const FakeNode *fakeNode, fakeNodeMap[groupNode]) {
- QString title = fakeNode->fullTitle();
+ foreach (const DocNode *docNode, docNodeMap[groupNode]) {
+ QString title = docNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
- out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">"
+ out() << "<li><a href=\"" << linkForNode(docNode, relative) << "\">"
<< protectEnc(title) << "</a></li>\n";
}
out() << "</ul>\n";
if (!uncategorizedNodeMap.isEmpty()) {
out() << QString("<h3>Miscellaneous</h3>\n");
out() << "<ul>\n";
- foreach (const FakeNode *fakeNode, uncategorizedNodeMap) {
- QString title = fakeNode->fullTitle();
+ foreach (const DocNode *docNode, uncategorizedNodeMap) {
+ QString title = docNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
- out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">"
+ out() << "<li><a href=\"" << linkForNode(docNode, relative) << "\">"
<< protectEnc(title) << "</a></li>\n";
}
out() << "</ul>\n";
QString HtmlGenerator::fileName(const Node *node)
{
- if (node->type() == Node::Fake) {
- if (static_cast<const FakeNode *>(node)->subType() == Node::ExternalPage)
+ if (node->type() == Node::Document) {
+ if (static_cast<const DocNode *>(node)->subType() == Node::ExternalPage)
return node->name();
- if (static_cast<const FakeNode *>(node)->subType() == Node::Image)
+ if (static_cast<const DocNode *>(node)->subType() == Node::Image)
return node->name();
}
return Generator::fileName(node);
ref += QLatin1Char('-') + QString::number(func->overloadNumber());
}
break;
- case Node::Fake:
+ case Node::Document:
if (node->subType() != Node::QmlPropertyGroup)
break;
case Node::QmlProperty:
if (!serviceName.isEmpty())
serviceClasses.insert(serviceName, *c);
}
- else if ((*c)->type() == Node::Fake &&
+ else if ((*c)->type() == Node::Document &&
(*c)->subType() == Node::QmlClass &&
!(*c)->doc().isEmpty()) {
QString qmlClassName = (*c)->name();
case Node::Namespace:
case Node::Class:
return 2;
- case Node::Fake:
+ case Node::Document:
return 1;
case Node::Enum:
case Node::Typedef:
node = relative;
}
else if (target.endsWith(".html")) {
- node = tree_->root()->findChildNodeByNameAndType(target, Node::Fake);
+ node = tree_->root()->findChildNodeByNameAndType(target, Node::Document);
}
else if (marker) {
node = marker->resolveTarget(target, tree_, relative);
if (!node) {
- node = tree_->findFakeNodeByTitle(target, relative);
+ node = tree_->findDocNodeByTitle(target, relative);
}
if (!node && atom) {
node = tree_->findUnambiguousTarget(target, *const_cast<Atom**>(&atom), relative);
QPair<QString,QString> anchorPair;
anchorPair.first = Generator::fileName(node);
- if (node->type() == Node::Fake) {
- const FakeNode *fakeNode = static_cast<const FakeNode*>(node);
- anchorPair.second = fakeNode->title();
+ if (node->type() == Node::Document) {
+ const DocNode *docNode = static_cast<const DocNode*>(node);
+ anchorPair.second = docNode->title();
}
return anchorPair;
node, which must be a direct child of the tree
root.
*/
- *node = tree_->root()->findChildNodeByNameAndType(first, Node::Fake);
+ *node = tree_->root()->findChildNodeByNameAndType(first, Node::Document);
}
else {
*node = marker->resolveTarget(first, tree_, relative);
if (!*node) {
- *node = tree_->findFakeNodeByTitle(first, relative);
+ *node = tree_->findDocNodeByTitle(first, relative);
}
if (!*node) {
*node = tree_->findUnambiguousTarget(first, targetAtom, relative);
if (relative->parent() != *node) {
if (relative->status() != Node::Obsolete) {
bool porting = false;
- if (relative->type() == Node::Fake) {
- const FakeNode* fake = static_cast<const FakeNode*>(relative);
- if (fake->title().startsWith("Porting"))
+ if (relative->type() == Node::Document) {
+ const DocNode* dn = static_cast<const DocNode*>(relative);
+ if (dn->title().startsWith("Porting"))
porting = true;
}
QString name = marker->plainFullName(relative);
<< "We strongly advise against "
<< "using it in new code. See ";
- const FakeNode *fakeNode = tree_->findFakeNodeByTitle("Porting To Qt 4");
+ const DocNode *docNode = tree_->findDocNodeByTitle("Porting To Qt 4");
Atom *targetAtom = 0;
- if (fakeNode && node->type() == Node::Class) {
+ if (docNode && node->type() == Node::Class) {
QString oldName(node->name());
oldName.remove(QLatin1Char('3'));
targetAtom = tree_->findTarget(oldName,
- fakeNode);
+ docNode);
}
if (targetAtom) {
- text << Atom(Atom::Link, linkForNode(fakeNode, node) + QLatin1Char('#') +
- refForAtom(targetAtom, fakeNode));
+ text << Atom(Atom::Link, linkForNode(docNode, node) + QLatin1Char('#') +
+ refForAtom(targetAtom, docNode));
}
else
text << Atom(Atom::Link, "Porting to Qt 4");
{
if (!qcn)
return;
- const FakeNode* base = qcn->qmlBase();
+ const DocNode* base = qcn->qmlBase();
if (base) {
Text text;
text << Atom::ParaLeft << "Inherits ";
break;
case Node::Class:
break;
- case Node::Fake:
+ case Node::Document:
switch (child->subType()) {
case Node::Example:
break;
xmlWriter().writeStartElement("topicref");
xmlWriter().writeAttribute("navtitle",t->navtitle());
if (t->href().isEmpty()) {
- const FakeNode* fn = tree_->findFakeNodeByTitle(t->navtitle());
+ const DocNode* fn = tree_->findDocNodeByTitle(t->navtitle());
if (fn)
xmlWriter().writeAttribute("href",fileName(fn));
}
const Node *relative,
CodeMarker *marker);
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
- virtual void generateFakeNode(FakeNode* fake, CodeMarker* marker);
+ virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
virtual QString fileExtension() const;
virtual QString refForNode(const Node *node);
virtual QString linkForNode(const Node *node, const Node *relative);
return "namespace";
case Class:
return "class";
- case Fake:
- return "fake";
+ case Document:
+ return "document";
case Enum:
return "enum";
case Typedef:
/*!
Returns this node's subtype as a string for use as an
attribute value in XML or HTML. This is only useful
- in the case where the node type is Fake.
+ in the case where the node type is Document.
*/
QString Node::nodeSubtypeString() const
{
/*!
Returns the node subtype \a t as a string for use as an
attribute value in XML or HTML. This is only useful
- in the case where the node type is Fake.
+ in the case where the node type is Document.
*/
QString Node::nodeSubtypeString(unsigned t)
{
Node *node = childMap.value(name);
if (node && node->subType() != QmlPropertyGroup)
return node;
- if ((type() == Fake) && (subType() == QmlClass)) {
+ if ((type() == Document) && (subType() == QmlClass)) {
for (int i=0; i<children.size(); ++i) {
Node* n = children.at(i);
if (n->subType() == QmlPropertyGroup) {
found, append it to the output list and return immediately.
*/
if (nodes.isEmpty()) {
- if ((type() == Fake) && (subType() == QmlClass)) {
+ if ((type() == Document) && (subType() == QmlClass)) {
for (int i=0; i<children.size(); ++i) {
node = children.at(i);
if (node->subType() == QmlPropertyGroup) {
return node;
}
}
- if (qml && (type() == Fake) && (subType() == QmlClass)) {
+ if (qml && (type() == Document) && (subType() == QmlClass)) {
for (int i=0; i<children.size(); ++i) {
Node* node = children.at(i);
if (node->subType() == QmlPropertyGroup) {
return result;
}
-QMap<QString, FakeNode*> FakeNode::qmlModuleMap_;
+QMap<QString, DocNode*> DocNode::qmlModuleMap_;
/*!
- \class FakeNode
+ \class DocNode
*/
/*!
- The type of a FakeNode is Fake, and it has a \a subtype,
- which specifies the type of FakeNode. The page type for
+ The type of a DocNode is Document, and it has a \a subtype,
+ which specifies the type of DocNode. The page type for
the page index is set here.
*/
-FakeNode::FakeNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
- : InnerNode(Fake, parent, name), nodeSubtype_(subtype)
+DocNode::DocNode(InnerNode* parent, const QString& name, SubType subtype, Node::PageType ptype)
+ : InnerNode(Document, parent, name), nodeSubtype_(subtype)
{
switch (subtype) {
case Page:
}
/*!
- Returns the fake node's title. This is used for the page title.
+ Returns the document node's title. This is used for the page title.
*/
-QString FakeNode::title() const
+QString DocNode::title() const
{
return title_;
}
/*!
- Returns the fake node's full title, which is usually
+ Returns the document node's full title, which is usually
just title(), but for some SubType values is different
from title()
*/
-QString FakeNode::fullTitle() const
+QString DocNode::fullTitle() const
{
if (nodeSubtype_ == File) {
if (title().isEmpty())
/*!
Returns the subtitle.
*/
-QString FakeNode::subTitle() const
+QString DocNode::subTitle() const
{
if (!subtitle_.isEmpty())
return subtitle_;
If the QML module map does not contain the module identifier
\a qmid, insert the QML module node \a fn mapped to \a qmid.
*/
-void FakeNode::insertQmlModuleNode(const QString& qmid, FakeNode* fn)
+void DocNode::insertQmlModuleNode(const QString& qmid, DocNode* fn)
{
if (!qmlModuleMap_.contains(qmid))
qmlModuleMap_.insert(qmid,fn);
}
/*!
- Returns a pointer to the QML module node (FakeNode) that is
+ Returns a pointer to the QML module node (DocNode) that is
mapped to the QML module identifier constructed from \a arg.
If that QML module node does not yet exist, it is constructed
and inserted into the QML module map mapped to the QML module
identifier constructed from \a arg.
*/
-FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg)
+DocNode* DocNode::lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg)
{
QStringList dotSplit;
QStringList blankSplit = arg.first.split(QLatin1Char(' '));
dotSplit = blankSplit[1].split(QLatin1Char('.'));
qmid += dotSplit[0];
}
- FakeNode* fn = 0;
+ DocNode* fn = 0;
if (qmlModuleMap_.contains(qmid))
fn = qmlModuleMap_.value(qmid);
if (!fn) {
- fn = new FakeNode(tree->root(), arg.first, Node::QmlModule, Node::OverviewPage);
+ fn = new DocNode(tree->root(), arg.first, Node::QmlModule, Node::OverviewPage);
fn->setQmlModule(arg);
insertQmlModuleNode(qmid,fn);
}
Returns true if this QML type or property group contains a
property named \a name.
*/
-bool FakeNode::hasProperty(const QString& name) const
+bool DocNode::hasProperty(const QString& name) const
{
foreach (Node* child, childNodes()) {
- if (child->type() == Node::Fake && child->subType() == Node::QmlPropertyGroup) {
+ if (child->type() == Node::Document && child->subType() == Node::QmlPropertyGroup) {
if (child->hasProperty(name))
return true;
}
}
/*!
- The constructor calls the FakeNode constructor with
+ The constructor calls the DocNode constructor with
\a parent, \a name, and Node::Example.
*/
ExampleNode::ExampleNode(InnerNode* parent, const QString& name)
- : FakeNode(parent, name, Node::Example, Node::ExamplePage)
+ : DocNode(parent, name, Node::Example, Node::ExamplePage)
{
// nothing
}
QMap<QString, QmlClassNode*> QmlClassNode::qmlModuleMemberMap_;
/*!
- Constructs a Qml class node (i.e. a Fake node with the
+ Constructs a Qml class node (i.e. a Document node with the
subtype QmlClass. The new node has the given \a parent
and \a name.
*/
QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
- : FakeNode(parent, name, QmlClass, Node::ApiPage),
+ : DocNode(parent, name, QmlClass, Node::ApiPage),
abstract_(false),
cnodeRequired_(false),
cnode_(0),
QStringList strList = linkPair.first.split("::");
Node* n = tree->findQmlClassNode(strList);
if (n) {
- base_ = static_cast<FakeNode*>(n);
+ base_ = static_cast<DocNode*>(n);
if (base_ && base_->subType() == Node::QmlClass) {
return;
}
QString qmid = importList_.at(i).first + importList_.at(i).second;
for (int j=0; j<children.size(); ++j) {
if (qmid == children.at(j)->qmlModuleIdentifier()) {
- base_ = static_cast<FakeNode*>(children.at(j));
+ base_ = static_cast<DocNode*>(children.at(j));
return;
}
}
}
/*!
- Constructs a Qml basic type node (i.e. a Fake node with
+ Constructs a Qml basic type node (i.e. a Document node with
the subtype QmlBasicType. The new node has the given
\a parent and \a name.
*/
QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
const QString& name)
- : FakeNode(parent, name, QmlBasicType, Node::ApiPage)
+ : DocNode(parent, name, QmlBasicType, Node::ApiPage)
{
setTitle(name);
}
always a QmlClassNode.
*/
QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name)
- : FakeNode(parent, name, QmlPropertyGroup, Node::ApiPage)
+ : DocNode(parent, name, QmlPropertyGroup, Node::ApiPage)
{
idNumber_ = -1;
}
this node's parent.
*/
NameCollisionNode::NameCollisionNode(InnerNode* child)
- : FakeNode(child->parent(), child->name(), Collision, Node::NoPageType)
+ : DocNode(child->parent(), child->name(), Collision, Node::NoPageType)
{
setTitle("Name Collision: " + child->name());
addCollision(child);
const NodeList& cn = childNodes();
NodeList::ConstIterator i = cn.constBegin();
while (i != cn.constEnd()) {
- if ((*i)->type() == Node::Fake && (*i)->subType() == Node::QmlClass) {
+ if ((*i)->type() == Node::Document && (*i)->subType() == Node::QmlClass) {
if (origin->qmlModuleIdentifier() == (*i)->qmlModuleIdentifier())
return (*i);
}
do {
if (!n->name().isEmpty() &&
- ((n->type() != Node::Fake) || (n->subType() != Node::QmlPropertyGroup)))
+ ((n->type() != Node::Document) || (n->subType() != Node::QmlPropertyGroup)))
pieces.insert(0, n->name());
- if ((n->type() == Node::Fake) && (n->subType() != Node::QmlPropertyGroup)) {
+ if ((n->type() == Node::Document) && (n->subType() != Node::QmlPropertyGroup)) {
if ((n->subType() == Node::QmlClass) && !n->qmlModuleName().isEmpty())
pieces.insert(0, n->qmlModuleIdentifier());
break;
// Create a name based on the type of the ancestor node.
QString concatenator = "::";
- if ((n->type() == Node::Fake) && (n->subType() != Node::QmlClass))
+ if ((n->type() == Node::Document) && (n->subType() != Node::QmlClass))
concatenator = QLatin1Char('#');
return pieces.join(concatenator);
str = "class-member-" + func->name();
else if (parent_->type() == Namespace)
str = "namespace-member-" + func->name();
- else if (parent_->type() == Fake) {
+ else if (parent_->type() == Document) {
if (parent_->subType() == QmlClass)
str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
else
str += QLatin1Char('-') + QString::number(func->overloadNumber());
}
break;
- case Node::Fake:
+ case Node::Document:
{
switch (subType()) {
case Node::QmlClass:
enum Type {
Namespace,
Class,
- Fake,
+ Document,
Enum,
Typedef,
Function,
QmlClassNode* qmlelement;
};
-class FakeNode : public InnerNode
+class DocNode : public InnerNode
{
public:
- FakeNode(InnerNode* parent,
+ DocNode(InnerNode* parent,
const QString& name,
SubType subType,
PageType ptype);
- virtual ~FakeNode() { }
+ virtual ~DocNode() { }
void setTitle(const QString &title) { title_ = title; }
void setSubTitle(const QString &subTitle) { subtitle_ = subTitle; }
virtual bool isQmlPropertyGroup() const { return (nodeSubtype_ == QmlPropertyGroup); }
virtual bool hasProperty(const QString& ) const;
- static void insertQmlModuleNode(const QString& qmid, FakeNode* fn);
- static FakeNode* lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg);
+ static void insertQmlModuleNode(const QString& qmid, DocNode* fn);
+ static DocNode* lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg);
protected:
SubType nodeSubtype_;
QString subtitle_;
NodeList nodeList; // used for groups and QML modules.
- static QMap<QString, FakeNode*> qmlModuleMap_;
+ static QMap<QString, DocNode*> qmlModuleMap_;
};
-class NameCollisionNode : public FakeNode
+class NameCollisionNode : public DocNode
{
public:
NameCollisionNode(InnerNode* child);
QMap<QString,QString> targets;
};
-class ExampleNode : public FakeNode
+class ExampleNode : public DocNode
{
public:
ExampleNode(InnerNode* parent, const QString& name);
QString imageFileName_;
};
-class QmlClassNode : public FakeNode
+class QmlClassNode : public DocNode
{
public:
QmlClassNode(InnerNode* parent, const QString& name);
virtual void setImportList(const ImportList& il) { importList_ = il; }
virtual bool isAbstract() const { return abstract_; }
virtual void setAbstract(bool b) { abstract_ = b; }
- const FakeNode* qmlBase() const { return base_; }
+ const DocNode* qmlBase() const { return base_; }
void resolveInheritance(Tree* tree);
void requireCppClass() { cnodeRequired_ = true; }
bool cppClassRequired() const { return cnodeRequired_; }
bool abstract_;
bool cnodeRequired_;
ClassNode* cnode_;
- FakeNode* base_;
+ DocNode* base_;
ImportList importList_;
};
-class QmlBasicTypeNode : public FakeNode
+class QmlBasicTypeNode : public DocNode
{
public:
QmlBasicTypeNode(InnerNode* parent,
virtual bool isQmlNode() const { return true; }
};
-class QmlPropGroupNode : public FakeNode
+class QmlPropGroupNode : public DocNode
{
public:
QmlPropGroupNode(QmlClassNode* parent, const QString& name);
// nothing.
}
-class DitaMapNode : public FakeNode
+class DitaMapNode : public DocNode
{
public:
DitaMapNode(InnerNode* parent, const QString& name)
- : FakeNode(parent, name, Node::Page, Node::DitaMapPage) { }
+ : DocNode(parent, name, Node::Page, Node::DitaMapPage) { }
virtual ~DitaMapNode() { }
const DitaRefList& map() const { return doc().ditamap(); }
QString command = *i;
args = doc.metaCommandArgs(command);
if (command == COMMAND_QMLABSTRACT) {
- if ((node->type() == Node::Fake) && (node->subType() == Node::QmlClass)) {
+ if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) {
node->setAbstract(true);
}
}
}
else if (command == COMMAND_INQMLMODULE) {
node->setQmlModule(args[0]);
- FakeNode* fn = FakeNode::lookupQmlModuleNode(tree, args[0]);
- fn->addQmlModuleMember(node);
+ DocNode* dn = DocNode::lookupQmlModuleNode(tree, args[0]);
+ dn->addQmlModuleMember(node);
QString qmid = node->qmlModuleIdentifier();
QmlClassNode* qcn = static_cast<QmlClassNode*>(node);
QmlClassNode::insertQmlModuleMember(qmid, qcn);
switch (member->type) {
case QQmlJS::AST::UiPublicMember::Signal:
{
- if (current->type() == Node::Fake) {
+ if (current->type() == Node::Document) {
QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
if (qmlClass) {
{
QString type = member->memberType.toString();
QString name = member->name.toString();
- if (current->type() == Node::Fake) {
+ if (current->type() == Node::Document) {
QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
if (qmlClass) {
QString name = member->name.toString();
{
if (nestingLevel > 1)
return true;
- if (current->type() == Node::Fake) {
+ if (current->type() == Node::Document) {
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
if (qmlClass) {
QString name = fd->name.toString();
{
if (nestingLevel > 1)
return true;
- if (current->type() == Node::Fake) {
+ if (current->type() == Node::Document) {
QString handler = sb->qualifiedId->name.toString();
if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
typedef QMap<PropertyNode::FunctionRole, QString> RoleMap;
typedef QMap<PropertyNode*, RoleMap> PropertyMap;
-typedef QMultiHash<QString, FakeNode*> FakeNodeHash;
+typedef QMultiHash<QString, DocNode*> DocNodeHash;
typedef QMultiHash<QString, Target> TargetHash;
class TreePrivate
PropertyMap unresolvedPropertyMap;
NodeMultiMap groupMap;
QMultiMap<QString, QString> publicGroupMap;
- FakeNodeHash fakeNodesByTitle;
+ DocNodeHash docNodesByTitle;
TargetHash targetHash;
QList<QPair<ClassNode*,QString> > basesList;
QList<QPair<FunctionNode*,QString> > relatedList;
break;
const Node* next = static_cast<const InnerNode*>(node)->findChildNodeByName(path.at(i), qml);
-
if (!next && (findFlags & SearchEnumValues) && i == path.size()-1)
next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i));
/*!
Find the QML class node for the specified \a module and \a name
identifiers. The \a module identifier may be empty. If the module
- identifier is empty, then begin by finding the FakeNode that has
- the specified \a name. If that FakeNode is a QML class, return it.
+ identifier is empty, then begin by finding the DocNode that has
+ the specified \a name. If that DocNode is a QML class, return it.
If it is a collision node, return its current child, if the current
child is a QML class. If the collision node does not have a child
that is a QML class node, return 0.
else if (n->subType() == Node::Collision) {
NameCollisionNode* ncn;
ncn = static_cast<NameCollisionNode*>(n);
- return static_cast<QmlClassNode*>(ncn->findAny(Node::Fake,Node::QmlClass));
+ return static_cast<QmlClassNode*>(ncn->findAny(Node::Document,Node::QmlClass));
}
}
return 0;
If \a relative node is provided, it is used to disambiguate if
it has a QML module identifier.
*/
-const FakeNode* Tree::findFakeNodeByTitle(const QString& title, const Node* relative ) const
+const DocNode* Tree::findDocNodeByTitle(const QString& title, const Node* relative ) const
{
for (int pass = 0; pass < NumSuffixes; ++pass) {
- FakeNodeHash::const_iterator i = priv->fakeNodesByTitle.constFind(Doc::canonicalTitle(title + suffixes[pass]));
- if (i != priv->fakeNodesByTitle.constEnd()) {
+ DocNodeHash::const_iterator i = priv->docNodesByTitle.constFind(Doc::canonicalTitle(title + suffixes[pass]));
+ if (i != priv->docNodesByTitle.constEnd()) {
if (relative && !relative->qmlModuleIdentifier().isEmpty()) {
- const FakeNode* fn = i.value();
- InnerNode* parent = fn->parent();
- if (parent && parent->type() == Node::Fake && parent->subType() == Node::Collision) {
+ const DocNode* dn = i.value();
+ InnerNode* parent = dn->parent();
+ if (parent && parent->type() == Node::Document && parent->subType() == Node::Collision) {
const NodeList& nl = parent->childNodes();
NodeList::ConstIterator it = nl.constBegin();
while (it != nl.constEnd()) {
because of the QML module identifier being used as a
namespace qualifier.
*/
- fn = static_cast<const FakeNode*>(*it);
- return fn;
+ dn = static_cast<const DocNode*>(*it);
+ return dn;
}
++it;
}
overkill. We should report the duplicate file and let
that suffice.
*/
- FakeNodeHash::const_iterator j = i;
+ DocNodeHash::const_iterator j = i;
++j;
- if (j != priv->fakeNodesByTitle.constEnd() && j.key() == i.key()) {
+ if (j != priv->docNodesByTitle.constEnd() && j.key() == i.key()) {
QList<Location> internalLocations;
- while (j != priv->fakeNodesByTitle.constEnd()) {
+ while (j != priv->docNodesByTitle.constEnd()) {
if (j.key() == i.key() && j.value()->url().isEmpty())
internalLocations.append(j.value()->location());
++j;
// need recursion
foreach (Node* child, root->childNodes()) {
- if (child->type() == Node::Fake) {
- FakeNode* node = static_cast<FakeNode*>(child);
+ if (child->type() == Node::Document) {
+ DocNode* node = static_cast<DocNode*>(child);
if (!node->title().isEmpty())
- priv->fakeNodesByTitle.insert(Doc::canonicalTitle(node->title()), node);
+ priv->docNodesByTitle.insert(Doc::canonicalTitle(node->title()), node);
if (node->subType() == Node::Collision) {
resolveTargets(node);
}
{
foreach (Node* child, roo.childNodes()) {
- if (child->type() == Node::Fake && child->subType() == Node::QmlClass) {
+ if (child->type() == Node::Document && child->subType() == Node::QmlClass) {
QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
ClassNode* cn = const_cast<ClassNode*>(qcn->classNode());
if (cn)
{
foreach (Node* child, roo.childNodes()) {
- if (child->type() == Node::Fake) {
+ if (child->type() == Node::Document) {
if (child->subType() == Node::QmlClass) {
QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
qcn->resolveInheritance(this);
else if (child->subType() == Node::Collision) {
NameCollisionNode* ncn = static_cast<NameCollisionNode*>(child);
foreach (Node* child, ncn->childNodes()) {
- if (child->type() == Node::Fake) {
+ if (child->type() == Node::Document) {
if (child->subType() == Node::QmlClass) {
QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
qcn->resolveInheritance(this);
else
return;
- FakeNode* fakeNode = new FakeNode(parent, name, subtype, ptype);
- fakeNode->setTitle(element.attribute("title"));
+ DocNode* docNode = new DocNode(parent, name, subtype, ptype);
+ docNode->setTitle(element.attribute("title"));
if (element.hasAttribute("location"))
name = element.attribute("location", "");
else if (!indexUrl.isNull())
location = Location(name);
- section = fakeNode;
+ section = docNode;
}
else if (element.nodeName() == "enum") {
case Node::Class:
nodeName = "class";
break;
- case Node::Fake:
+ case Node::Document:
nodeName = "page";
if (node->subType() == Node::QmlClass)
nodeName = "qmlclass";
QXmlStreamAttributes attributes;
writer.writeAttribute("access", access);
- if (node->type() != Node::Fake) {
+ if (node->type() != Node::Document) {
QString threadSafety;
switch (node->threadSafeness()) {
case Node::NonReentrant:
href.append(QLatin1Char('/'));
href.append(gen_->fullDocumentLocation(node));
writer.writeAttribute("href", href);
- if ((node->type() != Node::Fake) && (!node->isQmlNode()))
+ if ((node->type() != Node::Document) && (!node->isQmlNode()))
writer.writeAttribute("location", node->location().fileName());
switch (node->type()) {
writer.writeAttribute("module", node->moduleName());
break;
- case Node::Fake:
+ case Node::Document:
{
/*
- Fake nodes (such as manual pages) contain subtypes,
+ Document nodes (such as manual pages) contain subtypes,
titles and other attributes.
*/
- const FakeNode* fakeNode = static_cast<const FakeNode*>(node);
- switch (fakeNode->subType()) {
+ const DocNode* docNode = static_cast<const DocNode*>(node);
+ switch (docNode->subType()) {
case Node::Example:
writer.writeAttribute("subtype", "example");
break;
default:
break;
}
- writer.writeAttribute("title", fakeNode->title());
- writer.writeAttribute("fulltitle", fakeNode->fullTitle());
- writer.writeAttribute("subtitle", fakeNode->subTitle());
- writer.writeAttribute("location", fakeNode->doc().location().fileName());
+ writer.writeAttribute("title", docNode->title());
+ writer.writeAttribute("fulltitle", docNode->fullTitle());
+ writer.writeAttribute("subtitle", docNode->subTitle());
+ writer.writeAttribute("location", docNode->doc().location().fileName());
}
break;
if (inner->doc().hasTargets()) {
bool external = false;
- if (inner->type() == Node::Fake) {
- const FakeNode* fakeNode = static_cast<const FakeNode*>(inner);
- if (fakeNode->subType() == Node::ExternalPage)
+ if (inner->type() == Node::Document) {
+ const DocNode* docNode = static_cast<const DocNode*>(inner);
+ if (docNode->subType() == Node::ExternalPage)
external = true;
}
return false;
}
- if (n1->type() == Node::Fake && n2->type() == Node::Fake) {
- const FakeNode* f1 = static_cast<const FakeNode*>(n1);
- const FakeNode* f2 = static_cast<const FakeNode*>(n2);
+ if (n1->type() == Node::Document && n2->type() == Node::Document) {
+ const DocNode* f1 = static_cast<const DocNode*>(n1);
+ const DocNode* f2 = static_cast<const DocNode*>(n2);
if (f1->fullTitle() < f2->fullTitle())
return true;
else if (f1->fullTitle() > f2->fullTitle())
*/
void Tree::addExternalLink(const QString& url, const Node* relative)
{
- FakeNode* fakeNode = new FakeNode(root(), url, Node::ExternalPage, Node::ArticlePage);
- fakeNode->setAccess(Node::Public);
+ DocNode* docNode = new DocNode(root(), url, Node::ExternalPage, Node::ArticlePage);
+ docNode->setAccess(Node::Public);
// Create some content for the node.
QSet<QString> emptySet;
Location location(relative->doc().location());
Doc doc(location, location, " ", emptySet); // placeholder
- fakeNode->setDoc(doc);
+ docNode->setDoc(doc);
}
/*!
the specified \a type and \a subtype. Begin the search at
the \a start node. If the \a start node is 0, begin the
search at the tree root. \a subtype is not used unless
- \a type is \c{Fake}.
+ \a type is \c{Document}.
*/
Node* Tree::findNodeByNameAndType(const QStringList& path,
Node::Type type,
If the end of the path is reached (i.e. if a matching
node is found for each name in the \a path), the \a type
must match the type of the last matching node, and if the
- type is \e{Fake}, the \a subtype must match as well.
+ type is \e{Document}, the \a subtype must match as well.
If the algorithm is successful, the pointer to the final
node is returned. Otherwise 0 is returned.
else if (n->name() == name) {
if (pathIndex+1 >= path.size()) {
if (n->type() == type) {
- if (type == Node::Fake) {
+ if (type == Node::Document) {
if (n->subType() == subtype)
return n;
else if (n->subType() == Node::Collision && acceptCollision)
if (!start)
start = const_cast<NamespaceNode*>(root());
- return static_cast<QmlClassNode*>(findNodeRecursive(path, 0, start, Node::Fake, Node::QmlClass));
+ return static_cast<QmlClassNode*>(findNodeRecursive(path, 0, start, Node::Document, Node::QmlClass));
}
/*!
at the root of the tree. Only a Group node named \a path is
acceptible. If one is not found, 0 is returned.
*/
-FakeNode* Tree::findGroupNode(const QStringList& path, Node* start)
+DocNode* Tree::findGroupNode(const QStringList& path, Node* start)
{
if (!start)
start = const_cast<NamespaceNode*>(root());
- return static_cast<FakeNode*>(findNodeRecursive(path, 0, start, Node::Fake, Node::Group));
+ return static_cast<DocNode*>(findNodeRecursive(path, 0, start, Node::Document, Node::Group));
}
/*!
at the root of the tree. Only a Qml module node named \a path is
acceptible. If one is not found, 0 is returned.
*/
-FakeNode* Tree::findQmlModuleNode(const QStringList& path, Node* start)
+DocNode* Tree::findQmlModuleNode(const QStringList& path, Node* start)
{
if (!start)
start = const_cast<NamespaceNode*>(root());
- return static_cast<FakeNode*>(findNodeRecursive(path, 0, start, Node::Fake, Node::QmlModule));
+ return static_cast<DocNode*>(findNodeRecursive(path, 0, start, Node::Document, Node::QmlModule));
}
QT_END_NAMESPACE
ClassNode* findClassNode(const QStringList& path, Node* start = 0);
QmlClassNode* findQmlClassNode(const QStringList& path, Node* start = 0);
NamespaceNode* findNamespaceNode(const QStringList& path, Node* start = 0);
- FakeNode* findGroupNode(const QStringList& path, Node* start = 0);
- FakeNode* findQmlModuleNode(const QStringList& path, Node* start = 0);
+ DocNode* findGroupNode(const QStringList& path, Node* start = 0);
+ DocNode* findQmlModuleNode(const QStringList& path, Node* start = 0);
Node* findNodeByNameAndType(const QStringList& path,
Node::Type type,
const FunctionNode *clone,
const Node *relative = 0,
int findFlags = 0) const;
- const FakeNode *findFakeNodeByTitle(const QString &title, const Node* relative = 0) const;
+ const DocNode *findDocNodeByTitle(const QString &title, const Node* relative = 0) const;
const Node *findUnambiguousTarget(const QString &target, Atom *&atom, const Node* relative) const;
Atom *findTarget(const QString &target, const Node *node) const;
const NamespaceNode *root() const { return &roo; }