Akonadi

xmlwriter.h
1/*
2 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org>
3 SPDX-FileCopyrightText: 2009 Igor Trindade Oliveira <igor_trindade@yahoo.com.br>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "akonadi-xml_export.h"
11
12#include <QDomElement>
13
14namespace Akonadi
15{
16class Attribute;
17class Collection;
18class Item;
19
20/**
21 Low-level methods to serialize Akonadi objects into XML.
22 @see Akonadi::XmlDocument
23*/
24namespace XmlWriter
25{
26/**
27 Creates an attribute element for the given document.
28*/
29[[nodiscard]] AKONADI_XML_EXPORT QDomElement attributeToElement(Attribute *attr, QDomDocument &document);
30
31/**
32 Serializes all attributes of the given Akonadi object into the given parent element.
33*/
34AKONADI_XML_EXPORT void writeAttributes(const Item &entity, QDomElement &parentElem);
35
36/**
37 Serializes all attributes of the given Akonadi object into the given parent element.
38*/
39AKONADI_XML_EXPORT void writeAttributes(const Collection &entity, QDomElement &parentElem);
40
41/**
42 Creates a collection element for the given document, not yet attached to the DOM tree.
43*/
44[[nodiscard]] AKONADI_XML_EXPORT QDomElement collectionToElement(const Collection &collection, QDomDocument &document);
45
46/**
47 Serializes the given collection into a DOM element with the given parent.
48*/
49AKONADI_XML_EXPORT QDomElement writeCollection(const Collection &collection, QDomElement &parentElem);
50
51/**
52 Creates an item element for the given document, not yet attached to the DOM tree
53*/
54[[nodiscard]] AKONADI_XML_EXPORT QDomElement itemToElement(const Item &item, QDomDocument &document);
55
56/**
57 Serializes the given item into a DOM element and attaches it to the given item.
58*/
59AKONADI_XML_EXPORT QDomElement writeItem(const Item &item, QDomElement &parentElem);
60}
61
62}
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:100
AKONADI_XML_EXPORT QDomElement writeItem(const Item &item, QDomElement &parentElem)
Serializes the given item into a DOM element and attaches it to the given item.
AKONADI_XML_EXPORT void writeAttributes(const Item &entity, QDomElement &parentElem)
Serializes all attributes of the given Akonadi object into the given parent element.
Definition xmlwriter.cpp:45
AKONADI_XML_EXPORT QDomElement writeCollection(const Collection &collection, QDomElement &parentElem)
Serializes the given collection into a DOM element with the given parent.
Definition xmlwriter.cpp:70
AKONADI_XML_EXPORT QDomElement itemToElement(const Item &item, QDomDocument &document)
Creates an item element for the given document, not yet attached to the DOM tree.
Definition xmlwriter.cpp:82
AKONADI_XML_EXPORT QDomElement collectionToElement(const Collection &collection, QDomDocument &document)
Creates a collection element for the given document, not yet attached to the DOM tree.
Definition xmlwriter.cpp:55
AKONADI_XML_EXPORT QDomElement attributeToElement(Attribute *attr, QDomDocument &document)
Creates an attribute element for the given document.
Definition xmlwriter.cpp:17
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.