Orb/Doxygen/src/docsets.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 #ifndef DOCSETS_H
       
    17 #define DOCSETS_H
       
    18 
       
    19 #include "qtbc.h"
       
    20 #include <qtextstream.h>
       
    21 #include <qstrlist.h>
       
    22 #include "sortdict.h"
       
    23 
       
    24 #include "index.h"
       
    25 
       
    26 class QFile;
       
    27 class Definition;
       
    28 
       
    29 /*! A class that generates docset files.
       
    30  *  These files can be used to create context help 
       
    31  *  for use within Apple's Xcode 3.0 development environment
       
    32  */
       
    33 class DocSets  : public IndexIntf
       
    34 {
       
    35 
       
    36   public:
       
    37     DocSets();
       
    38    ~DocSets();
       
    39     void initialize();
       
    40     void finalize();
       
    41     void incContentsDepth();
       
    42     void decContentsDepth();
       
    43     void addContentsItem(bool isDir,
       
    44                          const char *name, 
       
    45                          const char *ref = 0, 
       
    46                          const char *file = 0,
       
    47                          const char *anchor = 0
       
    48                         );
       
    49     //void addIndexItem(const char *level1, const char *level2, 
       
    50     //                  const char *contRef, const char *memRef,
       
    51     //                  const char *anchor,const MemberDef *md);
       
    52     void addIndexItem(Definition *context,MemberDef *md,
       
    53                       const char *anchor,const char *word);
       
    54     void addIndexFile(const char *name);
       
    55     void addImageFile(const char *) {}
       
    56     void addStyleSheetFile(const char *) {}
       
    57 
       
    58   private:
       
    59     void writeToken(QTextStream &t, const Definition *d,
       
    60                     const QCString &type, const QCString &lang,
       
    61                     const char *scope=0, const char *anchor=0,
       
    62                     const char *decl=0);
       
    63     struct NodeDef
       
    64     {
       
    65       NodeDef(bool d,const QCString &n,const QCString &r,
       
    66                     const QCString &f,const QCString &a,int i) :
       
    67                    isDir(d), name(n), ref(r), file(f), anchor(a),id(i) {}
       
    68       bool isDir;
       
    69       QCString name;
       
    70       QCString ref;
       
    71       QCString file;
       
    72       QCString anchor;
       
    73       int id;
       
    74     };
       
    75     QCString indent();
       
    76     QFile *m_nf;
       
    77     QFile *m_tf;
       
    78     QTextStream m_nts;
       
    79     QTextStream m_tts;
       
    80     int m_dc;
       
    81     int m_id;
       
    82     QArray<bool> m_firstNode;
       
    83     SDict<NodeDef> m_nodes;
       
    84     SDict<void> m_scopes;
       
    85 };
       
    86 
       
    87 #endif /* DOCSETS_H */
       
    88