summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorCasper van Donderen <casper.vandonderen@nokia.com>2012-03-25 11:16:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-28 05:07:08 +0200
commit291f436ab6f83d1215cb7fe1f3c0573d812538fd (patch)
tree9a49ba8e0328260b6416ee1445b1dd9b247de07e /src/tools
parent32068cb707bc60d6a74697beaea6fb7cab399bb8 (diff)
qdoc: Implement \uicontrol command.
Change-Id: I10381cd69d32352c590ec5a7d4041465af57b88b Reviewed-by: Martin Smith <martin.smith@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/atom.cpp3
-rw-r--r--src/tools/qdoc/atom.h2
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp3
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h1
-rw-r--r--src/tools/qdoc/doc.cpp5
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc11
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp1
7 files changed, 25 insertions, 1 deletions
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 <qregexp.h>
+#include <QRegExp>
#include "atom.h"
#include "location.h"
#include <stdio.h>
@@ -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, "<sub>", "</sub>" },
{ ATOM_FORMATTING_SUPERSCRIPT, "<sup>", "</sup>" },
{ ATOM_FORMATTING_TELETYPE, "<tt>", "</tt>" },
+ { ATOM_FORMATTING_UICONTROL, "<b>", "</b>" },
{ ATOM_FORMATTING_UNDERLINE, "<u>", "</u>" },
{ 0, 0, 0 }
};