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 "abstractcontactformatter.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 GrantleeContactFormatterPrivate;
0024 
0025 /**
0026  * @short A class that formats a contact as HTML code.
0027  *
0028  * @author Tobias Koenig <tokoe@kde.org>
0029  */
0030 class AKONADI_CONTACT_CORE_EXPORT GrantleeContactFormatter : public Akonadi::AbstractContactFormatter
0031 {
0032 public:
0033     /**
0034      * Creates a new grantlee contact formatter.
0035      */
0036     explicit GrantleeContactFormatter();
0037 
0038     /**
0039      * Destroys the grantlee contact formatter.
0040      */
0041     ~GrantleeContactFormatter() override;
0042 
0043     void setAbsoluteThemePath(const QString &path);
0044 
0045     void setGrantleeTheme(const GrantleeTheme::Theme &theme);
0046 
0047     void setForceDisableQRCode(bool b);
0048     [[nodiscard]] bool forceDisableQRCode() const;
0049 
0050     /**
0051      * Returns the contact formatted as HTML
0052      */
0053     [[nodiscard]] QString toHtml(HtmlForm form = SelfcontainedForm) const override;
0054 
0055     void setShowQRCode(bool b);
0056 
0057     /** Translation domain for the Grantlee localizer. */
0058     void setApplicationDomain(const QByteArray &domain);
0059 
0060 private:
0061     //@cond PRIVATE
0062     std::unique_ptr<GrantleeContactFormatterPrivate> const d;
0063     //@endcond
0064 };
0065 }