Messagelib

updatedatabaseinfo.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "webengineviewer_export.h"
10#include <QList>
11#include <QObject>
12namespace WebEngineViewer
13{
14struct Addition;
15struct Removal;
16struct WEBENGINEVIEWER_EXPORT UpdateDataBaseInfo {
17 UpdateDataBaseInfo();
18 [[nodiscard]] bool isValid() const;
19
20 enum ResponseType {
21 Unknown = 0,
22 FullUpdate = 1,
23 PartialUpdate = 2,
24 };
25
26 enum CompressionType {
27 UnknownCompression = 0,
28 RiceCompression = 1,
29 RawCompression = 2,
30 };
31
32 QList<Addition> additionList;
33 QList<Removal> removalList;
34 QString minimumWaitDuration;
35 QString threatType;
36 QString threatEntryType;
37 ResponseType responseType = Unknown;
38 QString platformType;
39 QString newClientState;
40 QByteArray sha256;
41 void clear();
42 [[nodiscard]] bool operator==(const UpdateDataBaseInfo &other) const;
43};
44
45struct WEBENGINEVIEWER_EXPORT RiceDeltaEncoding {
46 RiceDeltaEncoding();
47 [[nodiscard]] bool operator==(const RiceDeltaEncoding &other) const;
48 [[nodiscard]] bool isValid() const;
49 QByteArray firstValue;
50 QByteArray encodingData;
51 int riceParameter;
52 int numberEntries;
53};
54
55struct WEBENGINEVIEWER_EXPORT Addition {
56 Addition();
57 [[nodiscard]] bool isValid() const;
58 [[nodiscard]] bool operator==(const Addition &other) const;
59
60 [[nodiscard]] static bool lessThan(const Addition &s1, const Addition &s2);
61 QByteArray hashString;
62 RiceDeltaEncoding riceDeltaEncoding;
63 UpdateDataBaseInfo::CompressionType compressionType;
64 int prefixSize;
65};
66
67struct WEBENGINEVIEWER_EXPORT Removal {
68 Removal();
69 [[nodiscard]] bool operator==(const Removal &other) const;
70 [[nodiscard]] bool isValid() const;
71 QList<quint32> indexes;
72 RiceDeltaEncoding riceDeltaEncoding;
73 UpdateDataBaseInfo::CompressionType compressionType;
74};
75}
76Q_DECLARE_METATYPE(WebEngineViewer::UpdateDataBaseInfo)
77Q_DECLARE_METATYPE(WebEngineViewer::UpdateDataBaseInfo::CompressionType)
78Q_DECLARE_TYPEINFO(WebEngineViewer::Addition, Q_RELOCATABLE_TYPE);
79Q_DECLARE_TYPEINFO(WebEngineViewer::Removal, Q_RELOCATABLE_TYPE);
80Q_DECLARE_TYPEINFO(WebEngineViewer::RiceDeltaEncoding, Q_RELOCATABLE_TYPE);
KIOCORE_EXPORT bool operator==(const UDSEntry &entry, const UDSEntry &other)
bool isValid(QStringView ifopt)
KGuiItem clear()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.