TreeFrogFramework 2.10
Loading...
Searching...
No Matches
tactionhelper.h
Go to the documentation of this file.
1#pragma once
2#include <QByteArray>
3#include <QPair>
4#include <QStringList>
5#include <QUrl>
6#include <QVariant>
7#include <TGlobal>
8
10
11
13public:
14 virtual ~TActionHelper() { }
15 QUrl url(const QString &controller = QString(), const QString &action = QString(),
16 const QStringList &args = QStringList(), const QVariantMap &query = QVariantMap()) const;
17 QUrl url(const QString &controller, const QString &action, const QStringList &args,
18 const QString &query) const;
19 QUrl url(const QString &controller, const QString &action, int arg) const;
20 QUrl url(const QString &controller, const QString &action, uint arg) const;
21 QUrl url(const QString &controller, const QString &action, int64_t arg) const;
22 QUrl url(const QString &controller, const QString &action, uint64_t arg) const;
23 QUrl url(const QString &controller, const QString &action, const QString &arg) const;
24 QUrl url(const QString &controller, const QString &action, const QVariant &arg) const;
25 QUrl url(const QString &controller, const QString &action, const QVariantMap &query) const;
26
27 QUrl urla(const QString &action = QString(), const QStringList &args = QStringList(),
28 const QVariantMap &query = QVariantMap()) const;
29 QUrl urla(const QString &action, const QStringList &args, const QString &query) const;
30 QUrl urla(const QString &action, int arg) const;
31 QUrl urla(const QString &action, uint arg) const;
32 QUrl urla(const QString &action, int64_t arg) const;
33 QUrl urla(const QString &action, uint64_t arg) const;
34 QUrl urla(const QString &action, const QString &arg) const;
35 QUrl urla(const QString &action, const QVariant &arg) const;
36 QUrl urla(const QString &action, const QVariantMap &query) const;
37
38 QUrl urlq(const QVariantMap &query) const;
39 QUrl urlq(const QString &query) const;
40
41protected:
42 virtual const TAbstractController *controller() const = 0;
43};
44
45
46inline QUrl TActionHelper::url(const QString &controller, const QString &action, int arg) const
47{
48 return url(controller, action, QStringList(QString::number(arg)));
49}
50
51inline QUrl TActionHelper::url(const QString &controller, const QString &action, uint arg) const
52{
53 return url(controller, action, QStringList(QString::number(arg)));
54}
55
56inline QUrl TActionHelper::url(const QString &controller, const QString &action, int64_t arg) const
57{
58 return url(controller, action, QStringList(QString::number(arg)));
59}
60
61inline QUrl TActionHelper::url(const QString &controller, const QString &action, uint64_t arg) const
62{
63 return url(controller, action, QStringList(QString::number(arg)));
64}
65
66inline QUrl TActionHelper::url(const QString &controller, const QString &action, const QString &arg) const
67{
68 return url(controller, action, QStringList(arg));
69}
70
71inline QUrl TActionHelper::url(const QString &controller, const QString &action, const QVariantMap &query) const
72{
73 return url(controller, action, QStringList(), query);
74}
75
76inline QUrl TActionHelper::urla(const QString &action, const QStringList &args, const QVariantMap &query) const
77{
78 return url(QString(), action, args, query);
79}
80
81inline QUrl TActionHelper::urla(const QString &action, const QStringList &args, const QString &query) const
82{
83 return url(QString(), action, args, query);
84}
85
86inline QUrl TActionHelper::urla(const QString &action, const QString &arg) const
87{
88 return url(QString(), action, QStringList(arg));
89}
90
91inline QUrl TActionHelper::urla(const QString &action, int arg) const
92{
93 return url(QString(), action, QStringList(QString::number(arg)));
94}
95
96inline QUrl TActionHelper::urla(const QString &action, uint arg) const
97{
98 return url(QString(), action, QStringList(QString::number(arg)));
99}
100
101inline QUrl TActionHelper::urla(const QString &action, int64_t arg) const
102{
103 return url(QString(), action, QStringList(QString::number(arg)));
104}
105
106inline QUrl TActionHelper::urla(const QString &action, uint64_t arg) const
107{
108 return url(QString(), action, QStringList(QString::number(arg)));
109}
110
111inline QUrl TActionHelper::urla(const QString &action, const QVariantMap &query) const
112{
113 return url(QString(), action, QStringList(), query);
114}
115
116inline QUrl TActionHelper::urlq(const QVariantMap &query) const
117{
118 return url(QString(), QString(), QStringList(), query);
119}
120
121inline QUrl TActionHelper::urlq(const QString &query) const
122{
123 return url(QString(), QString(), QStringList(), query);
124}
125
The TAbstractController class is the abstract base class of controllers, providing functionality comm...
Definition tabstractcontroller.h:13
The TActionHelper class is the base class of all helpers.
Definition tactionhelper.h:12
virtual const TAbstractController * controller() const =0
QUrl urlq(const QVariantMap &query) const
This function overloads url(const QString &, const QString &, const QStringList &,...
Definition tactionhelper.h:116
virtual ~TActionHelper()
Definition tactionhelper.h:14
QUrl url(const QString &controller=QString(), const QString &action=QString(), const QStringList &args=QStringList(), const QVariantMap &query=QVariantMap()) const
Returns a QUrl to action of controller with arguments args.
Definition tactionhelper.cpp:27
QUrl urla(const QString &action=QString(), const QStringList &args=QStringList(), const QVariantMap &query=QVariantMap()) const
Returns a QUrl to action of the current controller with arguments args.
Definition tactionhelper.h:76
#define T_CORE_EXPORT
Definition tdeclexport.h:28