2015-09-07 14:50:01 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2015-09-07 14:50:01 +03:00
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef THUMBNAILJOB_H
|
|
|
|
#define THUMBNAILJOB_H
|
|
|
|
|
|
|
|
#include "networkjobs.h"
|
|
|
|
#include "accountfwd.h"
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
|
2015-10-15 23:18:22 +03:00
|
|
|
/**
|
|
|
|
* @brief Job to fetch a thumbnail for a file
|
|
|
|
* @ingroup gui
|
|
|
|
*
|
|
|
|
* Job that allows fetching a preview (of 150x150 for now) of a given file.
|
2015-10-16 13:51:24 +03:00
|
|
|
* Once the job has finished the jobFinished signal will be emitted.
|
2015-10-15 23:18:22 +03:00
|
|
|
*/
|
2017-05-17 11:55:42 +03:00
|
|
|
class ThumbnailJob : public AbstractNetworkJob
|
|
|
|
{
|
2015-09-07 14:50:01 +03:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-11-11 12:56:22 +03:00
|
|
|
explicit ThumbnailJob(const QString &path, AccountPtr account, QObject *parent = nullptr);
|
2015-09-07 14:50:01 +03:00
|
|
|
public slots:
|
2018-11-11 13:09:29 +03:00
|
|
|
void start() override;
|
2015-09-07 14:50:01 +03:00
|
|
|
signals:
|
2015-10-15 23:18:22 +03:00
|
|
|
/**
|
|
|
|
* @param statusCode the HTTP status code
|
|
|
|
* @param reply the content of the reply
|
|
|
|
*
|
|
|
|
* Signal that the job is done. If the statusCode is 200 (success) reply
|
|
|
|
* will contain the image data in PNG. If the status code is different the content
|
|
|
|
* of reply is undefined.
|
|
|
|
*/
|
2015-09-07 14:50:01 +03:00
|
|
|
void jobFinished(int statusCode, QByteArray reply);
|
|
|
|
private slots:
|
2018-11-11 13:09:29 +03:00
|
|
|
bool finished() override;
|
2015-09-07 14:50:01 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // THUMBNAILJOB_H
|