KIO::PreviewJob
#include <KIO/PreviewJob>

Public Types | |
enum | ScaleType { Unscaled, Scaled, ScaledAndCached } |
![]() | |
typedef QFlags< Capability > | Capabilities |
enum | Capability |
enum | Unit |
Signals | |
void | failed (const KFileItem &item) |
void | gotPreview (const KFileItem &item, const QPixmap &preview) |
![]() | |
void | canceled (KJob *job) |
void | connected (KIO::Job *job) |
![]() | |
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 &plain, const QString &rich=QString()) |
void | percent (KJob *job, unsigned long percent) |
void | percentChanged (KJob *job, unsigned long percent) |
void | processedAmount (KJob *job, KJob::Unit unit, qulonglong amount) |
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 | totalAmount (KJob *job, KJob::Unit unit, qulonglong amount) |
void | totalAmountChanged (KJob *job, KJob::Unit unit, qulonglong amount) |
void | totalSize (KJob *job, qulonglong size) |
void | warning (KJob *job, const QString &plain, const QString &rich=QString()) |
Public Member Functions | |
PreviewJob (const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins=nullptr) | |
PreviewJob (const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins) | |
bool | handlesSequences () const |
int | overlayIconAlpha () const |
int | overlayIconSize () const |
void | removeItem (const QUrl &url) |
ScaleType | scaleType () const |
int | sequenceIndex () const |
float | sequenceIndexWraparoundPoint () const |
void | setDevicePixelRatio (int dpr) |
void | setDevicePixelRatio (qreal dpr) |
void | setIgnoreMaximumSize (bool ignoreSize=true) |
void | setOverlayIconAlpha (int alpha) |
void | setOverlayIconSize (int size) |
void | setScaleType (ScaleType type) |
void | setSequenceIndex (int index) |
![]() | |
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 |
Job * | parentJob () const |
QString | queryMetaData (const QString &key) |
void | setMetaData (const KIO::MetaData &metaData) |
void | setParentJob (Job *parentJob) |
void | setUiDelegateExtension (JobUiDelegateExtension *extension) |
void | start () override |
KJobUiDelegate * | ui () const |
JobUiDelegateExtension * | uiDelegateExtension () const |
![]() | |
KCompositeJob (QObject *parent=nullptr) | |
![]() | |
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 |
KJobUiDelegate * | uiDelegate () const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () 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 () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, 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 |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
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 | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | 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 | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Static Public Member Functions | |
static QStringList | availablePlugins () |
static QVector< KPluginMetaData > | availableThumbnailerPlugins () |
static QStringList | defaultPlugins () |
static KIO::filesize_t | maximumFileSize () |
static void | setDefaultDevicePixelRatio (int devicePixelRatio) |
static void | setDefaultDevicePixelRatio (qreal devicePixelRatio) |
static QStringList | supportedMimeTypes () |
![]() | |
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) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Slots | |
void | slotResult (KJob *job) override |
![]() | |
virtual void | slotInfoMessage (KJob *job, const QString &plain, const QString &rich) |
virtual void | slotResult (KJob *job) |
Additional Inherited Members | |
![]() | |
objectName | |
![]() | |
bool | kill (KillVerbosity verbosity=Quietly) |
bool | resume () |
bool | suspend () |
![]() | |
Bytes | |
Directories | |
Files | |
Items | |
Killable | |
NoCapabilities | |
Suspendable | |
UnitsCount | |
![]() | |
typedef | QObjectList |
![]() | |
Job (JobPrivate &dd) | |
bool | addSubjob (KJob *job) override |
bool | doKill () override |
bool | doResume () override |
bool | doSuspend () override |
bool | removeSubjob (KJob *job) override |
![]() | |
void | clearSubjobs () |
bool | hasSubjobs () const |
const QList< KJob * > & | subjobs () const |
![]() | |
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) |
![]() | |
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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
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
- 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 40 of file previewjob.h.
Constructor & Destructor Documentation
◆ PreviewJob() [1/2]
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
-
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 MIME type 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:
- Since 4.7, use PreviewJob(const KFileItemList&, const QSize&, const QStringList*) in combination with the setter-methods instead. Note that the semantics of
enabledPlugins
has been slightly changed.
Definition at line 230 of file previewjob.cpp.
◆ PreviewJob() [2/2]
PreviewJob::PreviewJob | ( | const KFileItemList & | items, |
const QSize & | size, | ||
const QStringList * | enabledPlugins = nullptr |
||
) |
- 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
Definition at line 247 of file previewjob.cpp.
Member Function Documentation
◆ 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 1028 of file previewjob.cpp.
◆ 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 1023 of file previewjob.cpp.
◆ 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 1038 of file previewjob.cpp.
◆ failed
|
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
◆ gotPreview
Emitted when a thumbnail picture for item
has been successfully retrieved.
- Parameters
-
item the file of the preview preview the preview image
◆ handlesSequences()
bool KIO::PreviewJob::handlesSequences | ( | ) | const |
Determines whether the ThumbCreator in use is a ThumbSequenceCreator.
- Since
- 5.80
Definition at line 524 of file previewjob.cpp.
◆ 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:
- Since 4.5, PreviewJob uses different maximum file sizes dependent on the URL. The returned file size is only valid for local URLs.
Definition at line 1088 of file previewjob.cpp.
◆ overlayIconAlpha()
int PreviewJob::overlayIconAlpha | ( | ) | const |
- Returns
- The alpha-value for the MIME-type icon which overlays the preview. Per default 70 is returned.
- Since
- 4.7
- Deprecated:
- since 5.102, not implemented.
Definition at line 303 of file previewjob.cpp.
◆ overlayIconSize()
int PreviewJob::overlayIconSize | ( | ) | const |
- Returns
- The size of the MIME-type icon which overlays the preview.
- See also
- PreviewJob::setOverlayIconSize()
- Since
- 4.7
- Deprecated:
- since 5.102, not implemented.
Definition at line 287 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
-
url the url of the item that should be removed from the preview queue
Definition at line 490 of file previewjob.cpp.
◆ scaleType()
PreviewJob::ScaleType PreviewJob::scaleType | ( | ) | const |
- Returns
- The scale type for the generated preview.
- See also
- PreviewJob::ScaleType
- Since
- 4.7
Definition at line 331 of file previewjob.cpp.
◆ sequenceIndex()
int KIO::PreviewJob::sequenceIndex | ( | ) | const |
◆ 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.
- Since
- 5.80
Definition at line 519 of file previewjob.cpp.
◆ setDefaultDevicePixelRatio() [1/2]
|
static |
Sets a default device Pixel Ratio used for Previews.
- See also
- setDevicePixelRatio
Defaults to 1
- Since
- 5.80
- Deprecated:
- Since 5.86, use setDefaultDevicePixelRatio(qreal dpr) instead
Definition at line 218 of file previewjob.cpp.
◆ setDefaultDevicePixelRatio() [2/2]
|
static |
Sets a default device Pixel Ratio used for Previews.
- See also
- setDevicePixelRatio
Defaults to 1
- Since
- 5.84
Definition at line 224 of file previewjob.cpp.
◆ setDevicePixelRatio() [1/2]
void KIO::PreviewJob::setDevicePixelRatio | ( | int | 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.80
- Deprecated:
- Since 5.86, use setDevicePixelRatio(qreal dpr) instead
Definition at line 530 of file previewjob.cpp.
◆ setDevicePixelRatio() [2/2]
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 536 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 541 of file previewjob.cpp.
◆ setOverlayIconAlpha()
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
- Deprecated:
- since 5.102, not implemented.
Definition at line 295 of file previewjob.cpp.
◆ setOverlayIconSize()
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
- Deprecated:
- since 5.102, not implemented.
Definition at line 279 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
- Since
- 4.7
Definition at line 310 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.
- Since
- 4.3
Definition at line 509 of file previewjob.cpp.
◆ 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 1050 of file previewjob.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:50:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.