File indexing completed on 2025-01-05 04:49:58
0001 /* 0002 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <KDAV/Enums> 0010 0011 #include <Akonadi/Item> 0012 0013 namespace KDAV 0014 { 0015 class DavItem; 0016 } 0017 0018 namespace Akonadi 0019 { 0020 class Collection; 0021 class Item; 0022 } 0023 0024 /** 0025 * @short A namespace that contains helper methods for DAV functionality. 0026 */ 0027 namespace Utils 0028 { 0029 /** 0030 * Returns the i18n'ed name of the given DAV @p protocol dialect. 0031 */ 0032 QString translatedProtocolName(KDAV::Protocol protocol); 0033 0034 /** 0035 * Returns the protocol matching the given i18n'ed @p name. This is the opposite 0036 * of Utils::translatedProtocolName(). 0037 */ 0038 KDAV::Protocol protocolByTranslatedName(const QString &name); 0039 0040 /** 0041 * Creates a new KDAV::DavItem from the Akonadi::Item @p item. 0042 * 0043 * The returned item will have no payload (DavItem::data() will return an empty 0044 * QByteArray) if the @p item payload is not recognized. 0045 */ 0046 KDAV::DavItem 0047 createDavItem(const Akonadi::Item &item, const Akonadi::Collection &collection, const Akonadi::Item::List &dependentItems = Akonadi::Item::List()); 0048 0049 /** 0050 * Parses the DAV data contained in @p source and puts it in @p target and @extraItems. 0051 */ 0052 bool parseDavData(const KDAV::DavItem &source, Akonadi::Item &target, Akonadi::Item::List &extraItems); 0053 }