Orb/Doxygen/src/ftvhelp.h
changeset 0 42188c7ea2d9
child 4 468f4c8d3d5b
equal deleted inserted replaced
-1:000000000000 0:42188c7ea2d9
       
     1 /******************************************************************************
       
     2  *
       
     3  * Copyright (C) 1997-2008 by Dimitri van Heesch.
       
     4  *
       
     5  * Permission to use, copy, modify, and distribute this software and its
       
     6  * documentation under the terms of the GNU General Public License is hereby 
       
     7  * granted. No representations are made about the suitability of this software 
       
     8  * for any purpose. It is provided "as is" without express or implied warranty.
       
     9  * See the GNU General Public License for more details.
       
    10  *
       
    11  * Documents produced by Doxygen are derivative works derived from the
       
    12  * input used in their production; they are not affected by this license.
       
    13  *
       
    14  */
       
    15 
       
    16 /******************************************************************************
       
    17  * ftvhelp.h,v 1.0 2000/09/06 16:09:00
       
    18  *
       
    19  * Kenney Wong <kwong@ea.com>
       
    20  *
       
    21  * Folder Tree View for offline help on browsers that do not support HTML Help.
       
    22  */
       
    23 
       
    24 #ifndef FTVHELP_H
       
    25 #define FTVHELP_H
       
    26 
       
    27 #include "qtbc.h"
       
    28 #include <qtextstream.h>
       
    29 #include <qlist.h>
       
    30 #include "index.h"
       
    31 
       
    32 class QFile;
       
    33 struct FTVNode;
       
    34 
       
    35 struct FTVImageInfo
       
    36 {
       
    37   const char *alt;
       
    38   const char *name;
       
    39   const unsigned char *data;
       
    40   unsigned int len;
       
    41   unsigned short width, height;
       
    42 };
       
    43 
       
    44 extern FTVImageInfo image_info[];
       
    45 
       
    46 #define FTVIMG_blank        0
       
    47 #define FTVIMG_doc          1
       
    48 #define FTVIMG_folderclosed 2
       
    49 #define FTVIMG_folderopen   3
       
    50 #define FTVIMG_lastnode     4
       
    51 #define FTVIMG_link         5
       
    52 #define FTVIMG_mlastnode    6
       
    53 #define FTVIMG_mnode        7
       
    54 #define FTVIMG_node         8
       
    55 #define FTVIMG_plastnode    9
       
    56 #define FTVIMG_pnode       10
       
    57 #define FTVIMG_vertline    11
       
    58 
       
    59 #define FTV_S(name) #name
       
    60 #define FTV_ICON_FILE(name) "ftv2" FTV_S(name) ".png"
       
    61 #define FTVIMG_INDEX(name) FTVIMG_ ## name
       
    62 #define FTV_INFO(name) ( image_info[FTVIMG_INDEX(name)] )
       
    63 #define FTV_IMGATTRIBS(name) \
       
    64     "src=\"" FTV_ICON_FILE(name) "\" " \
       
    65     "alt=\"" << FTV_INFO(name).alt << "\" " \
       
    66     "width=\"" << FTV_INFO(name).width << "\" " \
       
    67     "height=\"" << FTV_INFO(name).height << "\" "
       
    68 
       
    69 /*! A class that generates a dynamic tree view side panel.
       
    70  */
       
    71 class FTVHelp : public IndexIntf
       
    72 {
       
    73   public:
       
    74     FTVHelp(bool topLevelIndex = true);
       
    75     ~FTVHelp();
       
    76     void initialize();
       
    77     void finalize();
       
    78     void incContentsDepth();
       
    79     void decContentsDepth();
       
    80     void addContentsItem(bool isDir,
       
    81                          const char *name,
       
    82                          const char *ref,
       
    83                          const char *file,
       
    84                          const char *anchor);
       
    85     //void addIndexItem(const char *, const char *, 
       
    86     //                  const char *, const char *,
       
    87     //                  const char *, const MemberDef *) {}
       
    88     void addIndexItem(Definition *,MemberDef *,const char *,const char *) {}
       
    89     void addIndexFile(const char *) {}
       
    90     void addImageFile(const char *) {}
       
    91     void addStyleSheetFile(const char *) {}
       
    92     void generateTreeView(QString* = NULL);
       
    93   private:
       
    94     void generateTreeViewImages();
       
    95     void generateTree(QTextStream &t,const QList<FTVNode> &nl,int level);
       
    96     void generateIndent(QTextStream &t,FTVNode *n,int level);
       
    97     void generateLink(QTextStream &t,FTVNode *n);
       
    98     QList<FTVNode> *m_indentNodes;
       
    99     int m_indent;
       
   100     bool m_topLevelIndex;
       
   101 };
       
   102 
       
   103 
       
   104 #endif /* FTVHELP_H */
       
   105