File indexing completed on 2024-11-24 04:41:43
0001 /* 0002 * SPDX-FileCopyrightText: 2015 Daniel Vrátil <dvratil@redhat.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-or-later 0005 * 0006 */ 0007 0008 #include "kdegrantleeplugin.h" 0009 #include "color.h" 0010 #include "colorscheme.h" 0011 #include "icon.h" 0012 #include "palette.h" 0013 0014 KDEGrantleePlugin::KDEGrantleePlugin(QObject *parent) 0015 : QObject(parent) 0016 , KTextTemplate::TagLibraryInterface() 0017 { 0018 Color::registerMetaType(); 0019 ColorScheme::registerMetaType(); 0020 Palette::registerMetaType(); 0021 } 0022 0023 KDEGrantleePlugin::~KDEGrantleePlugin() = default; 0024 QHash<QString, KTextTemplate::AbstractNodeFactory *> KDEGrantleePlugin::nodeFactories(const QString &name) 0025 { 0026 Q_UNUSED(name) 0027 QHash<QString, KTextTemplate::AbstractNodeFactory *> nodeFactories; 0028 nodeFactories[QStringLiteral("colorMix")] = new ColorMixTag(); 0029 nodeFactories[QStringLiteral("icon")] = new IconTag(); 0030 0031 return nodeFactories; 0032 } 0033 QHash<QString, KTextTemplate::Filter *> KDEGrantleePlugin::filters(const QString &name) 0034 { 0035 Q_UNUSED(name) 0036 QHash<QString, KTextTemplate::Filter *> filters; 0037 filters.insert(QStringLiteral("colorHexRgb"), new ColorHexRgbFilter()); 0038 filters.insert(QStringLiteral("colorCssRgba"), new ColorCssRgbaFilter()); 0039 filters.insert(QStringLiteral("colorLighter"), new ColorLighterFilter()); 0040 filters.insert(QStringLiteral("colorDarker"), new ColorDarkerFilter()); 0041 filters.insert(QStringLiteral("colorSetAlpha"), new ColorSetAlphaFilter()); 0042 return filters; 0043 } 0044 0045 #include "moc_kdegrantleeplugin.cpp"