KItinerary

documentutil.h
1/*
2 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kitinerary_export.h"
10
11#include <QVariant>
12
13namespace KItinerary {
14
15/** Utilities for dealing with documents attached to objects.
16 * @see https://schema.org/subjectOf
17 */
18namespace DocumentUtil
19{
20 /** Determine a document identifier for the given content. */
21 KITINERARY_EXPORT QString idForContent(const QByteArray &data);
22
23 /** Determine a document identifier for a Apple Wallet pass. */
24 KITINERARY_EXPORT QString idForPkPass(const QString &passTypeIdentifier, const QString &serialNumber);
25
26 /** Add a document id to the object @p obj.
27 * @returns @c true if the document id wasn't present yet and the object changed, @p false otherwise.
28 */
29 KITINERARY_EXPORT bool addDocumentId(QVariant &obj, const QString &id);
30
31 /** Removes the document identifier @p id from object @p res.
32 * @returns @c true if the document id was present and the object changed, @p false otherwise.
33 */
34 KITINERARY_EXPORT bool removeDocumentId(QVariant &obj, const QString &id);
35
36 /** Returns all document identifiers associated with object @p obj. */
37 KITINERARY_EXPORT QVariantList documentIds(const QVariant &obj);
38
39 /** Sets the list of document identifiers for object @p obj. */
40 KITINERARY_EXPORT void setDocumentIds(QVariant &obj, const QVariantList &docIds);
41
42 /** Returns a Apple Wallet pass identifier if present in the documents ids of @p obj. */
43 KITINERARY_EXPORT QUrl pkPassId(const QVariant &obj);
44}
45
46}
47
QString idForContent(const QByteArray &data)
Determine a document identifier for the given content.
bool addDocumentId(QVariant &obj, const QString &id)
Add a document id to the object obj.
QString idForPkPass(const QString &passTypeIdentifier, const QString &serialNumber)
Determine a document identifier for a Apple Wallet pass.
bool removeDocumentId(QVariant &obj, const QString &id)
Removes the document identifier id from object res.
void setDocumentIds(QVariant &obj, const QVariantList &docIds)
Sets the list of document identifiers for object obj.
QVariantList documentIds(const QVariant &obj)
Returns all document identifiers associated with object obj.
QUrl pkPassId(const QVariant &obj)
Returns a Apple Wallet pass identifier if present in the documents ids of obj.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.