LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
idownload.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QUrl>
12#include <QtPlugin>
13#include <util/sll/eitherfwd.h>
14#include "structures.h"
15
16template<typename>
17class QFuture;
18
20
42class Q_DECL_EXPORT IDownload
43{
44public:
71
72 struct Success {};
73
75
86 virtual qint64 GetDownloadSpeed () const = 0;
97 virtual qint64 GetUploadSpeed () const = 0;
98
114 virtual EntityTestHandleResult CouldDownload (const LC::Entity& entity) const = 0;
115
126 virtual QFuture<Result> AddJob (LC::Entity entity) = 0;
127
130 virtual ~IDownload () {}
131};
132
133Q_DECLARE_INTERFACE (IDownload, "org.Deviant.LeechCraft.IDownload/1.0")
134
Common interface for all the downloaders.
Definition idownload.h:43
LC::Util::Either< Error, Success > Result
Definition idownload.h:74
virtual QFuture< Result > AddJob(LC::Entity entity)=0
Adds the job with given parameters.
virtual ~IDownload()
Virtual destructor.
Definition idownload.h:130
virtual qint64 GetUploadSpeed() const =0
Returns upload speed.
virtual EntityTestHandleResult CouldDownload(const LC::Entity &entity) const =0
Returns whether plugin can handle given entity.
virtual qint64 GetDownloadSpeed() const =0
Returns download speed.
auto operator==(const T &left, const T &right)
Definition common.h:38
The result of testing whether an entity could be handled by a plugin.
enum IDownload::Error::Type Type_
QString Message_
Definition idownload.h:64
A message used for inter-plugin communication.
Definition structures.h:96
Q_DECLARE_METATYPE(QVariantList *)