tools/qdoc3/htmlgenerator.h
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    43   htmlgenerator.h
    43   htmlgenerator.h
    44 */
    44 */
    45 
    45 
    46 #ifndef HTMLGENERATOR_H
    46 #ifndef HTMLGENERATOR_H
    47 #define HTMLGENERATOR_H
    47 #define HTMLGENERATOR_H
    48 
       
    49 #define QDOC_NAME_ALIGNMENT
       
    50 
    48 
    51 #include <qmap.h>
    49 #include <qmap.h>
    52 #include <qregexp.h>
    50 #include <qregexp.h>
    53 #include <QXmlStreamWriter>
    51 #include <QXmlStreamWriter>
    54 
    52 
   123     virtual QString linkForNode(const Node *node, const Node *relative);
   121     virtual QString linkForNode(const Node *node, const Node *relative);
   124     virtual QString refForAtom(Atom *atom, const Node *node);
   122     virtual QString refForAtom(Atom *atom, const Node *node);
   125 
   123 
   126  private:
   124  private:
   127     enum SubTitleSize { SmallSubTitle, LargeSubTitle };
   125     enum SubTitleSize { SmallSubTitle, LargeSubTitle };
       
   126     enum ExtractionMarkType {
       
   127         BriefMark,
       
   128         DetailedDescriptionMark,
       
   129         MemberMark,
       
   130         EndMark
       
   131     };
   128 
   132 
   129     const QPair<QString,QString> anchorForNode(const Node *node);
   133     const QPair<QString,QString> anchorForNode(const Node *node);
   130     const Node *findNodeForTarget(const QString &target, 
   134     const Node *findNodeForTarget(const QString &target, 
   131                                   const Node *relative,
   135                                   const Node *relative,
   132                                   CodeMarker *marker, 
   136                                   CodeMarker *marker, 
   196     void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker);
   200     void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker);
   197     void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker);
   201     void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker);
   198     void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker);
   202     void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker);
   199     void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker);
   203     void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker);
   200 #endif
   204 #endif
   201 #ifdef QDOC_NAME_ALIGNMENT
   205 
   202     void generateSection(const NodeList& nl,
   206     void generateSection(const NodeList& nl,
   203                          const Node *relative,
   207                          const Node *relative,
   204                          CodeMarker *marker,
   208                          CodeMarker *marker,
   205                          CodeMarker::SynopsisStyle style);
   209                          CodeMarker::SynopsisStyle style);
   206     void generateSynopsis(const Node *node, 
   210     void generateSynopsis(const Node *node, 
   207                           const Node *relative, 
   211                           const Node *relative, 
   208                           CodeMarker *marker,
   212                           CodeMarker *marker,
   209 			  CodeMarker::SynopsisStyle style,
   213 			  CodeMarker::SynopsisStyle style,
   210                           bool nameAlignment = false);
   214                           bool alignNames = false);
   211     void generateSectionInheritedList(const Section& section, 
       
   212                                       const Node *relative,
       
   213                                       CodeMarker *marker,
       
   214                                       bool nameAlignment = false);
       
   215     QString highlightedCode(const QString& markedCode, 
       
   216                             CodeMarker *marker, 
       
   217                             const Node *relative,
       
   218                             CodeMarker::SynopsisStyle style = CodeMarker::Accessors,
       
   219                             bool nameAlignment = false);
       
   220 #else
       
   221     void generateSynopsis(const Node *node, 
       
   222                           const Node *relative, 
       
   223                           CodeMarker *marker,
       
   224 			  CodeMarker::SynopsisStyle style);
       
   225     void generateSectionInheritedList(const Section& section, 
   215     void generateSectionInheritedList(const Section& section, 
   226                                       const Node *relative,
   216                                       const Node *relative,
   227                                       CodeMarker *marker);
   217                                       CodeMarker *marker);
   228     QString highlightedCode(const QString& markedCode, 
   218     QString highlightedCode(const QString& markedCode, 
   229                             CodeMarker *marker, 
   219                             CodeMarker* marker, 
   230                             const Node *relative);
   220                             const Node* relative,
   231 #endif
   221                             bool alignNames = false,
       
   222                             const Node* self = 0);
       
   223 
   232     void generateFullName(const Node *apparentNode, 
   224     void generateFullName(const Node *apparentNode, 
   233                           const Node *relative, 
   225                           const Node *relative, 
   234                           CodeMarker *marker,
   226                           CodeMarker *marker,
   235 			  const Node *actualNode = 0);
   227 			  const Node *actualNode = 0);
   236     void generateDetailedMember(const Node *node, 
   228     void generateDetailedMember(const Node *node, 
   249     QString fileName(const Node *node);
   241     QString fileName(const Node *node);
   250     void findAllClasses(const InnerNode *node);
   242     void findAllClasses(const InnerNode *node);
   251     void findAllFunctions(const InnerNode *node);
   243     void findAllFunctions(const InnerNode *node);
   252     void findAllLegaleseTexts(const InnerNode *node);
   244     void findAllLegaleseTexts(const InnerNode *node);
   253     void findAllNamespaces(const InnerNode *node);
   245     void findAllNamespaces(const InnerNode *node);
   254 #ifdef ZZZ_QDOC_QML    
       
   255     void findAllQmlClasses(const InnerNode *node);
       
   256 #endif
       
   257     void findAllSince(const InnerNode *node);
   246     void findAllSince(const InnerNode *node);
   258     static int hOffset(const Node *node);
   247     static int hOffset(const Node *node);
   259     static bool isThreeColumnEnumValueTable(const Atom *atom);
   248     static bool isThreeColumnEnumValueTable(const Atom *atom);
   260     virtual QString getLink(const Atom *atom, 
   249     virtual QString getLink(const Atom *atom, 
   261                             const Node *relative, 
   250                             const Node *relative, 
   281     void generatePageElements(QXmlStreamWriter& writer, 
   270     void generatePageElements(QXmlStreamWriter& writer, 
   282                               const Node* node, 
   271                               const Node* node, 
   283                               CodeMarker* marker) const;
   272                               CodeMarker* marker) const;
   284     void generatePageIndex(const QString& fileName, 
   273     void generatePageIndex(const QString& fileName, 
   285                            CodeMarker* marker) const;
   274                            CodeMarker* marker) const;
       
   275     void generateExtractionMark(const Node *node, ExtractionMarkType markType);
   286 
   276 
   287 #if 0
   277 #if 0
   288     NavigationBar currentNavigationBar;
   278     NavigationBar currentNavigationBar;
   289 #endif
   279 #endif
   290     QMap<QString, QString> refMap;
   280     QMap<QString, QString> refMap;
   303     bool inSectionHeading;
   293     bool inSectionHeading;
   304     bool inTableHeader;
   294     bool inTableHeader;
   305     int numTableRows;
   295     int numTableRows;
   306     bool threeColumnEnumValueTable;
   296     bool threeColumnEnumValueTable;
   307     bool offlineDocs;
   297     bool offlineDocs;
       
   298     bool creatorDocs;
   308     QString link;
   299     QString link;
   309     QStringList sectionNumber;
   300     QStringList sectionNumber;
   310     QRegExp funcLeftParen;
   301     QRegExp funcLeftParen;
   311     QString style;
   302     QString style;
   312     QString postHeader;
   303     QString postHeader;
   329     NodeMap mainClasses;
   320     NodeMap mainClasses;
   330     NodeMap compatClasses;
   321     NodeMap compatClasses;
   331     NodeMap obsoleteClasses;
   322     NodeMap obsoleteClasses;
   332     NodeMap namespaceIndex;
   323     NodeMap namespaceIndex;
   333     NodeMap serviceClasses;
   324     NodeMap serviceClasses;
   334 #ifdef QDOC_QML    
       
   335     NodeMap qmlClasses;
       
   336 #endif
       
   337     QMap<QString, NodeMap > funcIndex;
   325     QMap<QString, NodeMap > funcIndex;
   338     QMap<Text, const Node *> legaleseTexts;
   326     QMap<Text, const Node *> legaleseTexts;
   339     NewSinceMaps newSinceMaps;
   327     NewSinceMaps newSinceMaps;
   340     static QString sinceTitles[];
   328     static QString sinceTitles[];
   341     NewClassMaps newClassMaps;
   329     NewClassMaps newClassMaps;
   342     NewClassMaps newQmlClassMaps;
   330     NewClassMaps newQmlClassMaps;
   343     static int id;
   331     static int id;
       
   332  public:
       
   333     static bool debugging_on;
       
   334     static QString divNavTop;
   344 };
   335 };
   345 
   336 
   346 #define HTMLGENERATOR_ADDRESS           "address"
   337 #define HTMLGENERATOR_ADDRESS           "address"
   347 #define HTMLGENERATOR_FOOTER            "footer"
   338 #define HTMLGENERATOR_FOOTER            "footer"
   348 #define HTMLGENERATOR_GENERATEMACREFS   "generatemacrefs" // ### document me
   339 #define HTMLGENERATOR_GENERATEMACREFS   "generatemacrefs" // ### document me