File indexing completed on 2025-01-05 04:47:12
0001 /* 0002 SPDX-FileCopyrightText: 2009 Igor Trindade Oliveira <igor_trindade@yahoo.com.br> 0003 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include "akonadi-xml_export.h" 0011 0012 // AkonadiCore 0013 #include "akonadi/collection.h" 0014 #include "akonadi/item.h" 0015 0016 #include <QDomElement> 0017 0018 namespace Akonadi 0019 { 0020 class Attribute; 0021 0022 /** 0023 Low-level methods to transform DOM elements into the corresponding Akonadi objects. 0024 @see Akonadi::XmlDocument 0025 */ 0026 namespace XmlReader 0027 { 0028 /** 0029 Converts an attribute element. 0030 */ 0031 AKONADI_XML_EXPORT Attribute *elementToAttribute(const QDomElement &elem); 0032 0033 /** 0034 Reads all attributes that are immediate children of @p elem and adds them 0035 to @p item. 0036 */ 0037 AKONADI_XML_EXPORT void readAttributes(const QDomElement &elem, Item &item); 0038 0039 /** 0040 Reads all attributes that are immediate children of @p elem and adds them 0041 to @p collection. 0042 */ 0043 AKONADI_XML_EXPORT void readAttributes(const QDomElement &elem, Collection &collection); 0044 0045 /** 0046 Converts a collection element. 0047 */ 0048 [[nodiscard]] AKONADI_XML_EXPORT Collection elementToCollection(const QDomElement &elem); 0049 0050 /** 0051 Reads recursively all collections starting from the given DOM element. 0052 */ 0053 [[nodiscard]] AKONADI_XML_EXPORT Collection::List readCollections(const QDomElement &elem); 0054 0055 /** 0056 Converts a tag element. 0057 */ 0058 [[nodiscard]] AKONADI_XML_EXPORT Tag elementToTag(const QDomElement &elem); 0059 0060 /** 0061 Reads recursively all tags starting from the given DOM element. 0062 */ 0063 [[nodiscard]] AKONADI_XML_EXPORT Tag::List readTags(const QDomElement &elem); 0064 0065 /** 0066 Converts an item element. 0067 */ 0068 [[nodiscard]] AKONADI_XML_EXPORT Item elementToItem(const QDomElement &elem, bool includePayload = true); 0069 } 0070 0071 }