Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/previewjob.h
Show All 38 Lines | |||||
39 | * @short KIO Job to get a thumbnail picture | 39 | * @short KIO Job to get a thumbnail picture | ||
40 | */ | 40 | */ | ||
41 | class KIOWIDGETS_EXPORT PreviewJob : public KIO::Job | 41 | class KIOWIDGETS_EXPORT PreviewJob : public KIO::Job | ||
42 | { | 42 | { | ||
43 | Q_OBJECT | 43 | Q_OBJECT | ||
44 | public: | 44 | public: | ||
45 | /** | 45 | /** | ||
46 | * Specifies the type of scaling that is applied to the generated preview. | 46 | * Specifies the type of scaling that is applied to the generated preview. | ||
47 | * For HiDPI, pixel density scaling, @see PreviewJob::setDevicePixelRatio | ||||
48 | * | ||||
47 | * @since 4.7 | 49 | * @since 4.7 | ||
48 | */ | 50 | */ | ||
49 | enum ScaleType { | 51 | enum ScaleType { | ||
50 | /** | 52 | /** | ||
51 | * The original size of the preview will be returned. Most previews | 53 | * The original size of the preview will be returned. Most previews | ||
52 | * will return a size of 256 x 256 pixels. | 54 | * will return a size of 256 x 256 pixels. | ||
53 | */ | 55 | */ | ||
54 | Unscaled, | 56 | Unscaled, | ||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Line(s) | 95 | #endif | |||
182 | /** | 184 | /** | ||
183 | * Returns the currently set sequence index | 185 | * Returns the currently set sequence index | ||
184 | * | 186 | * | ||
185 | * @since 4.3 | 187 | * @since 4.3 | ||
186 | **/ | 188 | **/ | ||
187 | int sequenceIndex() const; | 189 | int sequenceIndex() const; | ||
188 | 190 | | |||
189 | /** | 191 | /** | ||
192 | * Request preview to use the device pixel ratio @p dpr. | ||||
elvisangelaccio: Did you mean `@p dpr`?
(unless doxygen is smart enough to figure out the name of the parameter? | |||||
193 | * The returned thumbnail may not respect the device pixel ratio returned. | ||||
194 | * Use QPixmap::devicePixelRatio to check, or paint as neccesary. | ||||
195 | * | ||||
196 | * @since 5.71 | ||||
meven: update | |||||
197 | */ | ||||
198 | void setDevicePixelRatio(qreal dpr); | ||||
199 | | ||||
200 | /** | ||||
190 | * Returns a list of all available preview plugins. The list | 201 | * Returns a list of all available preview plugins. The list | ||
191 | * contains the basenames of the plugins' .desktop files (no path, | 202 | * contains the basenames of the plugins' .desktop files (no path, | ||
192 | * no .desktop). | 203 | * no .desktop). | ||
193 | * @return the list of all available plugins | 204 | * @return the list of all available plugins | ||
194 | */ | 205 | */ | ||
195 | static QStringList availablePlugins(); | 206 | static QStringList availablePlugins(); | ||
196 | 207 | | |||
197 | /** | 208 | /** | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
239 | 250 | | |||
240 | protected Q_SLOTS: | 251 | protected Q_SLOTS: | ||
241 | void slotResult(KJob *job) override; | 252 | void slotResult(KJob *job) override; | ||
242 | 253 | | |||
243 | private: | 254 | private: | ||
244 | Q_PRIVATE_SLOT(d_func(), void startPreview()) | 255 | Q_PRIVATE_SLOT(d_func(), void startPreview()) | ||
245 | Q_PRIVATE_SLOT(d_func(), void slotThumbData(KIO::Job *, const QByteArray &)) | 256 | Q_PRIVATE_SLOT(d_func(), void slotThumbData(KIO::Job *, const QByteArray &)) | ||
246 | Q_DECLARE_PRIVATE(PreviewJob) | 257 | Q_DECLARE_PRIVATE(PreviewJob) | ||
258 | | ||||
259 | public: | ||||
260 | /** | ||||
261 | * Sets a default device Pixel Ratio used for Previews | ||||
262 | * @see PreviewJob::setDevicePixelRatio | ||||
263 | * | ||||
264 | * Defaults to 1 | ||||
265 | * | ||||
266 | * @since 5.71 | ||||
267 | */ | ||||
268 | static void setDefaultDevicePixelRatio(qreal devicePixelRatio); | ||||
elvisangelaccio: Typo: `devicePixelRatio`. | |||||
247 | }; | 269 | }; | ||
248 | 270 | | |||
249 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 7) | 271 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 7) | ||
250 | /** | 272 | /** | ||
251 | * Creates a PreviewJob to generate or retrieve a preview image | 273 | * Creates a PreviewJob to generate or retrieve a preview image | ||
252 | * for the given URL. | 274 | * for the given URL. | ||
253 | * | 275 | * | ||
254 | * @param items files to get previews for | 276 | * @param items files to get previews for | ||
Show All 28 Lines | |||||
283 | * @param width the maximum width to use | 305 | * @param width the maximum width to use | ||
284 | * @param height the maximum height to use, if this is 0, the same | 306 | * @param height the maximum height to use, if this is 0, the same | ||
285 | * value as width is used. | 307 | * value as width is used. | ||
286 | * @param iconSize the size of the mimetype icon to overlay over the | 308 | * @param iconSize the size of the mimetype icon to overlay over the | ||
287 | * preview or zero to not overlay an icon. This has no effect if the | 309 | * preview or zero to not overlay an icon. This has no effect if the | ||
288 | * preview plugin that will be used doesn't use icon overlays. | 310 | * preview plugin that will be used doesn't use icon overlays. | ||
289 | * @param iconAlpha transparency to use for the icon overlay | 311 | * @param iconAlpha transparency to use for the icon overlay | ||
290 | * @param scale if the image is to be scaled to the requested size or | 312 | * @param scale if the image is to be scaled to the requested size or | ||
291 | * returned in its original size | 313 | * returned in its original size @see PreviewJob::setDevicePixelRatio | ||
292 | * @param save if the image should be cached for later use | 314 | * @param save if the image should be cached for later use | ||
293 | * @param enabledPlugins if non-zero, this points to a list containing | 315 | * @param enabledPlugins if non-zero, this points to a list containing | ||
294 | * the names of the plugins that may be used. | 316 | * the names of the plugins that may be used. | ||
295 | * @return the new PreviewJob | 317 | * @return the new PreviewJob | ||
296 | * @see PreviewJob::availablePlugins() | 318 | * @see PreviewJob::availablePlugins() | ||
297 | * @deprecated Since 4.7, use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination | 319 | * @deprecated Since 4.7, use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination | ||
298 | * with the setter-methods instead. Note that the semantics of | 320 | * with the setter-methods instead. Note that the semantics of | ||
299 | * \p enabledPlugins has been slightly changed. | 321 | * \p enabledPlugins has been slightly changed. | ||
Show All 19 Lines |
Did you mean @p dpr?
(unless doxygen is smart enough to figure out the name of the parameter?)