Akonadi

xmldocument.h
1 /*
2  SPDX-FileCopyrightText: 2009 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_XMLDOCUMENT_H
8 #define AKONADI_XMLDOCUMENT_H
9 
10 #include "akonadi-xml_export.h"
11 
12 #include "collection.h"
13 #include <item.h>
14 
15 #include <QDomDocument>
16 
17 namespace Akonadi
18 {
19 
20 class XmlDocumentPrivate;
21 
25 class AKONADI_XML_EXPORT XmlDocument
26 {
27 public:
31  XmlDocument();
32 
38  explicit XmlDocument(const QString &fileName);
39  ~XmlDocument();
40 
48  bool loadFile(const QString &fileName);
49 
53  bool writeToFile(const QString &fileName) const;
54 
59  Q_REQUIRED_RESULT bool isValid() const;
60 
66  Q_REQUIRED_RESULT QString lastError() const;
67 
71  QDomDocument &document() const;
72 
76  Q_REQUIRED_RESULT QDomElement collectionElement(const Collection &collection) const;
77 
81  Q_REQUIRED_RESULT QDomElement itemElementByRemoteId(const QString &rid) const;
82 
86  Q_REQUIRED_RESULT QDomElement collectionElementByRemoteId(const QString &rid) const;
87 
91  Q_REQUIRED_RESULT Collection collectionByRemoteId(const QString &rid) const;
92 
96  Q_REQUIRED_RESULT Item itemByRemoteId(const QString &rid, bool includePayload = true) const;
97 
101  Q_REQUIRED_RESULT Collection::List collections() const;
102 
106  Q_REQUIRED_RESULT Tag::List tags() const;
107 
111  Q_REQUIRED_RESULT Collection::List childCollections(const Collection &parentCollection) const;
112 
116  Q_REQUIRED_RESULT Item::List items(const Collection &collection, bool includePayload = true) const;
117 
118 private:
119  Q_DISABLE_COPY(XmlDocument)
120  XmlDocumentPrivate *const d;
121 };
122 
123 }
124 
125 #endif
Represents a document of the KNUT XML serialization format for Akonadi objects.
Definition: xmldocument.h:25
Represents a collection of PIM items.
Definition: collection.h:63
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:16:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.