Orb/Doxygen/src/htmlhelp.h
changeset 0 42188c7ea2d9
child 4 468f4c8d3d5b
equal deleted inserted replaced
-1:000000000000 0:42188c7ea2d9
       
     1 /******************************************************************************
       
     2  *
       
     3  * 
       
     4  *
       
     5  * Copyright (C) 1997-2008 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 <qtextstream.h>
       
    26 #include <qstrlist.h>
       
    27 #include "index.h"
       
    28 
       
    29 class QFile;
       
    30 class HtmlHelpIndex;
       
    31 
       
    32 /*! A class that generated the HTML Help specific files.
       
    33  *  These files can be used with the Microsoft HTML Help workshop
       
    34  *  to generate compressed HTML files (.chm).
       
    35  */
       
    36 class HtmlHelp  : public IndexIntf
       
    37 {
       
    38     /*! used in imageNumber param of HTMLHelp::addContentsItem() function 
       
    39         to specify document icon in tree view.  
       
    40         Writes \<param name="ImageNumber" value="xx"\> in .HHC file. */
       
    41     enum ImageNumber { 
       
    42       BOOK_CLOSED=1,    BOOK_OPEN,
       
    43       BOOK_CLOSED_NEW,  BOOK_OPEN_NEW,
       
    44       FOLDER_CLOSED,    FOLDER_OPEN,
       
    45       FOLDER_CLOSED_NEW,FOLDER_OPEN_NEW,
       
    46       QUERY,            QUERY_NEW,
       
    47       TEXT,             TEXT_NEW,
       
    48       WEB_DOC,          WEB_DOC_NEW,
       
    49       WEB_LINK,         WEB_LINK_NEW,
       
    50       INFO,             INFO_NEW,
       
    51       LINK,             LINK_NEW,
       
    52       BOOKLET,          BOOKLET_NEW,
       
    53       EMAIL,            EMAIL_NEW,
       
    54       EMAIL2,           EMAIL2_NEW,
       
    55       IMAGE,            IMAGE_NEW,
       
    56       AUDIO,            AUDIO_NEW,
       
    57       MUSIC,            MUSIC_NEW,
       
    58       VIDEO,            VIDEO_NEW,
       
    59       INDEX,            INDEX_NEW,
       
    60       IDEA,             IDEA_NEW,
       
    61       NOTE,             NOTE_NEW,
       
    62       TOOL,             TOOL_NEW
       
    63     };
       
    64   public:
       
    65     //static HtmlHelp *getInstance();
       
    66     HtmlHelp();
       
    67     ~HtmlHelp();
       
    68     void initialize();
       
    69     void finalize();
       
    70     void incContentsDepth();
       
    71     void decContentsDepth();
       
    72     void addContentsItem(bool isDir,
       
    73                          const char *name, 
       
    74                          const char *ref = 0, 
       
    75                          const char *file = 0,
       
    76                          const char *anchor = 0);
       
    77     //void addIndexItem(const char *level1, const char *level2, 
       
    78     //                  const char *contRef, const char *memRef,
       
    79     //                  const char *anchor,const MemberDef *md);
       
    80     void addIndexItem(Definition *context,MemberDef *md,
       
    81                       const char *anchor,const char *word);
       
    82     void addIndexFile(const char *name);
       
    83     void addImageFile(const char *) {}
       
    84     void addStyleSheetFile(const char *) {}
       
    85 
       
    86   private:
       
    87     void createProjectFile();
       
    88 
       
    89     QFile *cf,*kf; 
       
    90     QTextStream cts,kts;
       
    91     HtmlHelpIndex *index;
       
    92     int dc;
       
    93     QStrList indexFiles;
       
    94     QDict<void> indexFileDict;
       
    95     static HtmlHelp *theInstance;
       
    96     QCString recode(const QCString &s);
       
    97     void *m_fromUtf8;
       
    98 };
       
    99 
       
   100 #endif /* HTMLHELP_H */
       
   101