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

KIO

  • kio
  • kio
previewjob.h
Go to the documentation of this file.
1// -*- c++ -*-
2// vim: ts=4 sw=4 et
3/* This file is part of the KDE libraries
4 Copyright (C) 2000 David Faure <faure@kde.org>
5 2000 Carsten Pfeiffer <pfeiffer@kde.org>
6 2001 Malte Starostik <malte.starostik@t-online.de>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
23
24#ifndef KIO_PREVIEWJOB_H
25#define KIO_PREVIEWJOB_H
26
27#include <kfileitem.h>
28#include <kio/job.h>
29
30class QPixmap;
31
32namespace KIO {
33 class PreviewJobPrivate;
38 class KIO_EXPORT PreviewJob : public KIO::Job
39 {
40 Q_OBJECT
41 public:
46 enum ScaleType {
51 Unscaled,
56 Scaled,
62 ScaledAndCached
63 };
64
65#ifndef KDE_NO_DEPRECATED
86 KDE_DEPRECATED PreviewJob(const KFileItemList& items, int width, int height,
87 int iconSize, int iconAlpha, bool scale, bool save,
88 const QStringList *enabledPlugins);
89#endif
90
100 PreviewJob(const KFileItemList &items,
101 const QSize &size,
102 const QStringList *enabledPlugins = 0);
103
104 virtual ~PreviewJob();
105
113 void setOverlayIconSize(int size);
114
120 int overlayIconSize() const;
121
129 void setOverlayIconAlpha(int alpha);
130
137 int overlayIconAlpha() const;
138
145 void setScaleType(ScaleType type);
146
152 ScaleType scaleType() const;
153
160 void removeItem( const KUrl& url );
161
166 void setIgnoreMaximumSize(bool ignoreSize = true);
167
176 void setSequenceIndex(int index);
177
183 int sequenceIndex() const;
184
191 static QStringList availablePlugins();
192
198 static QStringList supportedMimeTypes();
199
207#ifndef KDE_NO_DEPRECATED
208 KDE_DEPRECATED static KIO::filesize_t maximumFileSize();
209#endif
210
211
212 Q_SIGNALS:
219 void gotPreview( const KFileItem& item, const QPixmap &preview );
226 void failed( const KFileItem& item );
227
228 protected Q_SLOTS:
229 virtual void slotResult( KJob *job );
230
231 private:
232 Q_PRIVATE_SLOT(d_func(), void startPreview())
233 Q_PRIVATE_SLOT(d_func(), void slotThumbData(KIO::Job *, const QByteArray &))
234 Q_DECLARE_PRIVATE(PreviewJob)
235 };
236
237#ifndef KDE_NO_DEPRECATED
261 KIO_EXPORT_DEPRECATED PreviewJob *filePreview( const KFileItemList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = 0 ); // KDE5: use enums instead of bool scale + bool save
262
286 KIO_EXPORT_DEPRECATED PreviewJob *filePreview( const KUrl::List &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = 0 );
287#endif
288
299 KIO_EXPORT PreviewJob *filePreview(const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins = 0);
300}
301
302#endif
KFileItemList
List of KFileItems, which adds a few helper methods to QList<KFileItem>.
Definition: kfileitem.h:675
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:46
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::PreviewJob
KIO Job to get a thumbnail picture.
Definition: previewjob.h:39
KIO::PreviewJob::ScaleType
ScaleType
Specifies the type of scaling that is applied to the generated preview.
Definition: previewjob.h:46
KIO::PreviewJob::Unscaled
@ Unscaled
The original size of the preview will be returned.
Definition: previewjob.h:51
KIO::PreviewJob::Scaled
@ Scaled
The preview will be scaled to the size specified when constructing the PreviewJob.
Definition: previewjob.h:56
KIO::PreviewJob::failed
void failed(const KFileItem &item)
Emitted when a thumbnail for item could not be created, either because a ThumbCreator for its MIME ty...
KIO::PreviewJob::gotPreview
void gotPreview(const KFileItem &item, const QPixmap &preview)
Emitted when a thumbnail picture for item has been successfully retrieved.
KJob
KUrl::List
KUrl
job.h
kfileitem.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO::filePreview
PreviewJob * filePreview(const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
Definition: previewjob.cpp:755
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal