Cutelee
6.2.0
i18ntags.h
1
/*
2
This file is part of the Cutelee template system.
3
4
Copyright (c) 2010 Stephen Kelly <steveire@gmail.com>
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either version
9
2 of the Licence, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
19
*/
20
21
#ifndef I18N_TAGS_H
22
#define I18N_TAGS_H
23
24
#include "taglibraryinterface.h"
25
26
#include "i18n.h"
27
#include "i18nc.h"
28
#include "i18ncp.h"
29
#include "i18np.h"
30
#include "l10n_money.h"
31
#include "l10n_filesize.h"
32
#include "with_locale.h"
33
34
namespace
Cutelee
35
{
36
class
Parser
;
37
}
38
39
using namespace
Cutelee
;
40
41
class
I18nTagLibrary :
public
QObject
,
public
TagLibraryInterface
42
{
43
Q_OBJECT
44
Q_INTERFACES
(
Cutelee::TagLibraryInterface
)
45
Q_PLUGIN_METADATA(IID
"org.cutelee.TagLibraryInterface"
)
46
public
:
47
I18nTagLibrary() {}
48
49
QHash<QString, AbstractNodeFactory *>
nodeFactories
(
const
QString
&name
50
= {})
override
51
{
52
Q_UNUSED(name);
53
54
QHash<QString, AbstractNodeFactory *>
nodeFactories
;
55
nodeFactories
.
insert
(QStringLiteral(
"i18n"
),
new
I18nNodeFactory
());
56
nodeFactories
.insert(QStringLiteral(
"i18n_var"
),
new
I18nVarNodeFactory
());
57
nodeFactories
.insert(QStringLiteral(
"i18nc"
),
new
I18ncNodeFactory
());
58
nodeFactories
.insert(QStringLiteral(
"i18nc_var"
),
59
new
I18ncVarNodeFactory
());
60
nodeFactories
.insert(QStringLiteral(
"i18np"
),
new
I18npNodeFactory
());
61
nodeFactories
.insert(QStringLiteral(
"i18np_var"
),
62
new
I18npVarNodeFactory
());
63
nodeFactories
.insert(QStringLiteral(
"i18ncp"
),
new
I18ncpNodeFactory
());
64
nodeFactories
.insert(QStringLiteral(
"i18ncp_var"
),
65
new
I18ncpVarNodeFactory
());
66
nodeFactories
.insert(QStringLiteral(
"l10n_money"
),
67
new
L10nMoneyNodeFactory
());
68
nodeFactories
.insert(QStringLiteral(
"l10n_money_var"
),
69
new
L10nMoneyVarNodeFactory
());
70
nodeFactories
.insert(QStringLiteral(
"l10n_filesize"
),
71
new
L10nFileSizeNodeFactory
());
72
nodeFactories
.insert(QStringLiteral(
"l10n_filesize_var"
),
73
new
L10nFileSizeVarNodeFactory
());
74
nodeFactories
.insert(QStringLiteral(
"with_locale"
),
75
new
WithLocaleNodeFactory
());
76
// TODO: Compat and block tags
77
return
nodeFactories
;
78
}
79
};
80
81
#endif
Cutelee::Parser
The Parser class processes a string template into a tree of nodes.
Definition
parser.h:49
Cutelee::TagLibraryInterface
The TagLibraryInterface returns available tags and filters from libraries.
Definition
taglibraryinterface.h:80
I18nNodeFactory
Definition
i18n.h:34
I18nTagLibrary::nodeFactories
QHash< QString, AbstractNodeFactory * > nodeFactories(const QString &name={}) override
Definition
i18ntags.h:49
I18nVarNodeFactory
Definition
i18n.h:43
I18ncNodeFactory
Definition
i18nc.h:34
I18ncVarNodeFactory
Definition
i18nc.h:43
I18ncpNodeFactory
Definition
i18ncp.h:34
I18ncpVarNodeFactory
Definition
i18ncp.h:43
I18npNodeFactory
Definition
i18np.h:34
I18npVarNodeFactory
Definition
i18np.h:43
L10nFileSizeNodeFactory
Definition
l10n_filesize.h:33
L10nFileSizeVarNodeFactory
Definition
l10n_filesize.h:42
L10nMoneyNodeFactory
Definition
l10n_money.h:34
L10nMoneyVarNodeFactory
Definition
l10n_money.h:43
WithLocaleNodeFactory
Definition
with_locale.h:29
Cutelee
The Cutelee namespace holds all public Cutelee API.
Definition
Mainpage.dox:8
QHash
QHash::insert
QHash< Key, T >::iterator insert(const Key &key, const T &value)
QObject::QObject
QObject(QObject *parent)
QObject::Q_INTERFACES
Q_INTERFACES(...)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QString
templates
i18n
i18ntags.h
Generated by
1.14.0