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
 
QCString prevFile
 
QCString prevAnc
 
bool ctsItemPresent = false
 
int dc = 0
 
StringSet indexFiles
 
StringSet imageFiles
 
StringSet styleFiles
 
HtmlHelpRecoder recoder
 
HtmlHelpIndex index
 

Detailed Description

Definition at line 339 of file htmlhelp.cpp.

Constructor & Destructor Documentation

◆ Private()

HtmlHelp::Private::Private ( )
inline

Definition at line 342 of file htmlhelp.cpp.

342: index(recoder) {}
HtmlHelpRecoder recoder
Definition htmlhelp.cpp:352
HtmlHelpIndex index
Definition htmlhelp.cpp:353

References index, and recoder.

Member Function Documentation

◆ createProjectFile()

void HtmlHelp::Private::createProjectFile ( )

Definition at line 405 of file htmlhelp.cpp.

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

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

Member Data Documentation

◆ cts

std::ofstream HtmlHelp::Private::cts

Definition at line 344 of file htmlhelp.cpp.

◆ ctsItemPresent

bool HtmlHelp::Private::ctsItemPresent = false

Definition at line 347 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ dc

int HtmlHelp::Private::dc = 0

Definition at line 348 of file htmlhelp.cpp.

◆ imageFiles

StringSet HtmlHelp::Private::imageFiles

Definition at line 350 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ index

HtmlHelpIndex HtmlHelp::Private::index

Definition at line 353 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ indexFiles

StringSet HtmlHelp::Private::indexFiles

Definition at line 349 of file htmlhelp.cpp.

Referenced by createProjectFile().

◆ kts

std::ofstream HtmlHelp::Private::kts

Definition at line 344 of file htmlhelp.cpp.

◆ prevAnc

QCString HtmlHelp::Private::prevAnc

Definition at line 346 of file htmlhelp.cpp.

◆ prevFile

QCString HtmlHelp::Private::prevFile

Definition at line 345 of file htmlhelp.cpp.

◆ recoder

HtmlHelpRecoder HtmlHelp::Private::recoder

Definition at line 352 of file htmlhelp.cpp.

Referenced by createProjectFile(), and Private().

◆ styleFiles

StringSet HtmlHelp::Private::styleFiles

Definition at line 351 of file htmlhelp.cpp.

Referenced by createProjectFile().


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