Start simplifying APIs
This commit is contained in:
parent
63d2dfdf9c
commit
f7f27699ca
13 changed files with 178 additions and 287 deletions
66
src/libdanbooru/moebooru.h
Normal file
66
src/libdanbooru/moebooru.h
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue