File indexing completed on 2024-05-19 05:14:01

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include <QWidget>
0009 
0010 #include <KContacts/Addressee>
0011 
0012 class QTabWidget;
0013 
0014 namespace Akonadi
0015 {
0016 class ContactViewer;
0017 class ContactGroupViewer;
0018 }
0019 
0020 namespace KAddressBookGrantlee
0021 {
0022 class GrantleeContactFormatter;
0023 class GrantleeContactGroupFormatter;
0024 }
0025 
0026 class ContactPreviewWidget : public QWidget
0027 {
0028     Q_OBJECT
0029 public:
0030     explicit ContactPreviewWidget(const QString &projectDirectory, QWidget *parent = nullptr);
0031     ~ContactPreviewWidget() override;
0032 
0033     void updateViewer();
0034     void createScreenShot(const QStringList &fileName);
0035     void setThemePath(const QString &projectDirectory);
0036     void loadConfig();
0037 
0038 private:
0039     KContacts::Addressee mContact;
0040     Akonadi::ContactViewer *mContactViewer = nullptr;
0041     Akonadi::ContactGroupViewer *mGroupViewer = nullptr;
0042 
0043     KAddressBookGrantlee::GrantleeContactFormatter *mFormatter = nullptr;
0044     KAddressBookGrantlee::GrantleeContactGroupFormatter *mGroupFormatter = nullptr;
0045 
0046     QTabWidget *mTabWidget = nullptr;
0047 };