KContacts

contactgrouptool.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2008 Tobias Koenig <[email protected]>
4  SPDX-FileCopyrightText: 2008 Kevin Krammer <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KCONTACTS_CONTACTGROUPTOOL_H
10 #define KCONTACTS_CONTACTGROUPTOOL_H
11 
12 #include "kcontacts_export.h"
13 #include <QString>
14 class QIODevice;
15 
16 template<class T>
17 class QList;
18 
19 namespace KContacts
20 {
21 class ContactGroup;
22 
23 /**
24  * Static methods for converting ContactGroup to XML format and vice versa.
25  *
26  * @author Kevin Krammer <[email protected]>
27  * @since 4.3
28  */
29 namespace ContactGroupTool
30 {
31 /**
32  * Converts XML data coming from a @p device into a contact @p group.
33  * If an error occurs, @c false is returned and @p errorMessage is set.
34  */
35 Q_REQUIRED_RESULT KCONTACTS_EXPORT bool convertFromXml(QIODevice *device, ContactGroup &group, QString *errorMessage = nullptr);
36 
37 /**
38  * Converts a contact @p group into XML data and writes them to a @p device.
39  * If an error occurs, @c false is returned and @p errorMessage is set.
40  */
41 Q_REQUIRED_RESULT KCONTACTS_EXPORT bool convertToXml(const ContactGroup &group, QIODevice *device, QString *errorMessage = nullptr);
42 
43 /**
44  * Converts XML data coming from a @p device into a @p list of contact groups.
45  * If an error occurs, @c false is returned and @p errorMessage is set.
46  */
47 Q_REQUIRED_RESULT KCONTACTS_EXPORT bool convertFromXml(QIODevice *device, QVector<ContactGroup> &list, QString *errorMessage = nullptr);
48 
49 /**
50  * Converts a @p list of contact groups into XML data and writes them to a @p device.
51  * If an error occurs, @c false is returned and @p errorMessage is set.
52  */
53 Q_REQUIRED_RESULT KCONTACTS_EXPORT bool convertToXml(const QVector<ContactGroup> &list, QIODevice *device, QString *errorMessage = nullptr);
54 }
55 }
56 
57 #endif
KCONTACTS_EXPORT bool convertFromXml(QIODevice *device, ContactGroup &group, QString *errorMessage=nullptr)
Converts XML data coming from a device into a contact group.
KCONTACTS_EXPORT bool convertToXml(const ContactGroup &group, QIODevice *device, QString *errorMessage=nullptr)
Converts a contact group into XML data and writes them to a device.
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
This class represents a group of contacts.
Definition: contactgroup.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:49:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.