KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
htmlutil.h
1#ifndef HTMLUTIL_H
2#define HTMLUTIL_H
3
4#include <Kanoop/gui/libkanoopgui.h>
5#include <QColor>
6#include <QString>
7
8/**
9 * @brief Static helpers for generating common HTML tag strings.
10 *
11 * Each method returns a QString containing the appropriate HTML tag or
12 * attribute, ready to be concatenated into an HTML fragment.
13 */
14class LIBKANOOPGUI_EXPORT HtmlUtil
15{
16public:
17 /**
18 * @brief Return an opening &lt;p&gt; tag with optional inline color styles.
19 * @param color Foreground text color (invalid QColor = omitted)
20 * @param backgroundColor Background color (invalid QColor = omitted)
21 * @return HTML string for the opening paragraph tag
22 */
23 static QString startParagraph(const QColor& color = QColor(), const QColor& backgroundColor = QColor());
24
25 /**
26 * @brief Return a closing &lt;/p&gt; tag.
27 * @return "&lt;/p&gt;"
28 */
29 static QString endParagraph();
30
31 /**
32 * @brief Return an opening &lt;b&gt; tag.
33 * @return "&lt;b&gt;"
34 */
35 static QString startBold();
36
37 /**
38 * @brief Return a closing &lt;/b&gt; tag.
39 * @return "&lt;/b&gt;"
40 */
41 static QString endBold();
42
43 /**
44 * @brief Return an opening &lt;strong&gt; tag.
45 * @return "&lt;strong&gt;"
46 */
47 static QString startStrong();
48
49 /**
50 * @brief Return a closing &lt;/strong&gt; tag.
51 * @return "&lt;/strong&gt;"
52 */
53 static QString endStrong();
54};
55
56#endif // HTMLUTIL_H
Static helpers for generating common HTML tag strings.
Definition htmlutil.h:15
static QString startStrong()
Return an opening <strong> tag.
static QString startParagraph(const QColor &color=QColor(), const QColor &backgroundColor=QColor())
Return an opening <p> tag with optional inline color styles.
static QString endParagraph()
Return a closing </p> tag.
static QString startBold()
Return an opening <b> tag.
static QString endStrong()
Return a closing </strong> tag.
static QString endBold()
Return a closing </b> tag.