KIO::PreviewJob Class Reference

`#include <previewjob.h>`

Inheritance diagram for KIO::PreviewJob:

## Signals

void | gotPreview (const KFileItem *item, const QPixmap &preview)
void | failed (const KFileItem *item)
Signals inherited from KIO::Job
void | result (KIO::Job *job)
void | canceled (KIO::Job *job)
void | infoMessage (KIO::Job *job, const QString &msg)
void | warning (KIO::Job *job, const QString &msg)
void | connected (KIO::Job *job)
void | percent (KIO::Job *job, unsigned long percent)
void | totalSize (KIO::Job *job, KIO::filesize_t size)
void | processedSize (KIO::Job *job, KIO::filesize_t size)
void | speed (KIO::Job *job, unsigned long speed)

## 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)
Public Member Functions inherited from KIO::Job
int | error () const
int | progressId () const
const QString & | errorText () const
QString | errorString () const
QStringList | detailedErrorStrings (const KURL *reqUrl=0L, int method=-1) const
void | showErrorDialog (QWidget *parent=0L)
void | setAutoErrorHandlingEnabled (bool enable, QWidget *parentWidget=0)
bool | isAutoErrorHandlingEnabled () const
void | setAutoWarningHandlingEnabled (bool enable)
bool | isAutoWarningHandlingEnabled () const
void | setInteractive (bool enable)
bool | isInteractive () const
void | setWindow (QWidget *window)
QWidget * | window () const
void | updateUserTimestamp (unsigned long time)
void | setParentJob (Job *parentJob)
Job * | parentJob () const
void | setMetaData (const KIO::MetaData &metaData)
void | addMetaData (const QString &key, const QString &value)
void | addMetaData (const QMap< QString, QString > &values)
void | mergeMetaData (const QMap< QString, QString > &values)
MetaData | outgoingMetaData () const
MetaData | metaData () const
QString | queryMetaData (const QString &key)
KIO::filesize_t | getProcessedSize ()

## Static Public Member Functions

static QStringList | availablePlugins ()
static QStringList | supportedMimeTypes ()

## Protected Slots

virtual void | slotResult (KIO::Job *job)
Protected Slots inherited from KIO::Job
virtual void | slotResult (KIO::Job *job)
void | slotSpeed (KIO::Job *job, unsigned long speed)
void | slotInfoMessage (KIO::Job *job, const QString &msg)
void | slotSpeedTimeout ()

## Protected Member Functions

void | getOrCreateThumbnail ()
bool | statResultThumbnail ()
void | createThumbnail (QString)
virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from KIO::Job
| Job (bool showProgressInfo)
virtual void | addSubjob (Job *job, bool inheritMetaData=true)
virtual void | removeSubjob (Job *job)
void | removeSubjob (Job *job, bool mergeMetaData, bool emitResultIfLast)
void | emitPercent (KIO::filesize_t processedSize, KIO::filesize_t totalSize)
void | emitSpeed (unsigned long speed)
void | emitResult ()
void | setProcessedSize (KIO::filesize_t size)
unsigned long | userTimestamp () const
int & | extraFlags ()

## Additional Inherited Members

Protected Types inherited from KIO::Job
enum | { EF_TransferJobAsync = (1 << 0), EF_TransferJobNeedData = (1 << 1), EF_TransferJobDataSent = (1 << 2), EF_ListJobUnrestricted = (1 << 3) }
Protected Attributes inherited from KIO::Job
QPtrList< Job > | subjobs
int | m_error
QString | m_errorText
unsigned long | m_percent
int | m_progressId
QTimer * | m_speedTimer
QGuardedPtr< QWidget > | m_window
MetaData | m_outgoingMetaData
MetaData | m_incomingMetaData

## 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.

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:

- previewjob.h
- previewjob.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys