kio Library API Documentation

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)

Static Public Member Functions

QStringList availablePlugins ()
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 111 of file previewjob.cpp.


Member Function Documentation

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 209 of file previewjob.cpp.

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 479 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 489 of file previewjob.cpp.

Referenced by KFileIconView::showPreviews().

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 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 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 256 of file previewjob.cpp.

References KIO::Job::error(), KIO::filesize_t, and KIO::UDSEntry.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 14 09:17:21 2006 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003