GrantleeTheme

kdegrantleeplugin.cpp
1 /*
2  * SPDX-FileCopyrightText: 2015 Daniel Vr├ítil <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 
8 #include "kdegrantleeplugin.h"
9 #include "color.h"
10 #include "colorscheme.h"
11 #include "icon.h"
12 #include "palette.h"
13 
14 KDEGrantleePlugin::KDEGrantleePlugin(QObject *parent)
15  : QObject(parent)
16 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
17  , Grantlee::TagLibraryInterface()
18 #else
19  , KTextTemplate::TagLibraryInterface()
20 #endif
21 {
22  Color::registerMetaType();
23  ColorScheme::registerMetaType();
24  Palette::registerMetaType();
25 }
26 
27 KDEGrantleePlugin::~KDEGrantleePlugin() = default;
28 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
29 QHash<QString, Grantlee::AbstractNodeFactory *> KDEGrantleePlugin::nodeFactories(const QString &name)
30 #else
31 QHash<QString, KTextTemplate::AbstractNodeFactory *> KDEGrantleePlugin::nodeFactories(const QString &name)
32 #endif
33 {
34  Q_UNUSED(name)
35 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
37 #else
39 #endif
40  nodeFactories[QStringLiteral("colorMix")] = new ColorMixTag();
41  nodeFactories[QStringLiteral("icon")] = new IconTag();
42 
43  return nodeFactories;
44 }
45 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
46 QHash<QString, Grantlee::Filter *> KDEGrantleePlugin::filters(const QString &name)
47 #else
48 QHash<QString, KTextTemplate::Filter *> KDEGrantleePlugin::filters(const QString &name)
49 #endif
50 {
51  Q_UNUSED(name)
52 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
54 #else
56 #endif
57  filters.insert(QStringLiteral("colorHexRgb"), new ColorHexRgbFilter());
58  filters.insert(QStringLiteral("colorCssRgba"), new ColorCssRgbaFilter());
59  filters.insert(QStringLiteral("colorLighter"), new ColorLighterFilter());
60  filters.insert(QStringLiteral("colorDarker"), new ColorDarkerFilter());
61  filters.insert(QStringLiteral("colorSetAlpha"), new ColorSetAlphaFilter());
62  return filters;
63 }
QHash::iterator insert(const Key &key, const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:06:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.