diff options
Diffstat (limited to 'tools/qdoc3/htmlgenerator.h')
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 95 |
1 files changed, 62 insertions, 33 deletions
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 19a7c78..b96d737 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -46,10 +46,9 @@ #ifndef HTMLGENERATOR_H #define HTMLGENERATOR_H -#define QDOC_NAME_ALIGNMENT - #include <qmap.h> #include <qregexp.h> +#include <QXmlStreamWriter> #include "codemarker.h" #include "config.h" @@ -89,12 +88,17 @@ class HtmlGenerator : public PageGenerator Typedef, Property, Variable, + QmlClass, QmlProperty, QmlSignal, QmlMethod, LastSinceType }; + enum Application { + Online, + Creator}; + public: HtmlGenerator(); ~HtmlGenerator(); @@ -104,7 +108,8 @@ class HtmlGenerator : public PageGenerator virtual QString format(); virtual void generateTree(const Tree *tree, CodeMarker *marker); - static QString protect(const QString& string); + QString protectEnc(const QString &string); + static QString protect(const QString &string, const QString &encoding = "ISO-8859-1"); static QString cleanRef(const QString& ref); static QString sinceTitle(int i) { return sinceTitles[i]; } @@ -115,21 +120,31 @@ class HtmlGenerator : public PageGenerator CodeMarker *marker); virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker); - virtual QString fileExtension(const Node *node); + virtual QString fileExtension(const Node *node) const; virtual QString refForNode(const Node *node); virtual QString linkForNode(const Node *node, const Node *relative); virtual QString refForAtom(Atom *atom, const Node *node); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; + enum ExtractionMarkType { + BriefMark, + DetailedDescriptionMark, + MemberMark, + EndMark + }; const QPair<QString,QString> anchorForNode(const Node *node); const Node *findNodeForTarget(const QString &target, const Node *relative, CodeMarker *marker, const Atom *atom = 0); - void generateHeader(const QString& title, const Node *node = 0, - CodeMarker *marker = 0, bool mainPage = true); + void generateBreadCrumbs(const QString& title, + const Node *node, + CodeMarker *marker); + void generateHeader(const QString& title, + const Node *node = 0, + CodeMarker *marker = 0); void generateTitle(const QString& title, const Text &subTitle, SubTitleSize subTitleSize, @@ -150,7 +165,13 @@ class HtmlGenerator : public PageGenerator Doc::SectioningUnit sectioningUnit, int numColumns, const Node *relative = 0); - QString generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker); + void generateTableOfContents(const Node *node, + CodeMarker *marker, + QList<Section>* sections = 0); + QString generateListOfAllMemberFile(const InnerNode *inner, + CodeMarker *marker); + QString generateAllQmlMembersFile(const QmlClassNode* qml_cn, + CodeMarker* marker); QString generateLowStatusMemberFile(const InnerNode *inner, CodeMarker *marker, CodeMarker::Status status); @@ -163,6 +184,7 @@ class HtmlGenerator : public PageGenerator void generateCompactList(const Node *relative, CodeMarker *marker, const NodeMap &classMap, + bool includeAlphabet, QString commonPrefix = QString()); void generateFunctionIndex(const Node *relative, CodeMarker *marker); void generateLegaleseList(const Node *relative, CodeMarker *marker); @@ -183,10 +205,11 @@ class HtmlGenerator : public PageGenerator const InnerNode *relative, CodeMarker *marker); void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker); + void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker); void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker); void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker); #endif -#ifdef QDOC_NAME_ALIGNMENT + void generateSection(const NodeList& nl, const Node *relative, CodeMarker *marker, @@ -195,28 +218,16 @@ class HtmlGenerator : public PageGenerator const Node *relative, CodeMarker *marker, CodeMarker::SynopsisStyle style, - bool nameAlignment = false); - void generateSectionInheritedList(const Section& section, - const Node *relative, - CodeMarker *marker, - bool nameAlignment = false); - QString highlightedCode(const QString& markedCode, - CodeMarker *marker, - const Node *relative, - CodeMarker::SynopsisStyle style = CodeMarker::Accessors, - bool nameAlignment = false); -#else - void generateSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style); + bool alignNames = false); void generateSectionInheritedList(const Section& section, const Node *relative, CodeMarker *marker); QString highlightedCode(const QString& markedCode, - CodeMarker *marker, - const Node *relative); -#endif + CodeMarker* marker, + const Node* relative, + bool alignNames = false, + const Node* self = 0); + void generateFullName(const Node *apparentNode, const Node *relative, CodeMarker *marker, @@ -230,7 +241,7 @@ class HtmlGenerator : public PageGenerator void generateStatus(const Node *node, CodeMarker *marker); QString registerRef(const QString& ref); - QString fileBase(const Node *node); + virtual QString fileBase(const Node *node) const; #if 0 QString fileBase(const Node *node, const SectionIterator& section); #endif @@ -239,9 +250,6 @@ class HtmlGenerator : public PageGenerator void findAllFunctions(const InnerNode *node); void findAllLegaleseTexts(const InnerNode *node); void findAllNamespaces(const InnerNode *node); -#ifdef ZZZ_QDOC_QML - void findAllQmlClasses(const InnerNode *node); -#endif void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); @@ -255,12 +263,23 @@ class HtmlGenerator : public PageGenerator virtual void generateIndex(const QString &fileBase, const QString &url, const QString &title); +#ifdef GENERATE_MAC_REFS void generateMacRef(const Node *node, CodeMarker *marker); +#endif void beginLink(const QString &link, const Node *node, const Node *relative, CodeMarker *marker); void endLink(); + bool generatePageElement(QXmlStreamWriter& writer, + const Node* node, + CodeMarker* marker) const; + void generatePageElements(QXmlStreamWriter& writer, + const Node* node, + CodeMarker* marker) const; + void generatePageIndex(const QString& fileName, + CodeMarker* marker) const; + void generateExtractionMark(const Node *node, ExtractionMarkType markType); #if 0 NavigationBar currentNavigationBar; @@ -282,11 +301,15 @@ class HtmlGenerator : public PageGenerator bool inTableHeader; int numTableRows; bool threeColumnEnumValueTable; + Application application; QString link; QStringList sectionNumber; QRegExp funcLeftParen; QString style; QString postHeader; + QString postPostHeader; + QString creatorPostHeader; + QString creatorPostPostHeader; QString footer; QString address; bool pleaseGenerateMacRef; @@ -307,20 +330,26 @@ class HtmlGenerator : public PageGenerator NodeMap obsoleteClasses; NodeMap namespaceIndex; NodeMap serviceClasses; -#ifdef QDOC_QML NodeMap qmlClasses; -#endif QMap<QString, NodeMap > funcIndex; QMap<Text, const Node *> legaleseTexts; NewSinceMaps newSinceMaps; static QString sinceTitles[]; NewClassMaps newClassMaps; + NewClassMaps newQmlClassMaps; + static int id; + public: + static bool debugging_on; + static QString divNavTop; }; #define HTMLGENERATOR_ADDRESS "address" #define HTMLGENERATOR_FOOTER "footer" -#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me +#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me #define HTMLGENERATOR_POSTHEADER "postheader" +#define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" +#define HTMLGENERATOR_CREATORPOSTHEADER "postheader" +#define HTMLGENERATOR_CREATORPOSTPOSTHEADER "postpostheader" #define HTMLGENERATOR_STYLE "style" #define HTMLGENERATOR_STYLESHEETS "stylesheets" #define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements" |