Kgapi

postfetchjob.h
1/*
2 * SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7#pragma once
8
9#include "fetchjob.h"
10#include "kgapiblogger_export.h"
11
12#include <QStringList>
13
14#include <QDateTime>
15
16namespace KGAPI2
17{
18namespace Blogger
19{
20
21class KGAPIBLOGGER_EXPORT PostFetchJob : public KGAPI2::FetchJob
22{
23 Q_OBJECT
24
25 Q_PROPERTY(bool fetchBodies READ fetchBodies WRITE setFetchBodies)
26
27 Q_PROPERTY(bool fetchImages READ fetchImages WRITE setFetchImages)
28
29 Q_PROPERTY(uint maxResults READ maxResults WRITE setMaxResults)
30
31 Q_PROPERTY(QStringList filterLabels READ filterLabels WRITE setFilterLabels)
32
33 Q_PROPERTY(QDateTime startDate READ startDate WRITE setStartDate)
34
35 Q_PROPERTY(QDateTime endDate READ endDate WRITE setEndDate)
36
37 Q_PROPERTY(StatusFilters statusFilter READ statusFilter WRITE setStatusFilter)
38
39 Q_FLAGS(StatusFilter)
40public:
41 enum StatusFilter {
42 Draft = 1,
43 Live = 2,
44 Scheduled = 4,
45
46 All = Draft | Live | Scheduled
47 };
48 Q_DECLARE_FLAGS(StatusFilters, StatusFilter)
49
50 explicit PostFetchJob(const QString &blogId, const AccountPtr &account = AccountPtr(), QObject *parent = nullptr);
51 explicit PostFetchJob(const QString &blogId, const QString &postId, const AccountPtr &account = AccountPtr(), QObject *parent = nullptr);
52 ~PostFetchJob() override;
53
54 bool fetchBodies() const;
55 void setFetchBodies(bool fetchBodies);
56
57 bool fetchImages() const;
58 void setFetchImages(bool fetchImages);
59
60 uint maxResults() const;
61 void setMaxResults(uint maxResults);
62
63 QStringList filterLabels() const;
64 void setFilterLabels(const QStringList &labels);
65
66 QDateTime startDate() const;
67 void setStartDate(const QDateTime &startDate);
68
69 QDateTime endDate() const;
70 void setEndDate(const QDateTime &endDate);
71
72 void setStatusFilter(StatusFilters filter);
73 StatusFilters statusFilter() const;
74
75protected:
76 void start() override;
77 ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
78
79private:
80 class Private;
81 Private *const d;
82 friend class Private;
83};
84}
85}
Abstract superclass for all jobs that fetch resources from Google.
Definition fetchjob.h:25
Q_SCRIPTABLE Q_NOREPLY void start()
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.