KIO::PreviewJob Class Reference

KIO Job to get a thumbnail picture. More...

#include <previewjob.h>

Inheritance diagram for KIO::PreviewJob:

KIO::Job QObject

List of all members.


Signals

void gotPreview (const KFileItem *item, const QPixmap &preview)
void failed (const KFileItem *item)

Public Member Functions

 PreviewJob (const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins, bool deleteItems=false)
void removeItem (const KFileItem *item)
void setIgnoreMaximumSize (bool ignoreSize=true)
virtual void kill (bool quietly=true)

Static Public Member Functions

static QStringList availablePlugins ()
static QStringList supportedMimeTypes ()

Protected Slots

virtual void slotResult (KIO::Job *job)

Protected Member Functions

void getOrCreateThumbnail ()
bool statResultThumbnail ()
void createThumbnail (QString)
virtual void virtual_hook (int id, void *data)

Detailed Description

KIO Job to get a thumbnail picture.

This class catches a preview (thumbnail) for files.

Definition at line 37 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,
bool  deleteItems = false 
)

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 width
iconSize 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.
deleteItems true to delete the items when done

Definition at line 118 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 544 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

void PreviewJob::kill ( bool  quietly = true  )  [virtual]

Reimplemented for internal reasons.

Reimplemented from KIO::Job.

Definition at line 563 of file previewjob.cpp.

void PreviewJob::removeItem ( const KFileItem item  ) 

Removes an item from preview processing.

Use this if you passed an item to filePreview and want to delete it now.

Parameters:
item the item that should be removed from the preview queue

Definition at line 256 of file previewjob.cpp.

void PreviewJob::setIgnoreMaximumSize ( bool  ignoreSize = true  ) 

If ignoreSize is true, then the preview is always generated regardless of the settings.

Since:
KDE 3.4

Definition at line 273 of file previewjob.cpp.

void PreviewJob::slotResult ( KIO::Job job  )  [protected, virtual, slot]

Called whenever a subjob finishes.

Default implementation checks for errors and propagates to parent job, then calls removeSubjob. Override if you don't want subjobs errors to be propagated.

Parameters:
job the subjob
See also:
result()

Reimplemented from KIO::Job.

Definition at line 308 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 554 of file previewjob.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys