htmlhelp.h 3.27 KB
Newer Older
1 2
/******************************************************************************
 *
3
 * 
4
 *
Dimitri van Heesch's avatar
Dimitri van Heesch committed
5
 * Copyright (C) 1997-2013 by Dimitri van Heesch.
6 7 8 9 10 11 12
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
Dimitri van Heesch's avatar
Dimitri van Heesch committed
13 14
 * Documents produced by Doxygen are derivative works derived from the
 * input used in their production; they are not affected by this license.
15 16 17 18 19 20 21 22 23
 *
 * The code is this file is largely based on a contribution from
 * Harm van der Heijden <H.v.d.Heijden@phys.tue.nl>
 * Please send thanks to him and bug reports to me :-)
 */

#ifndef HTMLHELP_H
#define HTMLHELP_H

24
#include <qstrlist.h>
25
#include <qdict.h>
Dimitri van Heesch's avatar
Dimitri van Heesch committed
26
#include "index.h"
Dimitri van Heesch's avatar
Dimitri van Heesch committed
27
#include "ftextstream.h"
28 29

class QFile;
30
class Definition;
31 32
class HtmlHelpIndex;

Dimitri van Heesch's avatar
Dimitri van Heesch committed
33 34
/** A class that generated the HTML Help specific files.
 *
35 36 37
 *  These files can be used with the Microsoft HTML Help workshop
 *  to generate compressed HTML files (.chm).
 */
Dimitri van Heesch's avatar
Dimitri van Heesch committed
38
class HtmlHelp  : public IndexIntf
39
{
40 41
    /*! used in imageNumber param of HTMLHelp::addContentsItem() function 
        to specify document icon in tree view.  
42
        Writes \<param name="ImageNumber" value="xx"\> in .HHC file. */
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    enum ImageNumber { 
      BOOK_CLOSED=1,    BOOK_OPEN,
      BOOK_CLOSED_NEW,  BOOK_OPEN_NEW,
      FOLDER_CLOSED,    FOLDER_OPEN,
      FOLDER_CLOSED_NEW,FOLDER_OPEN_NEW,
      QUERY,            QUERY_NEW,
      TEXT,             TEXT_NEW,
      WEB_DOC,          WEB_DOC_NEW,
      WEB_LINK,         WEB_LINK_NEW,
      INFO,             INFO_NEW,
      LINK,             LINK_NEW,
      BOOKLET,          BOOKLET_NEW,
      EMAIL,            EMAIL_NEW,
      EMAIL2,           EMAIL2_NEW,
      IMAGE,            IMAGE_NEW,
      AUDIO,            AUDIO_NEW,
      MUSIC,            MUSIC_NEW,
      VIDEO,            VIDEO_NEW,
      INDEX,            INDEX_NEW,
      IDEA,             IDEA_NEW,
      NOTE,             NOTE_NEW,
      TOOL,             TOOL_NEW
    };
66
  public:
Dimitri van Heesch's avatar
Dimitri van Heesch committed
67 68
    //static HtmlHelp *getInstance();
    HtmlHelp();
Dimitri van Heesch's avatar
Dimitri van Heesch committed
69
    ~HtmlHelp();
70 71
    void initialize();
    void finalize();
Dimitri van Heesch's avatar
Dimitri van Heesch committed
72 73
    void incContentsDepth();
    void decContentsDepth();
74 75
    void addContentsItem(bool isDir,
                         const char *name, 
76 77 78 79
                         const char *ref, 
                         const char *file,
                         const char *anchor,
                         bool separateIndex,
80 81
                         bool addToNavIndex,
                         Definition *def);
82 83
    void addIndexItem(Definition *context,MemberDef *md,
                      const char *sectionAnchor, const char *title);
84
    void addIndexFile(const char *name);
85
    void addImageFile(const char *);
86
    void addStyleSheetFile(const char *) {}
87

88
  private:
89
    friend class HtmlHelpIndex;
90 91
    void createProjectFile();

92
    QFile *cf,*kf; 
Dimitri van Heesch's avatar
Dimitri van Heesch committed
93
    FTextStream cts,kts;
94 95
    HtmlHelpIndex *index;
    int dc;
96
    QStrList indexFiles;
97
    QStrList imageFiles;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
98
    QDict<void> indexFileDict;
99
    static HtmlHelp *theInstance;
Dimitri van Heesch's avatar
Dimitri van Heesch committed
100 101
    QCString recode(const QCString &s);
    void *m_fromUtf8;
102 103 104
};

#endif /* HTMLHELP_H */
105