Changeset View
Changeset View
Standalone View
Standalone View
resources/kolab/kolabhelpers.h
Show All 18 Lines | |||||
#ifndef KOLABHELPERS_H | #ifndef KOLABHELPERS_H | ||||
#define KOLABHELPERS_H | #define KOLABHELPERS_H | ||||
#include <Akonadi/Item> | #include <Akonadi/Item> | ||||
#include <kolabdefinitions.h> //libkolab | #include <kolabdefinitions.h> //libkolab | ||||
#include <formathelpers.h> //libkolab | #include <formathelpers.h> //libkolab | ||||
#define KOLAB_COLOR_ANNOTATION "/vendor/kolab/color" | |||||
class QColor; | |||||
class KolabHelpers { | class KolabHelpers { | ||||
public: | public: | ||||
static bool checkForErrors(const Akonadi::Item &affectedItem); | static bool checkForErrors(const Akonadi::Item &affectedItem); | ||||
static Akonadi::Item translateFromImap(Kolab::FolderType folderType, const Akonadi::Item &item, bool &ok); | static Akonadi::Item translateFromImap(Kolab::FolderType folderType, const Akonadi::Item &item, bool &ok); | ||||
static Akonadi::Item::List translateToImap(const Akonadi::Item::List &items, bool &ok); | static Akonadi::Item::List translateToImap(const Akonadi::Item::List &items, bool &ok); | ||||
static Akonadi::Item translateToImap(const Akonadi::Item &item, bool &ok); | static Akonadi::Item translateToImap(const Akonadi::Item &item, bool &ok); | ||||
static Kolab::FolderType folderTypeFromString(const QByteArray &folderTypeName); | static Kolab::FolderType folderTypeFromString(const QByteArray &folderTypeName); | ||||
static QByteArray getFolderTypeAnnotation( const QMap<QByteArray, QByteArray> &annotations); | static QByteArray getFolderTypeAnnotation( const QMap<QByteArray, QByteArray> &annotations); | ||||
static void setFolderTypeAnnotation( QMap<QByteArray, QByteArray> &annotations, const QByteArray &value); | static void setFolderTypeAnnotation( QMap<QByteArray, QByteArray> &annotations, const QByteArray &value); | ||||
static QColor getFolderColor(const QMap<QByteArray, QByteArray> &annotations); | |||||
static Kolab::ObjectType getKolabTypeFromMimeType(const QString &type); | static Kolab::ObjectType getKolabTypeFromMimeType(const QString &type); | ||||
static QByteArray kolabTypeForMimeType( const QStringList &contentMimeTypes ); | static QByteArray kolabTypeForMimeType( const QStringList &contentMimeTypes ); | ||||
static QStringList getContentMimeTypes(Kolab::FolderType type); | static QStringList getContentMimeTypes(Kolab::FolderType type); | ||||
static QString getMimeType(Kolab::FolderType type); | static QString getMimeType(Kolab::FolderType type); | ||||
static QString getIcon(Kolab::FolderType type); | static QString getIcon(Kolab::FolderType type); | ||||
//Returns true if the folder type shouldn't be ignored | //Returns true if the folder type shouldn't be ignored | ||||
static bool isHandledType(Kolab::FolderType type); | static bool isHandledType(Kolab::FolderType type); | ||||
static QList<QByteArray> ancestorChain(const Akonadi::Collection &col); | static QList<QByteArray> ancestorChain(const Akonadi::Collection &col); | ||||
static QString createMemberUrl(const Akonadi::Item &item, const QString &user); | static QString createMemberUrl(const Akonadi::Item &item, const QString &user); | ||||
}; | }; | ||||
#endif | #endif |