5#ifndef DTKWIDGET_DFILETHUMBNAILPROVIDER_H
6#define DTKWIDGET_DFILETHUMBNAILPROVIDER_H
11#include <dtkwidget_global.h>
16#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
22DWIDGET_BEGIN_NAMESPACE
24class DThumbnailProviderPrivate;
25class D_DECL_DEPRECATED_X(
"Use libdtkgui") DThumbnailProvider :
public QThread,
public DTK_CORE_NAMESPACE::DObject
36 static DThumbnailProvider *instance();
38 bool hasThumbnail(
const QFileInfo &info)
const;
39 bool hasThumbnail(
const QMimeType &mimeType)
const;
41 QString thumbnailFilePath(
const QFileInfo &info, Size size)
const;
43 QString createThumbnail(
const QFileInfo &info, Size size);
44 typedef std::function<void(
const QString &)> CallBack;
45 void appendToProduceQueue(
const QFileInfo &info, Size size, CallBack callback = 0);
46 void removeInProduceQueue(
const QFileInfo &info, Size size);
48 QString errorString()
const;
50 qint64 defaultSizeLimit()
const;
51 void setDefaultSizeLimit(qint64 size);
53 qint64 sizeLimit(
const QMimeType &mimeType)
const;
54 void setSizeLimit(
const QMimeType &mimeType, qint64 size);
57 void thumbnailChanged(
const QString &sourceFilePath,
const QString &thumbnailPath)
const;
58 void createThumbnailFinished(
const QString &sourceFilePath,
const QString &thumbnailPath)
const;
59 void createThumbnailFailed(
const QString &sourceFilePath)
const;
62 explicit DThumbnailProvider(QObject *parent = 0);
63 ~DThumbnailProvider();
65 void run() Q_DECL_OVERRIDE;
68 D_DECLARE_PRIVATE(DThumbnailProvider)