KIO
KIO::PreviewJob Class Reference
KIO Job to get a thumbnail picture. More...
#include <previewjob.h>

Signals | |
| void | failed (const KFileItem &item) |
| void | gotPreview (const KFileItem &item, const QPixmap &preview) |
Public Member Functions | |
| PreviewJob (const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins) | |
| virtual | ~PreviewJob () |
| void | removeItem (const KUrl &url) |
| int | sequenceIndex () const |
| void | setIgnoreMaximumSize (bool ignoreSize=true) |
| void | setSequenceIndex (int index) |
Static Public Member Functions | |
| static QStringList | availablePlugins () |
| static KIO::filesize_t | maximumFileSize () |
| static QStringList | supportedMimeTypes () |
Protected Slots | |
| virtual void | slotResult (KJob *job) |
Detailed Description
KIO Job to get a thumbnail picture.
This class catches a preview (thumbnail) for files.
Definition at line 38 of file previewjob.h.
Constructor & Destructor Documentation
| PreviewJob::PreviewJob | ( | const KFileItemList & | items, |
| int | width, | ||
| int | height, | ||
| int | iconSize, | ||
| int | iconAlpha, | ||
| bool | scale, | ||
| bool | save, | ||
| const QStringList * | enabledPlugins | ||
| ) |
Creates a new PreviewJob.
- Parameters:
-
items a list of files to create previews for width the desired width height the desired height, 0 to use the widthiconSize the size of the mimetype icon to overlay over the preview or zero to not overlay an icon. This has no effect if the preview plugin that will be used doesn't use icon overlays. iconAlpha transparency to use for the icon overlay scale if the image is to be scaled to the requested size or returned in its original size save if the image should be cached for later use enabledPlugins if non-zero, this points to a list containing the names of the plugins that may be used.
Definition at line 135 of file previewjob.cpp.
| PreviewJob::~PreviewJob | ( | ) | [virtual] |
Definition at line 165 of file previewjob.cpp.
Member Function Documentation
| QStringList PreviewJob::availablePlugins | ( | ) | [static] |
Returns a list of all available preview plugins.
The list contains the basenames of the plugins' .desktop files (no path, no .desktop).
- Returns:
- the list of plugins
Definition at line 613 of file previewjob.cpp.
| void KIO::PreviewJob::failed | ( | const KFileItem & | item | ) | [signal] |
Emitted when a thumbnail for item could not be created, either because a ThumbCreator for its MIME type does not exist, or because something went wrong.
- Parameters:
-
item the file that failed
| void KIO::PreviewJob::gotPreview | ( | const KFileItem & | item, |
| const QPixmap & | preview | ||
| ) | [signal] |
Emitted when a thumbnail picture for item has been successfully retrieved.
- Parameters:
-
item the file of the preview preview the preview image
| KIO::filesize_t PreviewJob::maximumFileSize | ( | ) | [static] |
Returns the default "maximum file size", in bytes, used by PreviewJob.
This is useful for applications providing a GUI for letting the user change the size.
- Since:
- 4.1
- Deprecated:
- PreviewJob uses different maximum file sizes dependent on the URL since 4.5. The returned file size is only valid for local URLs.
Definition at line 654 of file previewjob.cpp.
| void PreviewJob::removeItem | ( | const KUrl & | url | ) |
Removes an item from preview processing.
Use this if you passed an item to filePreview and want to delete it now.
- Parameters:
-
url the url of the item that should be removed from the preview queue
Definition at line 276 of file previewjob.cpp.
| int KIO::PreviewJob::sequenceIndex | ( | ) | const |
Returns the currently set sequence index.
- Since:
- KDE 4.3
Definition at line 299 of file previewjob.cpp.
| void PreviewJob::setIgnoreMaximumSize | ( | bool | ignoreSize = true | ) |
If ignoreSize is true, then the preview is always generated regardless of the settings.
Definition at line 303 of file previewjob.cpp.
| void KIO::PreviewJob::setSequenceIndex | ( | int | index | ) |
Sets the sequence index given to the thumb creators.
Use the sequence index, it is possible to create alternative icons for the same item. For example it may allow iterating through the items of a directory, or the frames of a video.
- Since:
- KDE 4.3
Definition at line 295 of file previewjob.cpp.
| void PreviewJob::slotResult | ( | KJob * | job | ) | [protected, virtual, slot] |
Reimplemented from KCompositeJob.
Definition at line 335 of file previewjob.cpp.
| QStringList PreviewJob::supportedMimeTypes | ( | ) | [static] |
Returns a list of all supported MIME types.
The list can contain entries like text/ * (without the space).
- Returns:
- the list of mime types
Definition at line 623 of file previewjob.cpp.
The documentation for this class was generated from the following files:
KDE 4.6 API Reference