10 #include <THtmlAttribute>
19 QString linkTo(
const QString &text,
const QUrl &url,
22 QString linkTo(
const QString &text,
const QUrl &url,
Tf::HttpMethod method,
25 QString linkTo(
const QString &text,
const QUrl &url,
Tf::HttpMethod method,
28 QString linkToPopup(
const QString &text,
const QUrl &url,
29 const QString &windowTitle = QString(),
30 const QSize &size = QSize(),
const QPoint &topLeft = QPoint(),
31 const QString &windowStyle = QString(),
32 const QString &jsCondition = QString(),
35 QString linkToIf(
bool condition,
const QString &text,
const QUrl &url,
39 QString linkToUnless(
bool condition,
const QString &text,
const QUrl &url,
43 QString linkToFunction(
const QString &text,
const QString &
function,
46 QString buttonToFunction(
const QString &text,
const QString &
function,
49 QString anchor(
const QString &text,
const QUrl &url,
52 QString anchor(
const QString &text,
const QUrl &url,
Tf::HttpMethod method,
56 const QString &jsCondition = QString(),
59 QString anchorPopup(
const QString &text,
const QUrl &url,
60 const QString &windowTitle = QString(),
61 const QSize &size = QSize(),
const QPoint &topLeft = QPoint(),
62 const QString &windowStyle = QString(),
63 const QString &jsCondition = QString(),
66 QString anchorIf(
bool condition,
const QString &text,
const QUrl &url,
70 QString anchorUnless(
bool condition,
const QString &text,
const QUrl &url,
74 QString anchorFunction(
const QString &text,
const QString &
function,
80 QString inputTag(
const QString &type,
const QString &name,
const QVariant &value,
83 QString inputTextTag(
const QString &name,
const QVariant &value,
86 QString inputFileTag(
const QString &name,
89 QString inputPasswordTag(
const QString &name,
const QVariant &value,
92 QString inputHiddenTag(
const QString &name,
const QVariant &value,
95 QString checkBoxTag(
const QString &name,
const QVariant &value,
bool checked =
false,
98 QString checkBoxTag(
const QString &name,
const QString &value,
const QStringList &checkedValues,
101 QString checkBoxTag(
const QString &name,
const QVariant &value,
const QVariantList &checkedValues,
104 QString checkBoxTag(
const QString &name,
const QVariant &value,
const QVariant &checkedValue,
107 QString radioButtonTag(
const QString &name,
const QVariant &value,
bool checked =
false,
110 QString radioButtonTag(
const QString &name,
const QVariant &value,
const QVariant &checkedValue,
113 QString selectTag(
const QString &name,
int size = 1,
bool multiple =
false,
116 QString optionTag(
const QString &text,
const QVariant &value,
bool selected =
false,
119 QString optionTags(
const QStringList &valueList,
const QVariant &selectedValue = QVariant(),
122 QString optionTags(
const QVariantList &valueList,
const QVariant &selectedValue = QVariant(),
125 QString optionTags(
const QList<QPair<QString, QVariant>> &valueList,
const QVariant &selectedValue = QVariant(),
128 QString inputAuthenticityTag()
const;
130 QString textAreaTag(
const QString &name,
int rows,
int cols,
const QString &content = QString(),
139 QString imageTag(
const QString &src,
const QSize &size = QSize(),
140 const QString &alt = QString(),
143 QString imageTag(
const QString &src,
bool withTimestamp,
144 const QSize &size = QSize(),
const QString &alt = QString(),
147 QString imageTag(
const QString &src,
const THtmlAttribute &attributes)
const;
149 QString inlineImageTag(
const QFileInfo &file,
const QString &mediaType,
150 const QSize &size = QSize(),
const QString &alt = QString(),
153 QString inlineImageTag(
const QFileInfo &file,
const QString &mediaType,
156 QString inlineImageTag(
const QByteArray &data,
const QString &mediaType,
157 const QSize &size = QSize(),
const QString &alt = QString(),
160 QString inlineImageTag(
const QByteArray &data,
const QString &mediaType,
163 QString imageLinkTo(
const QUrl &url,
const QString &src,
bool withTimestamp,
167 QString styleSheetTag(
const QString &src,
const THtmlAttribute &attributes)
const;
171 QString scriptTag(
const QString &src,
const THtmlAttribute &attributes)
const;
175 QString tag(
const QString &name,
const THtmlAttribute &attributes);
177 QString tag(
const QString &name,
const THtmlAttribute &attributes,
bool selfClose);
179 QString tag(
const QString &name,
const THtmlAttribute &attributes,
const QString &content)
const;
181 QString selfClosingTag(
const QString &name,
const THtmlAttribute &attributes)
const;
183 QString endTag(
const QString &name)
const;
187 QString allEndTags();
189 QString imagePath(
const QString &src,
bool withTimestamp =
true)
const;
191 QString cssPath(
const QString &src,
bool withTimestamp =
true)
const;
193 QString jsPath(
const QString &src,
bool withTimestamp =
true)
const;
195 QString srcPath(
const QString &src,
const QString &dir,
bool withTimestamp =
true)
const;
225 const QString &jsCondition,
const THtmlAttribute &attributes)
const
227 return condition ?
linkTo(text, url, method, jsCondition, attributes) : text;
236 const QString &jsCondition,
const THtmlAttribute &attributes)
const
238 return linkToIf(!condition, text, url, method, jsCondition, attributes);
246 return linkTo(text, url, attributes);
255 return linkTo(text, url, method, attributes);
262 const QString &jsCondition,
const THtmlAttribute &attributes)
const
264 return linkTo(text, url, method, jsCondition, attributes);
271 const QString &windowTitle,
272 const QSize &size,
const QPoint &topLeft,
273 const QString &windowStyle,
274 const QString &jsCondition,
277 return linkToPopup(text, url, windowTitle, size, topLeft, windowStyle, jsCondition, attributes);
285 const QString &jsCondition,
288 return linkToIf(condition, text, url, method, jsCondition, attributes);
297 const QString &jsCondition,
300 return linkToUnless(condition, text, url, method, jsCondition, attributes);
307 const QString &
function,
320 return inputTag(
"text", name, value, attributes);
330 return inputTag(
"file", name, QVariant(), attributes);
340 return inputTag(
"password", name, value, attributes);
350 return inputTag(
"hidden", name, value, attributes);
358 return imageTag(src, QSize(), QString(), attributes);
369 return linkTo(
imageTag(src, withTimestamp, QSize(), alt, attributes), url);
379 return imageLinkTo(url, src,
false, QString(), attributes);
389 return inlineImageTag(file, mediaType, QSize(), QString(), attributes);
399 return inlineImageTag(data, mediaType, QSize(), QString(), attributes);
The TActionView class is the abstract base class of views, providing functionality common to view.
Definition: tactionview.h:14
The THtmlAttribute class represents HTML attributes for customizing web elements.
Definition: thtmlattribute.h:7
The TViewHelper class provides some functionality for views.
Definition: tviewhelper.h:15
QString anchorIf(bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag with the given arguments.
Definition: tviewhelper.h:283
virtual ~TViewHelper()
Definition: tviewhelper.h:17
QString anchorFunction(const QString &text, const QString &function, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag with the given arguments.
Definition: tviewhelper.h:306
QString linkToPopup(const QString &text, const QUrl &url, const QString &windowTitle=QString(), const QSize &size=QSize(), const QPoint &topLeft=QPoint(), const QString &windowStyle=QString(), const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag of the given text using a given URL url in a popup window with the name window...
Definition: tviewhelper.cpp:80
QString linkToUnless(bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag of the given text using the given url.
Definition: tviewhelper.h:235
QString inputTextTag(const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a input tag with type="text", name="name" and value="value".
Definition: tviewhelper.h:317
QString imageLinkTo(const QUrl &url, const QString &src, bool withTimestamp, const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag of a given url with a <img> tag of src="src".
Definition: tviewhelper.h:366
QString inputPasswordTag(const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a input tag with type="password", name="name" and value="value".
Definition: tviewhelper.h:337
QString inlineImageTag(const QFileInfo &file, const QString &mediaType, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Definition: tviewhelper.cpp:485
QString linkToIf(bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag of the given text using the given url.
Definition: tviewhelper.h:224
QString inputHiddenTag(const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a input tag with type="hidden", name="name" and value="value".
Definition: tviewhelper.h:347
QString inputTag(const QString &type, const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <input> input tag with type="type", name="name" and value="value".
Definition: tviewhelper.cpp:219
QString anchorUnless(bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag with the given arguments.
Definition: tviewhelper.h:295
QString anchorPopup(const QString &text, const QUrl &url, const QString &windowTitle=QString(), const QSize &size=QSize(), const QPoint &topLeft=QPoint(), const QString &windowStyle=QString(), const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag with the given arguments.
Definition: tviewhelper.h:270
QString linkTo(const QString &text, const QUrl &url, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag of the given text using the given URL url and HTML attributes attributes.
Definition: tviewhelper.h:214
QString inputFileTag(const QString &name, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a input tag with type="file", name="name".
Definition: tviewhelper.h:327
QString imageTag(const QString &src, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <img> image tag with src="src".
Definition: tviewhelper.cpp:448
QString anchor(const QString &text, const QUrl &url, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag with the given arguments.
Definition: tviewhelper.h:244
THtmlAttribute a() const
Returns a null THtmlAttribute object.
Definition: tviewhelper.h:198
QString linkToFunction(const QString &text, const QString &function, const THtmlAttribute &attributes=THtmlAttribute()) const
Creates a <a> link tag whose onclick handler triggers the passed JavaScript.
Definition: tviewhelper.cpp:127
virtual const TActionView * actionView() const =0
Must be overridden by subclasses to return the current action view.
HttpMethod
Definition: tfnamespace.h:21
@ Post
Definition: tfnamespace.h:25
@ Get
Definition: tfnamespace.h:23
#define T_CORE_EXPORT
Definition: tdeclexport.h:28