KDE 4.7 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

PreviewJob Class Reference

from PyKDE4.kio import *

Inherits: KIO.Job → KCompositeJob → KJob → QObject
Namespace: KIO

Detailed Description


Enumerations

ScaleType { Unscaled, Scaled, ScaledAndCached }

Signals

 failed (KFileItem item)
 gotPreview (KFileItem item, QPixmap preview)

Methods

 __init__ (self, KFileItemList items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, QStringList enabledPlugins)
 __init__ (self)
 __init__ (self, KFileItemList items, QSize size, QStringList enabledPlugins=0)
int overlayIconAlpha (self)
int overlayIconSize (self)
 removeItem (self, KUrl url)
KIO.PreviewJob.ScaleType scaleType (self)
int sequenceIndex (self)
 setIgnoreMaximumSize (self, bool ignoreSize=1)
 setOverlayIconAlpha (self, int alpha)
 setOverlayIconSize (self, int size)
 setScaleType (self, KIO.PreviewJob.ScaleType type)
 setSequenceIndex (self, int index)
 slotResult (self, KJob job)

Static Methods

QStringList availablePlugins ()
long maximumFileSize ()
QStringList supportedMimeTypes ()

Signal Documentation

failed ( KFileItem  item
)

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

Signal syntax:
QObject.connect(source, SIGNAL("failed(const KFileItem&)"), target_slot)
gotPreview ( KFileItem  item,
QPixmap  preview
)

Emitted when a thumbnail picture for item has been successfully retrieved.

Parameters:
item  the file of the preview
preview  the preview image

Signal syntax:
QObject.connect(source, SIGNAL("gotPreview(const KFileItem&, const QPixmap&)"), target_slot)

Method Documentation

__init__ (  self,
KFileItemList  items,
int  width,
int  height,
int  iconSize,
int  iconAlpha,
bool  scale,
bool  save,
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 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. 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.

__init__ (   self )
__init__ (  self,
KFileItemList  items,
QSize  size,
QStringList  enabledPlugins=0
)

Parameters:
items  List of files to create previews for.
size  Desired size of the preview.
enabledPlugins  If 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

int overlayIconAlpha (   self )

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

int overlayIconSize (   self )

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

removeItem (  self,
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

KIO.PreviewJob.ScaleType scaleType (   self )

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

int sequenceIndex (   self )

Returns the currently set sequence index

Since:
KDE 4.3

setIgnoreMaximumSize (  self,
bool  ignoreSize=1
)

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

setOverlayIconAlpha (  self,
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

setOverlayIconSize (  self,
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

setScaleType (  self,
KIO.PreviewJob.ScaleType  type
)

Sets the scale type for the generated preview. Per default PreviewJob.ScaledAndCached is set.

See also:
PreviewJob.ScaleType
Since:
4.7

setSequenceIndex (  self,
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

slotResult (  self,
KJob  job
)

Static Method Documentation

QStringList availablePlugins (   )

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

long maximumFileSize (   )

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.

QStringList supportedMimeTypes (   )

Returns a list of all supported MIME types. The list can contain entries like text/ * (without the space).

Returns:
the list of mime types


Enumeration Documentation

ScaleType

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

Since:
4.7

Enumerator:
Unscaled 
Scaled 
ScaledAndCached 

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal