File indexing completed on 2025-03-09 04:54:33
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QMap> 0010 #include <QObject> 0011 namespace MessageViewer 0012 { 0013 class WebEngineEmbedPart : public QObject 0014 { 0015 Q_OBJECT 0016 public: 0017 explicit WebEngineEmbedPart(QObject *parent = nullptr); 0018 ~WebEngineEmbedPart() override; 0019 0020 void clear(); 0021 [[nodiscard]] bool isEmpty() const; 0022 0023 [[nodiscard]] QMap<QString, QString> embeddedPartMap() const; 0024 0025 void addEmbedPart(const QByteArray &contentId, const QString &contentURL); 0026 [[nodiscard]] QString contentUrl(const QString &contentId) const; 0027 0028 static WebEngineEmbedPart *self(); 0029 0030 private: 0031 // Key is Content-Id, value is URL 0032 QMap<QString, QString> mEmbeddedPartMap; 0033 }; 0034 }