From 291f436ab6f83d1215cb7fe1f3c0573d812538fd Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Sun, 25 Mar 2012 11:16:15 +0200 Subject: qdoc: Implement \uicontrol command. Change-Id: I10381cd69d32352c590ec5a7d4041465af57b88b Reviewed-by: Martin Smith --- src/tools/qdoc/atom.cpp | 3 ++- src/tools/qdoc/atom.h | 2 ++ src/tools/qdoc/ditaxmlgenerator.cpp | 3 +++ src/tools/qdoc/ditaxmlgenerator.h | 1 + src/tools/qdoc/doc.cpp | 5 +++++ src/tools/qdoc/doc/qdoc-manual.qdoc | 11 +++++++++++ src/tools/qdoc/htmlgenerator.cpp | 1 + 7 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp index 777240c831..fec383f5ac 100644 --- a/src/tools/qdoc/atom.cpp +++ b/src/tools/qdoc/atom.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "atom.h" #include "location.h" #include @@ -55,6 +55,7 @@ QLatin1String Atom::SPAN_ ("span"); QLatin1String Atom::SUBSCRIPT_ ("subscript"); QLatin1String Atom::SUPERSCRIPT_ ("superscript"); QLatin1String Atom::TELETYPE_ ("teletype"); +QLatin1String Atom::UICONTROL_ ("uicontrol"); QLatin1String Atom::UNDERLINE_ ("underline"); QLatin1String Atom::BULLET_ ("bullet"); diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h index 584e8fcd08..d9f34740f9 100644 --- a/src/tools/qdoc/atom.h +++ b/src/tools/qdoc/atom.h @@ -195,6 +195,7 @@ public: static QLatin1String SUBSCRIPT_; static QLatin1String SUPERSCRIPT_; static QLatin1String TELETYPE_; + static QLatin1String UICONTROL_; static QLatin1String UNDERLINE_; static QLatin1String BULLET_; @@ -221,6 +222,7 @@ private: #define ATOM_FORMATTING_SUBSCRIPT "subscript" #define ATOM_FORMATTING_SUPERSCRIPT "superscript" #define ATOM_FORMATTING_TELETYPE "teletype" +#define ATOM_FORMATTING_UICONTROL "uicontrol" #define ATOM_FORMATTING_UNDERLINE "underline" #define ATOM_LIST_BULLET "bullet" diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 25c92fb44f..a25fc0d4bb 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -240,6 +240,7 @@ QString DitaXmlGenerator::ditaTags[] = "topicref", "tt", "u", + "uicontrol", "ul", "unknown", "vrm", @@ -879,6 +880,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, else if (atom->string().startsWith("span ")) { t = DT_keyword; } + else if (atom->string() == ATOM_FORMATTING_UICONTROL) + t = DT_uicontrol; else if (atom->string() == ATOM_FORMATTING_UNDERLINE) t = DT_u; else if (atom->string() == ATOM_FORMATTING_INDEX) diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h index a4fc890dde..07cd08043a 100644 --- a/src/tools/qdoc/ditaxmlgenerator.h +++ b/src/tools/qdoc/ditaxmlgenerator.h @@ -249,6 +249,7 @@ public: DT_topicref, DT_tt, DT_u, + DT_uicontrol, DT_ul, DT_unknown, DT_vrm, diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index 7572799eba..6bc3086551 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -169,6 +169,7 @@ enum { CMD_TARGET, CMD_TOPICREF, CMD_TT, + CMD_UICONTROL, CMD_UNDERLINE, CMD_UNICODE, CMD_VALUE, @@ -285,6 +286,7 @@ static struct { { "target", CMD_TARGET, 0 }, { "topicref", CMD_TOPICREF, 0 }, { "tt", CMD_TT, 0 }, + { "uicontrol", CMD_UICONTROL, 0 }, { "underline", CMD_UNDERLINE, 0 }, { "unicode", CMD_UNICODE, 0 }, { "value", CMD_VALUE, 0 }, @@ -1313,6 +1315,9 @@ void DocParser::parse(const QString& source, case CMD_TT: startFormat(ATOM_FORMATTING_TELETYPE, cmd); break; + case CMD_UICONTROL: + startFormat(ATOM_FORMATTING_UICONTROL, cmd); + break; case CMD_UNDERLINE: startFormat(ATOM_FORMATTING_UNDERLINE, cmd); break; diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index 342cabc432..92b6b9f100 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -301,6 +301,7 @@ \li \l {11-qdoc-commands-specialcontent.html#tableofcontents-command} {\\tableofcontents} \li \l {08-qdoc-commands-creatinglinks.html#target-command} {\\target} \li \l {04-qdoc-commands-textmarkup.html#tt-command} {\\tt} + \li \l {04-qdoc-commands-textmarkup.html#uicontrol-command} {\\uicontrol} {(new 25/3/2012)} \li \l {04-qdoc-commands-textmarkup.html#underline-command} {\\underline} \li \l {12-0-qdoc-commands-miscellaneous.html#raw-command} {\\unicode} \li \l {11-qdoc-commands-specialcontent.html#warning-command} {\\warning} @@ -837,6 +838,15 @@ If the argument contains spaces or other punctuation, enclose the argument in curly brackets. + \target uicontrol-command + \section1 \\uicontrol + + The \\uicontrol command is used to mark content as being used for UI + control elements. When using HTML the output is rendered in bold. + When using DITA XML the content is enclosed in a \c{uicontrol} tag. + + \sa \\b + \target underline-command \section1 \\underline @@ -8751,6 +8761,7 @@ \li \l {21-0-qdoc-creating-dita-maps.html#topicref-command} {\\topicref} \span {class="newStuff"} {(new 05/03/12)} \li \l {04-qdoc-commands-textmarkup.html#tt-command} {\\tt} \li \l {13-qdoc-commands-topics.html#typedef-command} {\\typedef} + \li \l {04-qdoc-commands-textmarkup.html#uicontrol-command} {\\uicontrol} {(new 25/3/2012)} \li \l {04-qdoc-commands-textmarkup.html#underline-command} {\\underline} \li \l {13-qdoc-commands-topics.html#variable-command} {\\variable} \li \l {10-qdoc-commands-tablesandlists.html#value-command} {\\value} diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index b8ad119466..e61f0f66e7 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -128,6 +128,7 @@ void HtmlGenerator::initializeGenerator(const Config &config) { ATOM_FORMATTING_SUBSCRIPT, "", "" }, { ATOM_FORMATTING_SUPERSCRIPT, "", "" }, { ATOM_FORMATTING_TELETYPE, "", "" }, + { ATOM_FORMATTING_UICONTROL, "", "" }, { ATOM_FORMATTING_UNDERLINE, "", "" }, { 0, 0, 0 } }; -- cgit v1.2.3