KIO::PreviewJob

Search for usage in LXR

#include <KIO/PreviewJob>

Inheritance diagram for KIO::PreviewJob:

Public Types

enum  ScaleType { Unscaled , Scaled , ScaledAndCached }
 
- Public Types inherited from KJob
typedef QFlags< CapabilityCapabilities
 
enum  Capability
 
enum  Unit
 

Signals

void failed (const KFileItem &item)
 
void gotPreview (const KFileItem &item, const QPixmap &preview)
 
- Signals inherited from KIO::Job
void connected (KIO::Job *job)
 
- Signals inherited from KJob
void description (KJob *job, const QString &title, const QPair< QString, QString > &field1=QPair< QString, QString >(), const QPair< QString, QString > &field2=QPair< QString, QString >())
 
void finished (KJob *job)
 
void infoMessage (KJob *job, const QString &message)
 
void percentChanged (KJob *job, unsigned long percent)
 
void processedAmountChanged (KJob *job, KJob::Unit unit, qulonglong amount)
 
void processedSize (KJob *job, qulonglong size)
 
void result (KJob *job)
 
void resumed (KJob *job)
 
void speed (KJob *job, unsigned long speed)
 
void suspended (KJob *job)
 
void totalAmountChanged (KJob *job, KJob::Unit unit, qulonglong amount)
 
void totalSize (KJob *job, qulonglong size)
 
void warning (KJob *job, const QString &message)
 

Public Member Functions

 PreviewJob (const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins=nullptr)
 
bool handlesSequences () const
 
void removeItem (const QUrl &url)
 
ScaleType scaleType () const
 
int sequenceIndex () const
 
float sequenceIndexWraparoundPoint () const
 
void setDevicePixelRatio (qreal dpr)
 
void setIgnoreMaximumSize (bool ignoreSize=true)
 
void setScaleType (ScaleType type)
 
void setSequenceIndex (int index)
 
- Public Member Functions inherited from KIO::Job
void addMetaData (const QMap< QString, QString > &values)
 
void addMetaData (const QString &key, const QString &value)
 
QStringList detailedErrorStrings (const QUrl *reqUrl=nullptr, int method=-1) const
 
QString errorString () const override
 
void mergeMetaData (const QMap< QString, QString > &values)
 
MetaData metaData () const
 
MetaData outgoingMetaData () const
 
JobparentJob () const
 
QString queryMetaData (const QString &key)
 
void setMetaData (const KIO::MetaData &metaData)
 
void setParentJob (Job *parentJob)
 
void setUiDelegateExtension (JobUiDelegateExtension *extension)
 
void start () override
 
JobUiDelegateExtensionuiDelegateExtension () const
 
- Public Member Functions inherited from KCompositeJob
 KCompositeJob (QObject *parent=nullptr)
 
- Public Member Functions inherited from KJob
 KJob (QObject *parent=nullptr)
 
Capabilities capabilities () const
 
int error () const
 
QString errorText () const
 
bool exec ()
 
bool isAutoDelete () const
 
bool isFinishedNotificationHidden () const
 
bool isStartedWithExec () const
 
bool isSuspended () const
 
unsigned long percent () const
 
Q_SCRIPTABLE qulonglong processedAmount (Unit unit) const
 
void setAutoDelete (bool autodelete)
 
void setFinishedNotificationHidden (bool hide=true)
 
void setUiDelegate (KJobUiDelegate *delegate)
 
Q_SCRIPTABLE qulonglong totalAmount (Unit unit) const
 
KJobUiDelegateuiDelegate () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static QStringList availablePlugins ()
 
static QList< KPluginMetaDataavailableThumbnailerPlugins ()
 
static QStringList defaultPlugins ()
 
static void setDefaultDevicePixelRatio (qreal devicePixelRatio)
 
static QStringList supportedMimeTypes ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Protected Slots

void slotResult (KJob *job) override
 
- Protected Slots inherited from KCompositeJob
virtual void slotInfoMessage (KJob *job, const QString &message)
 
virtual void slotResult (KJob *job)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Slots inherited from KJob
bool kill (KJob::KillVerbosity verbosity=KJob::Quietly)
 
bool resume ()
 
bool suspend ()
 
- Public Attributes inherited from KJob
 Bytes
 
 Directories
 
 Files
 
 Items
 
 Killable
 
 NoCapabilities
 
 Suspendable
 
 UnitsCount
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from KIO::Job
 Job (JobPrivate &dd)
 
bool addSubjob (KJob *job) override
 
bool doKill () override
 
bool doResume () override
 
bool doSuspend () override
 
bool removeSubjob (KJob *job) override
 
- Protected Member Functions inherited from KCompositeJob
void clearSubjobs ()
 
bool hasSubjobs () const
 
const QList< KJob * > & subjobs () const
 
- Protected Member Functions inherited from KJob
void emitPercent (qulonglong processedAmount, qulonglong totalAmount)
 
void emitResult ()
 
void emitSpeed (unsigned long speed)
 
bool isFinished () const
 
void setCapabilities (Capabilities capabilities)
 
void setError (int errorCode)
 
void setErrorText (const QString &errorText)
 
void setPercent (unsigned long percentage)
 
void setProcessedAmount (Unit unit, qulonglong amount)
 
void setProgressUnit (Unit unit)
 
void setTotalAmount (Unit unit, qulonglong amount)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Attributes inherited from KIO::Job
JobPrivate *const d_ptr
 

Detailed Description

KIO Job to get a thumbnail picture.

This class catches a preview (thumbnail) for files.

Definition at line 30 of file previewjob.h.

Member Enumeration Documentation

◆ ScaleType

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

For HiDPI, pixel density scaling,

See also
setDevicePixelRatio
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 39 of file previewjob.h.

Constructor & Destructor Documentation

◆ PreviewJob()

PreviewJob::PreviewJob ( const KFileItemList & items,
const QSize & size,
const QStringList * enabledPlugins = nullptr )
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.

Definition at line 182 of file previewjob.cpp.

◆ ~PreviewJob()

PreviewJob::~PreviewJob ( )
override

Definition at line 202 of file previewjob.cpp.

Member Function Documentation

◆ availablePlugins()

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 all available plugins

Definition at line 914 of file previewjob.cpp.

◆ availableThumbnailerPlugins()

QList< KPluginMetaData > PreviewJob::availableThumbnailerPlugins ( )
static

Returns all plugins that are considered when a preview is generated The result is internally cached, meaning any further method call will not reload the plugins.

Since
5.90

Definition at line 909 of file previewjob.cpp.

◆ defaultPlugins()

QStringList PreviewJob::defaultPlugins ( )
static

Returns a list of plugins that should be enabled by default, which is all plugins Minus the plugins specified in an internal blacklist.

Returns
the list of plugins that should be enabled by default
Since
5.40

Definition at line 924 of file previewjob.cpp.

◆ failed

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

◆ gotPreview

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

◆ handlesSequences()

bool KIO::PreviewJob::handlesSequences ( ) const

Determines whether the ThumbCreator in use is a ThumbSequenceCreator.

Since
5.80

Definition at line 427 of file previewjob.cpp.

◆ removeItem()

void PreviewJob::removeItem ( const QUrl & 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 393 of file previewjob.cpp.

◆ scaleType()

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

Definition at line 234 of file previewjob.cpp.

◆ sequenceIndex()

int KIO::PreviewJob::sequenceIndex ( ) const

Returns the currently set sequence index.

Definition at line 417 of file previewjob.cpp.

◆ sequenceIndexWraparoundPoint()

float KIO::PreviewJob::sequenceIndexWraparoundPoint ( ) const

Returns the index at which the thumbs of a ThumbSequenceCreator start wrapping around ("looping").

Fractional values may be returned if the ThumbSequenceCreator supports sub-integer precision, but frontends supporting only integer sequence indices may choose to round it down.

See also
ThumbSequenceCreator::sequenceIndexWraparoundPoint()
Since
5.80

Definition at line 422 of file previewjob.cpp.

◆ setDefaultDevicePixelRatio()

void PreviewJob::setDefaultDevicePixelRatio ( qreal devicePixelRatio)
static

Sets a default device Pixel Ratio used for Previews.

See also
setDevicePixelRatio

Defaults to 1

Since
5.84

Definition at line 177 of file previewjob.cpp.

◆ setDevicePixelRatio()

void KIO::PreviewJob::setDevicePixelRatio ( qreal dpr)

Request preview to use the device pixel ratio dpr.

The returned thumbnail may not respect the device pixel ratio requested. Use QPixmap::devicePixelRatio to check, or paint as necessary.

Since
5.84

Definition at line 432 of file previewjob.cpp.

◆ setIgnoreMaximumSize()

void PreviewJob::setIgnoreMaximumSize ( bool ignoreSize = true)

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

Definition at line 437 of file previewjob.cpp.

◆ setScaleType()

void PreviewJob::setScaleType ( ScaleType type)

Sets the scale type for the generated preview.

Per default PreviewJob::ScaledAndCached is set.

See also
PreviewJob::ScaleType

Definition at line 213 of file previewjob.cpp.

◆ setSequenceIndex()

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.

Definition at line 412 of file previewjob.cpp.

◆ slotResult

void PreviewJob::slotResult ( KJob * job)
overrideprotectedslot

Definition at line 476 of file previewjob.cpp.

◆ supportedMimeTypes()

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


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.