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

0001 /*
0002     SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadicore_export.h"
0010 #include "job.h"
0011 
0012 namespace Akonadi
0013 {
0014 class SearchResultJobPrivate;
0015 class ImapSet;
0016 class Collection;
0017 
0018 class AKONADICORE_EXPORT SearchResultJob : public Akonadi::Job
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit SearchResultJob(const QByteArray &searchId, const Collection &collection, QObject *parent = nullptr);
0023     ~SearchResultJob() override;
0024 
0025     void setSearchId(const QByteArray &searchId);
0026     [[nodiscard]] QByteArray searchId() const;
0027 
0028     void setResult(const ImapSet &set);
0029     void setResult(const QList<QByteArray> &remoteIds);
0030     void setResult(const QList<qint64> &ids);
0031 
0032 protected:
0033     void doStart() override;
0034     bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override;
0035 
0036 private:
0037     Q_DECLARE_PRIVATE(SearchResultJob)
0038 };
0039 }