File indexing completed on 2025-01-26 04:57:23
0001 /* 0002 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "webengineviewer_export.h" 0010 #include <QList> 0011 #include <QObject> 0012 namespace WebEngineViewer 0013 { 0014 struct Addition; 0015 struct Removal; 0016 struct WEBENGINEVIEWER_EXPORT UpdateDataBaseInfo { 0017 UpdateDataBaseInfo(); 0018 [[nodiscard]] bool isValid() const; 0019 0020 enum ResponseType { 0021 Unknown = 0, 0022 FullUpdate = 1, 0023 PartialUpdate = 2, 0024 }; 0025 0026 enum CompressionType { 0027 UnknownCompression = 0, 0028 RiceCompression = 1, 0029 RawCompression = 2, 0030 }; 0031 0032 QList<Addition> additionList; 0033 QList<Removal> removalList; 0034 QString minimumWaitDuration; 0035 QString threatType; 0036 QString threatEntryType; 0037 ResponseType responseType = Unknown; 0038 QString platformType; 0039 QString newClientState; 0040 QByteArray sha256; 0041 void clear(); 0042 bool operator==(const UpdateDataBaseInfo &other) const; 0043 }; 0044 0045 struct WEBENGINEVIEWER_EXPORT RiceDeltaEncoding { 0046 RiceDeltaEncoding(); 0047 bool operator==(const RiceDeltaEncoding &other) const; 0048 [[nodiscard]] bool isValid() const; 0049 QByteArray firstValue; 0050 QByteArray encodingData; 0051 int riceParameter; 0052 int numberEntries; 0053 }; 0054 0055 struct WEBENGINEVIEWER_EXPORT Addition { 0056 Addition(); 0057 [[nodiscard]] bool isValid() const; 0058 bool operator==(const Addition &other) const; 0059 0060 static bool lessThan(const Addition &s1, const Addition &s2); 0061 QByteArray hashString; 0062 RiceDeltaEncoding riceDeltaEncoding; 0063 UpdateDataBaseInfo::CompressionType compressionType; 0064 int prefixSize; 0065 }; 0066 0067 struct WEBENGINEVIEWER_EXPORT Removal { 0068 Removal(); 0069 bool operator==(const Removal &other) const; 0070 [[nodiscard]] bool isValid() const; 0071 QList<quint32> indexes; 0072 RiceDeltaEncoding riceDeltaEncoding; 0073 UpdateDataBaseInfo::CompressionType compressionType; 0074 }; 0075 } 0076 Q_DECLARE_METATYPE(WebEngineViewer::UpdateDataBaseInfo) 0077 Q_DECLARE_METATYPE(WebEngineViewer::UpdateDataBaseInfo::CompressionType) 0078 Q_DECLARE_TYPEINFO(WebEngineViewer::Addition, Q_RELOCATABLE_TYPE); 0079 Q_DECLARE_TYPEINFO(WebEngineViewer::Removal, Q_RELOCATABLE_TYPE); 0080 Q_DECLARE_TYPEINFO(WebEngineViewer::RiceDeltaEncoding, Q_RELOCATABLE_TYPE);