File indexing completed on 2024-06-16 04:49:54

0001 /*
0002     SPDX-FileCopyrightText: 2014 Christian Mollekopf <mollekopf@kolabsys.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include "entities.h"
0009 #include "private/protocol_p.h"
0010 
0011 class DbInitializer
0012 {
0013 public:
0014     ~DbInitializer();
0015     Akonadi::Server::Resource createResource(const char *name);
0016     Akonadi::Server::Collection createCollection(const char *name, const Akonadi::Server::Collection &parent = Akonadi::Server::Collection());
0017     Akonadi::Server::PimItem createItem(const char *name, const Akonadi::Server::Collection &parent);
0018     Akonadi::Server::Part createPart(qint64 pimitemId, const QByteArray &partname, const QByteArray &data);
0019     QByteArray toByteArray(bool enabled);
0020     QByteArray toByteArray(Akonadi::Server::Collection::Tristate tristate);
0021     Akonadi::Protocol::FetchCollectionsResponsePtr
0022     listResponse(const Akonadi::Server::Collection &col, bool ancestors = false, bool mimetypes = true, const QStringList &ancestorFetchScope = QStringList());
0023     Akonadi::Protocol::FetchItemsResponsePtr fetchResponse(const Akonadi::Server::PimItem &item);
0024     Akonadi::Server::Collection collection(const char *name);
0025 
0026     void cleanup();
0027 
0028 private:
0029     Akonadi::Server::Resource mResource;
0030 };