Doxygen
Loading...
Searching...
No Matches
EclipseHelp Class Reference

Generator for Eclipse help files. More...

#include <src/eclipsehelp.h>

+ Inheritance diagram for EclipseHelp:
+ Collaboration diagram for EclipseHelp:

Classes

struct  Private
 

Public Member Functions

 EclipseHelp ()
 
virtual ~EclipseHelp ()
 
virtual void initialize ()
 Initialize the Eclipse generator.
 
virtual void finalize ()
 Finish generation of the Eclipse specific help files.
 
virtual void incContentsDepth ()
 Increase the level of content hierarchy.
 
virtual void decContentsDepth ()
 Decrease the level of content hierarchy.
 
virtual void addContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def)
 Add an item to the content.
 
virtual void addIndexItem (const Definition *context, const MemberDef *md, const QCString &sectionAnchor, const QCString &title)
 
virtual void addIndexFile (const QCString &name)
 
virtual void addImageFile (const QCString &name)
 
virtual void addStyleSheetFile (const QCString &name)
 
- Public Member Functions inherited from IndexIntf

Private Attributes

std::unique_ptr< Privatep
 

Detailed 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.

Constructor & Destructor Documentation

◆ EclipseHelp()

EclipseHelp::EclipseHelp ( )

Definition at line 59 of file eclipsehelp.cpp.

59: p(std::make_unique<Private>()) {}
std::unique_ptr< Private > p
Definition eclipsehelp.h:66

References p.

Referenced by ~EclipseHelp().

◆ ~EclipseHelp()

EclipseHelp::~EclipseHelp ( )
virtualdefault

References EclipseHelp().

Member Function Documentation

◆ 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 )
virtual

Add an item to the content.

Parameters
isDirFlag whether the argument file is a directory or a file entry
nameName of the item
refURL of the item
fileName of a file which the item is defined in (without extension)
anchorName of an anchor of the item.
separateIndexnot used.
addToNavIndexnot used.
defnot used.

Implements IndexIntf.

Definition at line 161 of file eclipsehelp.cpp.

170{
171 // -- write the topic tag
172 p->closedTag();
173 if (!file.isEmpty())
174 {
175 QCString fn = file;
177 switch (file[0]) // check for special markers (user defined URLs)
178 {
179 case '^':
180 // URL not supported by eclipse toc.xml
181 break;
182
183 case '!':
184 p->indent();
185 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
186 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << &file[1] << "\"";
187 p->endtag = TRUE;
188 break;
189
190 default:
191 p->indent();
192 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
193 p->tocstream << " href=\"" << convertToXML(p->pathprefix) << fn;
194 if (!anchor.isEmpty())
195 {
196 p->tocstream << "#" << anchor;
197 }
198 p->tocstream << "\"";
199 p->endtag = TRUE;
200 break;
201 }
202 }
203 else
204 {
205 p->indent();
206 p->tocstream << "<topic label=\"" << convertToXML(name) << "\"";
207 p->endtag = TRUE;
208 }
209}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#define TRUE
Definition qcstring.h:37
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4266
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

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

◆ addImageFile()

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

Implements IndexIntf.

Definition at line 223 of file eclipsehelp.cpp.

224{
225}

◆ addIndexFile()

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

Implements IndexIntf.

Definition at line 219 of file eclipsehelp.cpp.

220{
221}

◆ addIndexItem()

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

Implements IndexIntf.

Definition at line 211 of file eclipsehelp.cpp.

216{
217}

◆ addStyleSheetFile()

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

Implements IndexIntf.

Definition at line 227 of file eclipsehelp.cpp.

228{
229}

◆ decContentsDepth()

void EclipseHelp::decContentsDepth ( )
virtual

Decrease the level of content hierarchy.

It closes currently opened topic tag.

Implements IndexIntf.

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}

References 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()

Implements IndexIntf.

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}
#define Config_getString(name)
Definition config.h:32
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665

References Config_getString, Portable::openOutputStream(), and p.

◆ incContentsDepth()

void EclipseHelp::incContentsDepth ( )
virtual

Increase the level of content hierarchy.

Implements IndexIntf.

Definition at line 124 of file eclipsehelp.cpp.

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

References 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()

Implements IndexIntf.

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 %s for writing\n", qPrint(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}
static QCString htmlFileExtension
Definition doxygen.h:122
#define term(fmt,...)
Definition message.h:94
const char * qPrint(const char *s)
Definition qcstring.h:672

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

Member Data Documentation

◆ p

std::unique_ptr<Private> EclipseHelp::p
private

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