File indexing completed on 2025-02-16 04:45:49

0001 /*
0002   This file is part of KAddressBook.
0003 
0004   SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0005 
0006   SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include "abstractcontactgroupformatter.h"
0012 #include "akonadi-contact-core_export.h"
0013 
0014 #include <memory>
0015 
0016 namespace GrantleeTheme
0017 {
0018 class Theme;
0019 }
0020 
0021 namespace KAddressBookGrantlee
0022 {
0023 class GrantleeContactGroupFormatterPrivate;
0024 
0025 /**
0026  * @short A class that formats a contact group as HTML code.
0027  *
0028  * @author Tobias Koenig <tokoe@kde.org>
0029  */
0030 class AKONADI_CONTACT_CORE_EXPORT GrantleeContactGroupFormatter : public Akonadi::AbstractContactGroupFormatter
0031 {
0032 public:
0033     /**
0034      * Creates a new grantlee contact group formatter.
0035      */
0036     explicit GrantleeContactGroupFormatter();
0037 
0038     void setGrantleeTheme(const GrantleeTheme::Theme &theme);
0039     void setAbsoluteThemePath(const QString &path);
0040 
0041     /**
0042      * Destroys the grantlee contact group formatter.
0043      */
0044     ~GrantleeContactGroupFormatter() override;
0045 
0046     /**
0047      * Returns the contact group formatted as HTML
0048      */
0049     [[nodiscard]] QString toHtml(HtmlForm form = SelfcontainedForm) const override;
0050 
0051 private:
0052     //@cond PRIVATE
0053     std::unique_ptr<GrantleeContactGroupFormatterPrivate> const d;
0054     //@endcond
0055 };
0056 }