File indexing completed on 2025-07-06 03:42:03
0001 /* 0002 This file is part of the KTextTemplate library 0003 0004 SPDX-FileCopyrightText: 2011 Stephen Kelly <steveire@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.1-or-later 0007 0008 */ 0009 0010 #ifndef CUSTOM_TAGS_H 0011 #define CUSTOM_TAGS_H 0012 0013 #include <KTextTemplate/TagLibraryInterface> 0014 0015 #include "rssfeed.h" 0016 0017 using namespace KTextTemplate; 0018 0019 class CustomPlugin : public QObject, public TagLibraryInterface 0020 { 0021 Q_OBJECT 0022 Q_INTERFACES(KTextTemplate::TagLibraryInterface) 0023 Q_PLUGIN_METADATA(IID "org.kde.KTextTemplate.TagLibraryInterface") 0024 public: 0025 CustomPlugin(QObject *parent = 0) 0026 : QObject(parent) 0027 { 0028 } 0029 0030 virtual QHash<QString, AbstractNodeFactory *> nodeFactories(const QString &name = QString()) 0031 { 0032 Q_UNUSED(name); 0033 QHash<QString, AbstractNodeFactory *> facts; 0034 facts.insert("rssfeed", new RssFeedNodeFactory()); 0035 facts.insert("xmlrole", new XmlRoleNodeFactory()); 0036 facts.insert("xmlns", new XmlNamespaceNodeFactory()); 0037 return facts; 0038 } 0039 0040 virtual QHash<QString, Filter *> filters(const QString &name = QString()) 0041 { 0042 Q_UNUSED(name); 0043 QHash<QString, Filter *> _filters; 0044 _filters.insert("resize", new ResizeFilter); 0045 return _filters; 0046 } 0047 }; 0048 0049 #endif