File indexing completed on 2024-11-24 04:44:34
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2009, 2010 Kevin Krammer <kevin.krammer@gmx.at> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "job.h" 0010 0011 #include <Akonadi/Item> 0012 0013 #include <memory> 0014 0015 namespace Akonadi 0016 { 0017 class Collection; 0018 class ItemFetchScope; 0019 0020 namespace FileStore 0021 { 0022 class AbstractJobSession; 0023 class ItemFetchJobPrivate; 0024 0025 /** 0026 */ 0027 class AKONADI_FILESTORE_EXPORT ItemFetchJob : public Job 0028 { 0029 friend class AbstractJobSession; 0030 0031 Q_OBJECT 0032 0033 public: 0034 explicit ItemFetchJob(const Collection &collection, AbstractJobSession *session = nullptr); 0035 0036 explicit ItemFetchJob(const Item &item, AbstractJobSession *session = nullptr); 0037 0038 explicit ItemFetchJob(const Item::List &items, AbstractJobSession *session = nullptr); 0039 0040 ~ItemFetchJob() override; 0041 0042 [[nodiscard]] Collection collection() const; 0043 0044 [[nodiscard]] Item item() const; 0045 0046 Item::List requestedItems() const; 0047 0048 void setFetchScope(const ItemFetchScope &fetchScope); 0049 0050 ItemFetchScope &fetchScope(); 0051 0052 [[nodiscard]] Item::List items() const; 0053 0054 bool accept(Visitor *visitor) override; 0055 0056 Q_SIGNALS: 0057 void itemsReceived(const Akonadi::Item::List &items); 0058 0059 private: 0060 void handleItemsReceived(const Akonadi::Item::List &items); 0061 0062 private: 0063 std::unique_ptr<ItemFetchJobPrivate> const d; 0064 }; 0065 } 0066 }