Doxygen
Loading...
Searching...
No Matches
HtmlHelp::Private Class Reference
Collaboration diagram for HtmlHelp::Private:

Public Member Functions

 Private ()
void createProjectFile ()

Public Attributes

std::ofstream cts
std::ofstream kts
DString prevFile
DString prevAnc
bool ctsItemPresent = false
int dc = 0
StringSet indexFiles
StringSet imageFiles
StringSet styleFiles
HtmlHelpRecoder recoder
HtmlHelpIndex index

Detailed Description

Definition at line 336 of file htmlhelp.cpp.

Constructor & Destructor Documentation

◆ Private()

HtmlHelp::Private::Private ( )
inline

Definition at line 339 of file htmlhelp.cpp.

339: index(recoder) {}
HtmlHelpRecoder recoder
Definition htmlhelp.cpp:349
HtmlHelpIndex index
Definition htmlhelp.cpp:350

References index, and recoder.

Member Function Documentation

◆ createProjectFile()

void HtmlHelp::Private::createProjectFile ( )

Definition at line 402 of file htmlhelp.cpp.

403{
404 /* Write the project file */
405 DString fName = Config_getString(HTML_OUTPUT) + "/" + hhpFileName;
406 std::ofstream t = Portable::openOutputStream(fName);
407 if (t.is_open())
408 {
409 DString hhcFile = "\"" + hhcFileName + "\"";
410 DString hhkFile = "\"" + hhkFileName + "\"";
411 bool hhkPresent = index.size()>0;
412 if (!ctsItemPresent) hhcFile = "";
413 if (!hhkPresent) hhkFile = "";
414
415 DString indexName="index"+Doxygen::htmlFileExtension;
416 t << "[OPTIONS]\n";
417 if (!Config_getString(CHM_FILE).empty())
418 {
419 t << "Compiled file=" << Config_getString(CHM_FILE) << "\n";
420 }
421 else
422 {
423 t << "Compiled file=index.chm\n";
424 }
425 t << "Compatibility=1.1\n"
426 "Full-text search=Yes\n";
427 if (ctsItemPresent) t << "Contents file=" + hhcFileName + "\n";
428 t << "Default Window=main\n"
429 "Default topic=" << indexName << "\n";
430 if (hhkPresent) t << "Index file=" + hhkFileName + "\n";
431 t << "Language=" << theTranslator->getLanguageString() << "\n";
432 if (Config_getBool(BINARY_TOC)) t << "Binary TOC=YES\n";
433 if (Config_getBool(GENERATE_CHI)) t << "Create CHI file=YES\n";
434 t << "Title=" << recoder.recode(Config_getString(PROJECT_NAME)) << "\n\n";
435
436 t << "[WINDOWS]\n";
437
438 // NOTE: the 0x10387e number is a set of bits specifying the buttons
439 // which should appear in the CHM viewer; that specific value
440 // means "show all buttons including the font-size one";
441 // the font-size one is not normally settable by the HTML Help Workshop
442 // utility but the way to set it is described here:
443 // http://support.microsoft.com/?scid=kb%3Ben-us%3B240062&x=17&y=18
444 // NOTE: the 0x70387e number in addition to the above the Next and Prev button
445 // are shown. They can only be shown in case of a binary toc.
446 // dee http://www.mif2go.com/xhtml/htmlhelp_0016_943addingtabsandtoolbarbuttonstohtmlhelp.htm#Rz108x95873
447 // Value has been taken from htmlhelp.h file of the HTML Help Workshop
448 if (Config_getBool(BINARY_TOC))
449 {
450 t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
451 << hhkFile << ",\"" << indexName << "\",\"" <<
452 indexName << "\",,,,,0x23520,,0x70387e,,,,,,,,0\n\n";
453 }
454 else
455 {
456 t << "main=\"" << recoder.recode(Config_getString(PROJECT_NAME)) << "\"," << hhcFile << ","
457 << hhkFile << ",\"" << indexName << "\",\"" <<
458 indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0\n\n";
459 }
460
461 t << "[FILES]\n";
462 for (auto &s : indexFiles)
463 {
464 t << s << "\n";
465 }
466 for (auto &s : imageFiles)
467 {
468 t << s << "\n";
469 }
470 for (auto &s : styleFiles)
471 {
472 t << s << "\n";
473 }
474 t.close();
475 }
476 else
477 {
478 err("Could not open file {} for writing\n",fName);
479 }
480}
static DString htmlFileExtension
Definition doxygen.h:115
StringSet indexFiles
Definition htmlhelp.cpp:346
StringSet imageFiles
Definition htmlhelp.cpp:347
StringSet styleFiles
Definition htmlhelp.cpp:348
static const DString hhkFileName
Definition htmlhelp.h:89
static const DString hhpFileName
Definition htmlhelp.h:90
static const DString hhcFileName
Definition htmlhelp.h:88
size_t size() const
Definition htmlhelp.cpp:125
DString recode(const DString &s)
Definition htmlhelp.cpp:70
virtual DString getLanguageString()=0
language codes for Html help
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
Translator * theTranslator
Definition language.cpp:76
#define err(fmt,...)
Definition message.h:127
std::ofstream openOutputStream(const DString &name, bool append=false)
Definition portable.cpp:681

References Config_getBool, Config_getString, ctsItemPresent, err, Translator::getLanguageString(), HtmlHelp::hhcFileName, HtmlHelp::hhkFileName, HtmlHelp::hhpFileName, Doxygen::htmlFileExtension, imageFiles, index, indexFiles, Portable::openOutputStream(), HtmlHelpRecoder::recode(), recoder, HtmlHelpIndex::size(), styleFiles, and theTranslator.

Member Data Documentation

◆ cts

std::ofstream HtmlHelp::Private::cts

Definition at line 341 of file htmlhelp.cpp.

◆ ctsItemPresent

bool HtmlHelp::Private::ctsItemPresent = false

Definition at line 344 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ dc

int HtmlHelp::Private::dc = 0

Definition at line 345 of file htmlhelp.cpp.

◆ imageFiles

StringSet HtmlHelp::Private::imageFiles

Definition at line 347 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ index

HtmlHelpIndex HtmlHelp::Private::index

Definition at line 350 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ indexFiles

StringSet HtmlHelp::Private::indexFiles

Definition at line 346 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ kts

std::ofstream HtmlHelp::Private::kts

Definition at line 341 of file htmlhelp.cpp.

◆ prevAnc

DString HtmlHelp::Private::prevAnc

Definition at line 343 of file htmlhelp.cpp.

◆ prevFile

DString HtmlHelp::Private::prevFile

Definition at line 342 of file htmlhelp.cpp.

◆ recoder

HtmlHelpRecoder HtmlHelp::Private::recoder

Definition at line 349 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ styleFiles

StringSet HtmlHelp::Private::styleFiles

Definition at line 348 of file htmlhelp.cpp.

Referenced by createProjectFile().


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