Fix for UBSan build
[platform/upstream/doxygen.git] / src / htmlhelp.h
1 /******************************************************************************
2  *
3  * $Id: htmlhelp.h,v 1.7 2001/03/19 19:27:40 root Exp $
4  *
5  * Copyright (C) 1997-2012 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby 
9  * granted. No representations are made about the suitability of this software 
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  * The code is this file is largely based on a contribution from
17  * Harm van der Heijden <H.v.d.Heijden@phys.tue.nl>
18  * Please send thanks to him and bug reports to me :-)
19  */
20
21 #ifndef HTMLHELP_H
22 #define HTMLHELP_H
23
24 #include "qtbc.h"
25 #include <qstrlist.h>
26 #include "index.h"
27 #include "ftextstream.h"
28
29 class QFile;
30 class Definition;
31 class HtmlHelpIndex;
32
33 /** A class that generated the HTML Help specific files.
34  *
35  *  These files can be used with the Microsoft HTML Help workshop
36  *  to generate compressed HTML files (.chm).
37  */
38 class HtmlHelp  : public IndexIntf
39 {
40     /*! used in imageNumber param of HTMLHelp::addContentsItem() function 
41         to specify document icon in tree view.  
42         Writes \<param name="ImageNumber" value="xx"\> in .HHC file. */
43     enum ImageNumber { 
44       BOOK_CLOSED=1,    BOOK_OPEN,
45       BOOK_CLOSED_NEW,  BOOK_OPEN_NEW,
46       FOLDER_CLOSED,    FOLDER_OPEN,
47       FOLDER_CLOSED_NEW,FOLDER_OPEN_NEW,
48       QUERY,            QUERY_NEW,
49       TEXT,             TEXT_NEW,
50       WEB_DOC,          WEB_DOC_NEW,
51       WEB_LINK,         WEB_LINK_NEW,
52       INFO,             INFO_NEW,
53       LINK,             LINK_NEW,
54       BOOKLET,          BOOKLET_NEW,
55       EMAIL,            EMAIL_NEW,
56       EMAIL2,           EMAIL2_NEW,
57       IMAGE,            IMAGE_NEW,
58       AUDIO,            AUDIO_NEW,
59       MUSIC,            MUSIC_NEW,
60       VIDEO,            VIDEO_NEW,
61       INDEX,            INDEX_NEW,
62       IDEA,             IDEA_NEW,
63       NOTE,             NOTE_NEW,
64       TOOL,             TOOL_NEW
65     };
66   public:
67     //static HtmlHelp *getInstance();
68     HtmlHelp();
69     ~HtmlHelp();
70     void initialize();
71     void finalize();
72     void incContentsDepth();
73     void decContentsDepth();
74     void addContentsItem(bool isDir,
75                          const char *name, 
76                          const char *ref, 
77                          const char *file,
78                          const char *anchor,
79                          bool separateIndex,
80                          bool addToNavIndex,
81                          Definition *def);
82     void addIndexItem(Definition *context,MemberDef *md,const char *title);
83     void addIndexFile(const char *name);
84     void addImageFile(const char *);
85     void addStyleSheetFile(const char *) {}
86
87   private:
88     friend class HtmlHelpIndex;
89     void createProjectFile();
90
91     QFile *cf,*kf; 
92     FTextStream cts,kts;
93     HtmlHelpIndex *index;
94     int dc;
95     QStrList indexFiles;
96     QStrList imageFiles;
97     QDict<void> indexFileDict;
98     static HtmlHelp *theInstance;
99     QCString recode(const QCString &s);
100     void *m_fromUtf8;
101 };
102
103 #endif /* HTMLHELP_H */
104