File indexing completed on 2025-03-09 04:54:37

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messageviewer_private_export.h"
0010 #include <QDebug>
0011 namespace MessageViewer
0012 {
0013 /**
0014  * @brief The RemoteContentInfo class
0015  * @author Laurent Montel <montel@kde.org>
0016  */
0017 class MESSAGEVIEWER_TESTS_EXPORT RemoteContentInfo
0018 {
0019     Q_GADGET
0020 public:
0021     enum class RemoteContentInfoStatus {
0022         Unknown,
0023         Blocked,
0024         Authorized,
0025     };
0026     Q_ENUM(RemoteContentInfoStatus)
0027 
0028     RemoteContentInfo();
0029     ~RemoteContentInfo();
0030 
0031     [[nodiscard]] QString url() const;
0032     void setUrl(const QString &url);
0033 
0034     [[nodiscard]] RemoteContentInfoStatus status() const;
0035     void setStatus(MessageViewer::RemoteContentInfo::RemoteContentInfoStatus status);
0036 
0037     [[nodiscard]] bool isValid() const;
0038 
0039 private:
0040     RemoteContentInfoStatus mStatus = RemoteContentInfoStatus::Unknown;
0041     QString mUrl;
0042 };
0043 }
0044 Q_DECLARE_TYPEINFO(MessageViewer::RemoteContentInfo, Q_RELOCATABLE_TYPE);
0045 MESSAGEVIEWER_EXPORT QDebug operator<<(QDebug d, const MessageViewer::RemoteContentInfo &t);