Skip to main content

The EclipseHelp Class Reference

Generator for Eclipse help files. More...

Declaration

class EclipseHelp { ... }

Included Headers

#include <src/eclipsehelp.h>

Base class

classIndexIntf

Abstract interface for index generators. More...

Public Constructors Index

EclipseHelp ()

Public Destructor Index

~EclipseHelp ()

Public Member Functions Index

voidinitialize ()

Initialize the Eclipse generator. More...

voidfinalize ()

Finish generation of the Eclipse specific help files. More...

voidincContentsDepth ()

Increase the level of content hierarchy. More...

voiddecContentsDepth ()

Decrease the level of content hierarchy. More...

voidaddContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const QCString &nameAsHtml)

Add an item to the content. More...

voidaddIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor, const QCString &title)
voidaddIndexFile (const QCString &name)
voidaddImageFile (const QCString &name)
voidaddStyleSheetFile (const QCString &name)

Private Member Attributes Index

std::unique_ptr< Private >p

Description

Generator for Eclipse help files.

This class generates the Eclipse specific help files. These files can be used to generate a help plugin readable by the Eclipse IDE.

Definition at line 43 of file eclipsehelp.h.

Public Constructors

EclipseHelp()

EclipseHelp::EclipseHelp ()

Declaration at line 46 of file eclipsehelp.h, definition at line 59 of file eclipsehelp.cpp.

59EclipseHelp::EclipseHelp() : p(std::make_unique<Private>()) {}

Reference p.

Referenced by ~EclipseHelp.

Public Destructor

~EclipseHelp()

EclipseHelp::~EclipseHelp ()
virtual

Definition at line 47 of file eclipsehelp.h.

Reference EclipseHelp.

Public Member Functions

addContentsItem()

void EclipseHelp::addContentsItem (bool isDir, const QCString & name, const QCString & ref, const QCString & file, const QCString & anchor, bool separateIndex, bool addToNavIndex, const Definition * def, const QCString & nameAsHtml)
virtual

Add an item to the content.

Parameters
isDir

Flag whether the argument file is a directory or a file entry

name

Name of the item

ref

URL of the item

file

Name of a file which the item is defined in (without extension)

anchor

Name of an anchor of the item.

separateIndex

not used.

addToNavIndex

not used.

def

not used.

nameAsHtml

name parameter in HTML format

Declaration at line 55 of file eclipsehelp.h, definition at line 162 of file eclipsehelp.cpp.

163 bool /* isDir */,
164 const QCString &name,
165 const QCString & /* ref */,
166 const QCString &file,
167 const QCString &anchor,
168 bool /* separateIndex */,
169 bool /* addToNavIndex */,
170 const Definition * /*def*/,
171 const QCString & /* nameAsHtml */)
172{
173 // -- write the topic tag
174 p->closedTag();
175 if (!file.isEmpty())
176 {
177 QCString fn = file;
179 switch (file[0]) // check for special markers (user defined URLs)
180 {
181 case '^':
182 // URL not supported by eclipse toc.xml
183 break;
184
185 case '!':
186 p->indent();
187 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
188 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << &file[1] << "\"";
189 p->endtag = TRUE;
190 break;
191
192 default:
193 p->indent();
194 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
195 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << fn;
196 if (!anchor.isEmpty())
197 {
198 p->tocstream << "#" << anchor;
199 }
200 p->tocstream << "\"";
201 p->endtag = TRUE;
202 break;
203 }
204 }
205 else
206 {
207 p->indent();
208 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
209 p->endtag = TRUE;
210 }
211}

References addHtmlExtensionIfMissing, convertToXML, QCString::isEmpty, p and TRUE.

addImageFile()

void EclipseHelp::addImageFile (const QCString & name)
virtual

Declaration at line 61 of file eclipsehelp.h, definition at line 225 of file eclipsehelp.cpp.

225void EclipseHelp::addImageFile(const QCString & /* name */)
226{
227}

addIndexFile()

void EclipseHelp::addIndexFile (const QCString & name)
virtual

Declaration at line 60 of file eclipsehelp.h, definition at line 221 of file eclipsehelp.cpp.

221void EclipseHelp::addIndexFile(const QCString & /* name */)
222{
223}

addIndexItem()

void EclipseHelp::addIndexItem (const Definition * context, const MemberDef * md, const QCString & sectionAnchor, const QCString & title)
virtual

Declaration at line 58 of file eclipsehelp.h, definition at line 213 of file eclipsehelp.cpp.

214 const Definition * /* context */,
215 const MemberDef * /* md */,
216 const QCString & /* sectionAnchor */,
217 const QCString & /* title */)
218{
219}

addStyleSheetFile()

void EclipseHelp::addStyleSheetFile (const QCString & name)
virtual

Declaration at line 62 of file eclipsehelp.h, definition at line 229 of file eclipsehelp.cpp.

230{
231}

decContentsDepth()

void EclipseHelp::decContentsDepth ()
virtual

Decrease the level of content hierarchy.

It closes currently opened topic tag.

Declaration at line 54 of file eclipsehelp.h, definition at line 135 of file eclipsehelp.cpp.

136{
137 // -- end of the opened topic
138 p->closedTag();
139 --p->depth;
140
141 if (p->openTags==p->depth)
142 {
143 --p->openTags;
144 p->indent();
145 p->tocstream << "</topic>\n";
146 }
147}

Reference p.

finalize()

void EclipseHelp::finalize ()
virtual

Finish generation of the Eclipse specific help files.

This method writes footers of the files and closes them.

See Also

initialize()

Declaration at line 52 of file eclipsehelp.h, definition at line 96 of file eclipsehelp.cpp.

97{
98 p->closedTag(); // -- close previous tag
99
100 // -- write ending tag
101 --p->depth;
102 p->tocstream << "</toc>\n";
103
104 // -- close the content file
105 p->tocstream.close();
106
107 QCString name = Config_getString(HTML_OUTPUT) + "/plugin.xml";
108 std::ofstream t = Portable::openOutputStream(name);
109 if (t.is_open())
110 {
111 QCString docId = Config_getString(ECLIPSE_DOC_ID);
112 t << "<plugin name=\"" << docId << "\" id=\"" << docId << "\"\n";
113 t << " version=\"1.0.0\" provider-name=\"Doxygen\">\n";
114 t << " <extension point=\"org.eclipse.help.toc\">\n";
115 t << " <toc file=\"toc.xml\" primary=\"true\" />\n";
116 t << " </extension>\n";
117 t << "</plugin>\n";
118 }
119}

References Config_getString, Portable::openOutputStream and p.

incContentsDepth()

void EclipseHelp::incContentsDepth ()
virtual

Increase the level of content hierarchy.

Declaration at line 53 of file eclipsehelp.h, definition at line 124 of file eclipsehelp.cpp.

125{
126 p->openedTag();
127 ++p->depth;
128}

Reference p.

initialize()

void EclipseHelp::initialize ()
virtual

Initialize the Eclipse generator.

This method opens the XML TOC file and writes headers of the files.

See Also

finalize()

Declaration at line 51 of file eclipsehelp.h, definition at line 68 of file eclipsehelp.cpp.

69{
70 // -- open the contents file
71 QCString name = Config_getString(HTML_OUTPUT) + "/toc.xml";
72 p->tocstream = Portable::openOutputStream(name);
73 if (!p->tocstream.is_open())
74 {
75 term("Could not open file {} for writing\n", name);
76 }
77
78 // -- write the opening tag
79 QCString title = Config_getString(PROJECT_NAME);
80 if (title.isEmpty())
81 {
82 title = "Doxygen generated documentation";
83 }
84 p->tocstream << "<toc label=\"" << convertToXML(title)
85 << "\" topic=\"" << convertToXML(p->pathprefix)
86 << "index" << Doxygen::htmlFileExtension << "\">\n";
87 ++ p->depth;
88}

References Config_getString, convertToXML, Doxygen::htmlFileExtension, QCString::isEmpty, Portable::openOutputStream, p and term.

Private Member Attributes

p

std::unique_ptr<Private> EclipseHelp::p

Definition at line 66 of file eclipsehelp.h.

66 std::unique_ptr<Private> p;

Referenced by addContentsItem, decContentsDepth, EclipseHelp, finalize, incContentsDepth and initialize.


The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus by Doxygen 1.14.0.