Akonadi

itemretrievaljob.h
1/*
2 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QObject>
10
11#include "itemretrievalrequest.h"
12
14class OrgFreedesktopAkonadiResourceInterface;
15
16namespace Akonadi
17{
18namespace Server
19{
20class ItemRetrievalRequest;
21
22class AbstractItemRetrievalJob : public QObject
23{
25public:
26 AbstractItemRetrievalJob(ItemRetrievalRequest req, QObject *parent);
27 ~AbstractItemRetrievalJob() override = default;
28
29 virtual void start() = 0;
30 virtual void kill() = 0;
31
32 const ItemRetrievalRequest &request() const
33 {
34 return m_result.request;
35 }
36 const ItemRetrievalResult &result() const
37 {
38 return m_result;
39 }
40
42 void requestCompleted(Akonadi::Server::AbstractItemRetrievalJob *job);
43
44protected:
45 ItemRetrievalResult m_result;
46};
47
48/// Async D-Bus retrieval, no modification of the request (thus no need for locking)
49class ItemRetrievalJob : public AbstractItemRetrievalJob
50{
52public:
54 : AbstractItemRetrievalJob(std::move(req), parent)
55 {
56 }
57
58 void setInterface(OrgFreedesktopAkonadiResourceInterface *interface)
59 {
60 m_interface = interface;
61 }
62
63 ~ItemRetrievalJob() override;
64 void start() override;
65 void kill() override;
66
67private Q_SLOTS:
68 void callFinished(QDBusPendingCallWatcher *watcher);
69
70private:
71 bool m_active = false;
72 OrgFreedesktopAkonadiResourceInterface *m_interface = nullptr;
73};
74
75} // namespace Server
76} // namespace Akonadi
Async D-Bus retrieval, no modification of the request (thus no need for locking)
Details of a single item retrieval request.
Helper integration between Akonadi and Qt.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.