File indexing completed on 2024-11-10 04:40:53
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 <QObject> 0010 #include <QString> 0011 0012 #include <memory> 0013 0014 class QDBusServiceWatcher; 0015 class OrgFreedesktopAkonadiAgentSearchInterface; 0016 0017 namespace Akonadi 0018 { 0019 namespace Server 0020 { 0021 class SearchTaskManager; 0022 class AgentSearchInstance : public QObject 0023 { 0024 Q_OBJECT 0025 public: 0026 explicit AgentSearchInstance(const QString &id, SearchTaskManager &manager); 0027 ~AgentSearchInstance() override; 0028 0029 bool init(); 0030 0031 void search(const QByteArray &searchId, const QString &query, qlonglong collectionId); 0032 0033 OrgFreedesktopAkonadiAgentSearchInterface *interface() const; 0034 0035 private: 0036 QString mId; 0037 OrgFreedesktopAkonadiAgentSearchInterface *mInterface; 0038 std::unique_ptr<QDBusServiceWatcher> mServiceWatcher; 0039 SearchTaskManager &mManager; 0040 }; 0041 0042 } // namespace Server 0043 } // namespace Akonadi