Akonadi

xmlreader.h
1/*
2 SPDX-FileCopyrightText: 2009 Igor Trindade Oliveira <igor_trindade@yahoo.com.br>
3 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "akonadi-xml_export.h"
11
12// AkonadiCore
13#include "akonadi/collection.h"
14#include "akonadi/item.h"
15
16#include <QDomElement>
17
18namespace Akonadi
19{
20class Attribute;
21
22/**
23 Low-level methods to transform DOM elements into the corresponding Akonadi objects.
24 @see Akonadi::XmlDocument
25*/
26namespace XmlReader
27{
28/**
29 Converts an attribute element.
30*/
31AKONADI_XML_EXPORT Attribute *elementToAttribute(const QDomElement &elem);
32
33/**
34 Reads all attributes that are immediate children of @p elem and adds them
35 to @p item.
36*/
37AKONADI_XML_EXPORT void readAttributes(const QDomElement &elem, Item &item);
38
39/**
40 Reads all attributes that are immediate children of @p elem and adds them
41 to @p collection.
42*/
43AKONADI_XML_EXPORT void readAttributes(const QDomElement &elem, Collection &collection);
44
45/**
46 Converts a collection element.
47*/
48[[nodiscard]] AKONADI_XML_EXPORT Collection elementToCollection(const QDomElement &elem);
49
50/**
51 Reads recursively all collections starting from the given DOM element.
52*/
53[[nodiscard]] AKONADI_XML_EXPORT Collection::List readCollections(const QDomElement &elem);
54
55/**
56 Converts a tag element.
57*/
58[[nodiscard]] AKONADI_XML_EXPORT Tag elementToTag(const QDomElement &elem);
59
60/**
61 Reads recursively all tags starting from the given DOM element.
62*/
63[[nodiscard]] AKONADI_XML_EXPORT Tag::List readTags(const QDomElement &elem);
64
65/**
66 Converts an item element.
67*/
68[[nodiscard]] AKONADI_XML_EXPORT Item elementToItem(const QDomElement &elem, bool includePayload = true);
69}
70
71}
Provides interface for custom attributes for Entity.
Definition attribute.h:132
Represents a collection of PIM items.
Definition collection.h:62
Represents a PIM item stored in Akonadi storage.
Definition item.h:101
An Akonadi Tag.
Definition tag.h:26
AKONADI_XML_EXPORT Attribute * elementToAttribute(const QDomElement &elem)
Converts an attribute element.
Definition xmlreader.cpp:16
AKONADI_XML_EXPORT void readAttributes(const QDomElement &elem, Item &item)
Reads all attributes that are immediate children of elem and adds them to item.
Definition xmlreader.cpp:43
AKONADI_XML_EXPORT Item elementToItem(const QDomElement &elem, bool includePayload=true)
Converts an item element.
AKONADI_XML_EXPORT Collection elementToCollection(const QDomElement &elem)
Converts a collection element.
Definition xmlreader.cpp:53
AKONADI_XML_EXPORT Tag elementToTag(const QDomElement &elem)
Converts a tag element.
Definition xmlreader.cpp:93
AKONADI_XML_EXPORT Collection::List readCollections(const QDomElement &elem)
Reads recursively all collections starting from the given DOM element.
Definition xmlreader.cpp:73
AKONADI_XML_EXPORT Tag::List readTags(const QDomElement &elem)
Reads recursively all tags starting from the given DOM element.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.