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 334 of file htmlhelp.cpp.

Constructor & Destructor Documentation

◆ Private()

HtmlHelp::Private::Private ( )
inline

Definition at line 337 of file htmlhelp.cpp.

337: index(recoder) {}
HtmlHelpRecoder recoder
Definition htmlhelp.cpp:347
HtmlHelpIndex index
Definition htmlhelp.cpp:348

References index, and recoder.

Member Function Documentation

◆ createProjectFile()

void HtmlHelp::Private::createProjectFile ( )

Definition at line 400 of file htmlhelp.cpp.

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

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 339 of file htmlhelp.cpp.

◆ ctsItemPresent

bool HtmlHelp::Private::ctsItemPresent = false

Definition at line 342 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ dc

int HtmlHelp::Private::dc = 0

Definition at line 343 of file htmlhelp.cpp.

◆ imageFiles

StringSet HtmlHelp::Private::imageFiles

Definition at line 345 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ index

HtmlHelpIndex HtmlHelp::Private::index

Definition at line 348 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ indexFiles

StringSet HtmlHelp::Private::indexFiles

Definition at line 344 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ kts

std::ofstream HtmlHelp::Private::kts

Definition at line 339 of file htmlhelp.cpp.

◆ prevAnc

DString HtmlHelp::Private::prevAnc

Definition at line 341 of file htmlhelp.cpp.

◆ prevFile

DString HtmlHelp::Private::prevFile

Definition at line 340 of file htmlhelp.cpp.

◆ recoder

HtmlHelpRecoder HtmlHelp::Private::recoder

Definition at line 347 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ styleFiles

StringSet HtmlHelp::Private::styleFiles

Definition at line 346 of file htmlhelp.cpp.

Referenced by createProjectFile().


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