File indexing completed on 2024-11-10 04:40:31

0001 /*
0002     SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 
0011 #include "servermanager.h"
0012 
0013 namespace Akonadi
0014 {
0015 /**
0016  * Base class for the private class of KJob but not Akonadi::Job based jobs that
0017  * require the Akonadi server to be operational.
0018  * Delays job execution until that is the case.
0019  * @internal
0020  */
0021 class KJobPrivateBase : public QObject
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     /** Call from KJob::start() reimplementation. */
0027     void start();
0028 
0029     /** Reimplement and put here what was in KJob::start() before. */
0030     virtual void doStart() = 0;
0031 
0032 private Q_SLOTS:
0033     void serverStateChanged(Akonadi::ServerManager::State state);
0034 };
0035 
0036 }