File indexing completed on 2025-01-05 04:49:40

0001 /*
0002    SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include <KTextTemplate/Filter>
0009 #include <KTextTemplate/TagLibraryInterface>
0010 #include <QObject>
0011 
0012 class AddressFormatter : public KTextTemplate::Filter
0013 {
0014 public:
0015     QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
0016     bool isSafe() const override;
0017 };
0018 
0019 class DateFormatter : public KTextTemplate::Filter
0020 {
0021 public:
0022     QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
0023 };
0024 
0025 class DateTimeFormatter : public KTextTemplate::Filter
0026 {
0027 public:
0028     QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
0029 };
0030 
0031 class TimeFormatter : public KTextTemplate::Filter
0032 {
0033 public:
0034     QVariant doFilter(const QVariant &input, const QVariant &arg, bool autoescape) const override;
0035 };
0036 
0037 class TagLibrary : public QObject, public KTextTemplate::TagLibraryInterface
0038 {
0039     Q_OBJECT
0040     Q_INTERFACES(KTextTemplate::TagLibraryInterface)
0041     Q_PLUGIN_METADATA(IID "org.grantlee.TagLibraryInterface")
0042 public:
0043     explicit TagLibrary(QObject *parent = nullptr);
0044     QHash<QString, KTextTemplate::Filter *> filters(const QString &name) override;
0045 };