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

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 "job.h"
0010 
0011 namespace Akonadi
0012 {
0013 class Relation;
0014 class RelationCreateJobPrivate;
0015 
0016 /**
0017  * @short Job that creates a new relation in the Akonadi storage.
0018  * @since 4.15
0019  */
0020 class AKONADICORE_EXPORT RelationCreateJob : public Job
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     /**
0026      * Creates a new relation create job.
0027      *
0028      * @param relation The relation to create.
0029      * @param parent The parent object.
0030      */
0031     explicit RelationCreateJob(const Relation &relation, QObject *parent = nullptr);
0032 
0033     /**
0034      * Returns the relation.
0035      */
0036     [[nodiscard]] Relation relation() const;
0037 
0038 protected:
0039     void doStart() override;
0040     bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override;
0041 
0042 private:
0043     Q_DECLARE_PRIVATE(RelationCreateJob)
0044 };
0045 
0046 }