File indexing completed on 2024-11-24 04:44:17
0001 /* 0002 SPDX-FileCopyrightText: 2014 Christian Mollekopf <mollekopf@kolabsys.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "pimkolab/kolabformat/formathelpers.h" //libkolab 0010 #include "pimkolab/kolabformat/kolabdefinitions.h" //libkolab 0011 #include <Akonadi/Item> 0012 0013 #define KOLAB_COLOR_ANNOTATION "/vendor/kolab/color" 0014 0015 class QColor; 0016 0017 class KolabHelpers 0018 { 0019 public: 0020 static bool checkForErrors(const Akonadi::Item &affectedItem); 0021 static Akonadi::Item translateFromImap(Kolab::FolderType folderType, const Akonadi::Item &item, bool &ok); 0022 static Akonadi::Item::List translateToImap(const Akonadi::Item::List &items, bool &ok); 0023 static Akonadi::Item translateToImap(const Akonadi::Item &item, bool &ok); 0024 static Kolab::FolderType folderTypeFromString(const QByteArray &folderTypeName); 0025 static QByteArray getFolderTypeAnnotation(const QMap<QByteArray, QByteArray> &annotations); 0026 static void setFolderTypeAnnotation(QMap<QByteArray, QByteArray> &annotations, const QByteArray &value); 0027 static QColor getFolderColor(const QMap<QByteArray, QByteArray> &annotations); 0028 static void setFolderColor(QMap<QByteArray, QByteArray> &annotations, const QColor &color); 0029 static Kolab::ObjectType getKolabTypeFromMimeType(const QString &type); 0030 static QByteArray kolabTypeForMimeType(const QStringList &contentMimeTypes); 0031 static QStringList getContentMimeTypes(Kolab::FolderType type); 0032 static QString getIcon(Kolab::FolderType type); 0033 // Returns true if the folder type shouldn't be ignored 0034 static bool isHandledType(Kolab::FolderType type); 0035 static QString getMimeType(Kolab::FolderType type); 0036 static QList<QByteArray> ancestorChain(const Akonadi::Collection &col); 0037 static QString createMemberUrl(const Akonadi::Item &item, const QString &user); 0038 };