• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KIO

  • KIO
  • PreviewJob
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Slots
KIO::PreviewJob Class Reference

#include <previewjob.h>

Inheritance diagram for KIO::PreviewJob:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ScaleType { Unscaled, Scaled, ScaledAndCached }

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)
 PreviewJob (const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins=0)
virtual ~PreviewJob ()
int overlayIconAlpha () const
int overlayIconSize () const
void removeItem (const KUrl &url)
ScaleType scaleType () const
int sequenceIndex () const
void setIgnoreMaximumSize (bool ignoreSize=true)
void setOverlayIconAlpha (int alpha)
void setOverlayIconSize (int size)
void setScaleType (ScaleType type)
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.


Member Enumeration Documentation

enum KIO::PreviewJob::ScaleType

Specifies the type of scaling that is applied to the generated preview.

Since:
4.7
Enumerator:
Unscaled 

The original size of the preview will be returned.

Most previews will return a size of 256 x 256 pixels.

Scaled 

The preview will be scaled to the size specified when constructing the PreviewJob.

The aspect ratio will be kept.

ScaledAndCached 

The preview will be scaled to the size specified when constructing the PreviewJob.

The result will be cached for later use. Per default ScaledAndCached is set.

Definition at line 46 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:
itemsa list of files to create previews for
widththe desired width
heightthe desired height, 0 to use the width
iconSizethe 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.
iconAlphatransparency to use for the icon overlay
scaleif the image is to be scaled to the requested size or returned in its original size
saveif the image should be cached for later use
enabledPluginsIf non-zero, this points to a list containing the names of the plugins that may be used. If enabledPlugins is zero all available plugins are used.
Deprecated:
Use PreviewJob(KFileItemList, QSize, QStringList) in combination with the setter-methods instead. Note that the semantics of enabledPlugins has been slightly changed.

Definition at line 132 of file previewjob.cpp.

PreviewJob::PreviewJob ( const KFileItemList &  items,
const QSize &  size,
const QStringList *  enabledPlugins = 0 
)
Parameters:
itemsList of files to create previews for.
sizeDesired size of the preview.
enabledPluginsIf non-zero it defines the list of plugins that are considered for generating the preview. If enabledPlugins is zero the plugins specified in the KConfigGroup "PreviewSettings" are used.
Since:
4.7

Definition at line 163 of file previewjob.cpp.

PreviewJob::~PreviewJob ( ) [virtual]

Definition at line 201 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 703 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:
itemthe 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:
itemthe file of the preview
previewthe 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 751 of file previewjob.cpp.

int PreviewJob::overlayIconAlpha ( ) const
Returns:
The alpha-value for the MIME-type icon which overlays the preview. Per default 70 is returned.
See also:
PreviewJob::setOverlayIconAlpha()
Since:
4.7

Definition at line 230 of file previewjob.cpp.

int PreviewJob::overlayIconSize ( ) const
Returns:
The size of the MIME-type icon which overlays the preview.
See also:
PreviewJob::setOverlayIconSize()
Since:
4.7

Definition at line 218 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:
urlthe url of the item that should be removed from the preview queue

Definition at line 366 of file previewjob.cpp.

PreviewJob::ScaleType PreviewJob::scaleType ( ) const
Returns:
The scale type for the generated preview.
See also:
PreviewJob::ScaleType
Since:
4.7

Definition at line 257 of file previewjob.cpp.

int KIO::PreviewJob::sequenceIndex ( ) const

Returns the currently set sequence index.

Since:
KDE 4.3

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

void PreviewJob::setOverlayIconAlpha ( int  alpha)

Sets the alpha-value for the MIME-type icon which overlays the preview.

The alpha-value may range from 0 (= fully transparent) to 255 (= opaque). Per default the value is set to 70.

See also:
PreviewJob::setOverlayIconSize()
Since:
4.7

Definition at line 224 of file previewjob.cpp.

void PreviewJob::setOverlayIconSize ( int  size)

Sets the size of the MIME-type icon which overlays the preview.

If zero is passed no overlay will be shown at all. The setting has no effect if the preview plugin that will be used does not use icon overlays. Per default the size is set to 0.

Since:
4.7

Definition at line 212 of file previewjob.cpp.

void PreviewJob::setScaleType ( ScaleType  type)

Sets the scale type for the generated preview.

Per default PreviewJob::ScaledAndCached is set.

See also:
PreviewJob::ScaleType
Since:
4.7

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

void PreviewJob::slotResult ( KJob *  job) [protected, virtual, slot]

Reimplemented from KCompositeJob.

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


The documentation for this class was generated from the following files:
  • previewjob.h
  • previewjob.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal