Start simplifying APIs

This commit is contained in:
Luca Beltrame 2018-08-19 23:59:56 +02:00
parent 63d2dfdf9c
commit f7f27699ca
Signed by: einar
GPG key ID: 8DF631FD021DB0C5
13 changed files with 178 additions and 287 deletions

View file

@ -0,0 +1,66 @@
/*
* Copyright 2015 Luca Beltrame <lbeltrame@kde.org>
*
* This file is part of Danbooru Client.
*
* Danbooru Client is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Danbooru Client is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Danbooru Client. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DANBOORU_KONACHAN_H
#define DANBOORU_KONACHAN_H
#include "servicebase.h"
#include "danbooru.h"
class KJob;
namespace Danbooru {
class KonachanDanbooruService: public DanbooruServiceBase {
Q_OBJECT
private:
const QLatin1String postUri() const override;
const QLatin1String poolUri() const override;
const QLatin1String artistUri() const override;
const QLatin1String tagUri() const override;
const QLatin1String poolDataUri() const override;
const QLatin1String relatedTagUri() const override;
public:
using DanbooruServiceBase::DanbooruServiceBase; // superclass constructor
~KonachanDanbooruService() override = default;
Danbooru::ApiType apiType() const override;
void getPostList() override;
void getPoolList(int limit = -1) override;
void getPool(int poolId, int page = 1) override;
void getTagList(int limit = 10, QString name = "") override;
void getRelatedTags(const QStringList &tags,
DanbooruTag::TagType tagType = DanbooruTag::General) override;
private Q_SLOTS:
void processPostList(KJob *job);
void processTagList(KJob *job);
void downloadAllTags(KJob *job);
};
} // namespace Danbooru
#endif