6 #include "outputlist.h"
12 PageDef::PageDef(const char *f,int l,const char *n,
13 const char *d,const char *t)
14 : Definition(f,l,n), m_title(t)
16 setDocumentation(d,f,l);
17 m_subPageDict = new PageSDict(7);
28 void PageDef::findSectionsInDocumentation()
30 docFindSections(documentation(),this,0,docFile());
33 GroupDef *PageDef::getGroupDef() const
35 LockingPtr<GroupList> groups = partOfGroups();
36 return groups!=0 ? groups->getFirst() : 0;
39 QCString PageDef::getOutputFileBase() const
42 return getGroupDef()->getOutputFileBase();
47 void PageDef::addInnerCompound(Definition *def)
49 if (def->definitionType()==Definition::TypePage)
51 PageDef *pd = (PageDef*)def;
52 m_subPageDict->append(pd->name(),pd);
53 def->setOuterScope(this);
54 if (this==Doxygen::mainPage)
56 pd->setNestingLevel(m_nestingLevel);
60 pd->setNestingLevel(m_nestingLevel+1);
65 bool PageDef::hasParentPage() const
67 return getOuterScope() &&
68 getOuterScope()->definitionType()==Definition::TypePage;
71 void PageDef::writeDocumentation(OutputList &ol)
73 static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
75 //outputList->disable(OutputGenerator::Man);
77 pageName=escapeCharsInString(name(),FALSE,TRUE);
79 //printf("PageDef::writeDocumentation: %s\n",getOutputFileBase().data());
81 ol.pushGeneratorState();
86 //(Doxygen::mainPage==0 || getOuterScope()!=Doxygen::mainPage) // and not a subpage of the mainpage
89 // do not generate sub page output for RTF and LaTeX, as these are
90 // part of their parent page
92 ol.enable(OutputGenerator::Man);
93 ol.enable(OutputGenerator::Html);
96 startFile(ol,getOutputFileBase(),pageName,title(),HLI_Pages,!generateTreeView);
98 if (!generateTreeView)
100 if (getOuterScope()!=Doxygen::globalScope && !Config_getBool("DISABLE_INDEX"))
102 getOuterScope()->writeNavigationPath(ol);
104 ol.endQuickIndices();
106 SectionInfo *si=Doxygen::sectionDict.find(name());
108 // save old generator state and write title only to Man generator
109 ol.pushGeneratorState();
111 ol.disableAllBut(OutputGenerator::Man);
112 ol.startTitleHead(pageName);
113 ol.endTitleHead(pageName, pageName);
116 ol.parseDoc(docFile(),docLine(),this,0,si->title,TRUE,FALSE,0,TRUE,FALSE);
117 ol.endSection(si->label,si->type);
119 ol.popGeneratorState();
122 // for Latex the section is already generated as a chapter in the index!
123 ol.pushGeneratorState();
125 ol.disable(OutputGenerator::Latex);
126 ol.disable(OutputGenerator::RTF);
127 ol.disable(OutputGenerator::Man);
128 if (!title().isEmpty() && !name().isEmpty() && si!=0)
130 //ol.startSection(si->label,si->title,si->type);
131 startTitle(ol,getOutputFileBase(),this);
132 ol.parseDoc(docFile(),docLine(),this,0,si->title,TRUE,FALSE,0,TRUE,FALSE);
133 //stringToSearchIndex(getOutputFileBase(),
134 // theTranslator->trPage(TRUE,TRUE)+" "+si->title,
136 //ol.endSection(si->label,si->type);
137 endTitle(ol,getOutputFileBase(),name());
140 ol.popGeneratorState();
143 if (m_showToc && hasSections())
148 writePageDocumentation(ol);
150 if (generateTreeView && getOuterScope()!=Doxygen::globalScope && !Config_getBool("DISABLE_INDEX"))
153 endFileWithNavPath(getOuterScope(),ol);
160 ol.popGeneratorState();
163 if (!Config_getString("GENERATE_TAGFILE").isEmpty())
166 QDictIterator<RefList> rli(*Doxygen::xrefLists);
168 for (rli.toFirst();(rl=rli.current());++rli)
170 if (rl->listName()==name())
176 if (!found) // not one of the generated related pages
178 Doxygen::tagFile << " <compound kind=\"page\">" << endl;
179 Doxygen::tagFile << " <name>" << name() << "</name>" << endl;
180 Doxygen::tagFile << " <title>" << convertToXML(title()) << "</title>" << endl;
181 Doxygen::tagFile << " <filename>" << getOutputFileBase() << "</filename>" << endl;
182 writeDocAnchorsToTagFile();
183 Doxygen::tagFile << " </compound>" << endl;
187 Doxygen::indexList.addIndexItem(this,0,filterTitle(title()));
190 void PageDef::writePageDocumentation(OutputList &ol)
193 bool markdownEnabled = Doxygen::markdownSupport;
194 if (getLanguage()==SrcLangExt_Markdown)
196 Doxygen::markdownSupport = TRUE;
201 docFile(), // fileName
202 docLine(), // startLine
205 documentation()+inbodyDocumentation(), // docStr
207 FALSE // not an example
211 Doxygen::markdownSupport = markdownEnabled;
215 // for printed documentation we write subpages as section's of the
217 ol.pushGeneratorState();
219 ol.enable(OutputGenerator::Latex);
220 ol.enable(OutputGenerator::RTF);
222 PageSDict::Iterator pdi(*m_subPageDict);
223 PageDef *subPage=pdi.toFirst();
224 for (pdi.toFirst();(subPage=pdi.current());++pdi)
226 SectionInfo::SectionType sectionType = SectionInfo::Paragraph;
227 switch (m_nestingLevel)
229 case 0: sectionType = SectionInfo::Page; break;
230 case 1: sectionType = SectionInfo::Section; break;
231 case 2: sectionType = SectionInfo::Subsection; break;
232 case 3: sectionType = SectionInfo::Subsubsection; break;
233 default: sectionType = SectionInfo::Paragraph; break;
235 QCString title = subPage->title();
236 if (title.isEmpty()) title = subPage->name();
237 ol.startSection(subPage->name(),title,sectionType);
239 ol.endSection(subPage->name(),sectionType);
240 Doxygen::subpageNestingLevel++;
241 subPage->writePageDocumentation(ol);
242 Doxygen::subpageNestingLevel--;
245 ol.popGeneratorState();
249 bool PageDef::visibleInIndex() const
251 static bool allExternals = Config_getBool("ALLEXTERNALS");
252 return // not part of a group
254 // not an externally defined page
255 (!isReference() || allExternals)
258 //(getOuterScope()==0 ||
259 // getOuterScope()->definitionType()!=Definition::TypePage
264 bool PageDef::documentedPage() const
266 return // not part of a group
268 // not an externally defined page
272 bool PageDef::hasSubPages() const
274 return m_subPageDict->count()>0;
277 void PageDef::setNestingLevel(int l)
282 void PageDef::setShowToc(bool b)