Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/PreviewImageProvider.h
Show All 32 Lines | |||||
33 | class KJob; | 33 | class KJob; | ||
34 | class PreviewImageProvider : public QObject, public QQuickImageProvider | 34 | class PreviewImageProvider : public QObject, public QQuickImageProvider | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | public: | 37 | public: | ||
38 | explicit PreviewImageProvider(QObject* parent = nullptr); | 38 | explicit PreviewImageProvider(QObject* parent = nullptr); | ||
39 | ~PreviewImageProvider() override; | 39 | ~PreviewImageProvider() override; | ||
40 | 40 | | |||
41 | /** | ||||
42 | * \brief Get an image. | ||||
43 | * | ||||
44 | * @param id The source of the image. | ||||
45 | * @param size The size of the original image. | ||||
46 | * @param requestedSize The required size of the final image. | ||||
47 | * | ||||
48 | * @return a QImage. | ||||
49 | */ | ||||
41 | QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override; | 50 | QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize) override; | ||
42 | 51 | | |||
52 | /** | ||||
53 | *\brief Get an icon associated with the mimetype of the image as a fallback. | ||||
54 | * | ||||
55 | * @param p Pointer to pixmap to write this fallback into. | ||||
56 | */ | ||||
43 | Q_SLOT void updatePreview(const KFileItem&, const QPixmap& p); | 57 | Q_SLOT void updatePreview(const KFileItem&, const QPixmap& p); | ||
58 | /** | ||||
59 | *\brief Get an icon associated with the mimetype of the image as a fallback. | ||||
60 | * | ||||
61 | * @param item The image to write a fallback for. | ||||
62 | */ | ||||
44 | Q_SLOT void fallbackPreview(const KFileItem& item); | 63 | Q_SLOT void fallbackPreview(const KFileItem& item); | ||
64 | /** | ||||
65 | * \brief Set whether the preview generation is finished. | ||||
66 | * | ||||
67 | * @param job The job to mark finished. | ||||
68 | */ | ||||
45 | Q_SLOT void finishedPreview(KJob* job); | 69 | Q_SLOT void finishedPreview(KJob* job); | ||
46 | private: | 70 | private: | ||
47 | class Private; | 71 | class Private; | ||
48 | Private* d; | 72 | Private* d; | ||
49 | }; | 73 | }; | ||
50 | 74 | | |||
51 | #endif//PREVIEWIMAGEPROVIDER_H | 75 | #endif//PREVIEWIMAGEPROVIDER_H |