File indexing completed on 2024-09-22 04:41:05

0001 /*
0002     SPDX-FileCopyrightText: 2011 Stephen Kelly <steveire@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "entitycache_p.h"
0010 #include "session.h"
0011 
0012 namespace Akonadi
0013 {
0014 class Connection;
0015 class CommandBuffer;
0016 
0017 /**
0018  * This class exists so that we can create a fake notification source in
0019  * unit tests.
0020  */
0021 class AKONADI_TESTS_EXPORT ChangeNotificationDependenciesFactory
0022 {
0023 public:
0024     explicit ChangeNotificationDependenciesFactory() = default;
0025     virtual ~ChangeNotificationDependenciesFactory() = default;
0026 
0027     virtual Connection *createNotificationConnection(Session *parent, CommandBuffer *commandBuffer);
0028     virtual void destroyNotificationConnection(Session *parent, Connection *connection);
0029 
0030     virtual QObject *createChangeMediator(QObject *parent);
0031 
0032     virtual Akonadi::CollectionCache *createCollectionCache(int maxCapacity, Session *session);
0033     virtual Akonadi::ItemCache *createItemCache(int maxCapacity, Session *session);
0034     virtual Akonadi::ItemListCache *createItemListCache(int maxCapacity, Session *session);
0035     virtual Akonadi::TagListCache *createTagListCache(int maxCapacity, Session *session);
0036 
0037 protected:
0038     Q_DISABLE_COPY_MOVE(ChangeNotificationDependenciesFactory)
0039 
0040     void addConnection(Session *session, Connection *connection);
0041 };
0042 
0043 }