previewjob.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __kio_previewjob_h__
00025 #define __kio_previewjob_h__
00026
00027 #include <kfileitem.h>
00028 #include <kio/job.h>
00029
00030 class QPixmap;
00031
00032 namespace KIO {
00037 class PreviewJob : public KIO::Job
00038 {
00039 Q_OBJECT
00040 public:
00057 PreviewJob( const KFileItemList &items, int width, int height,
00058 int iconSize, int iconAlpha, bool scale, bool save,
00059 const QStringList *enabledPlugins, bool deleteItems = false );
00060 virtual ~PreviewJob();
00061
00068 void removeItem( const KFileItem *item );
00069
00076 static QStringList availablePlugins();
00077
00083 static QStringList supportedMimeTypes();
00084
00085 signals:
00092 void gotPreview( const KFileItem *item, const QPixmap &preview );
00099 void failed( const KFileItem *item );
00100
00101 protected:
00102 void getOrCreateThumbnail();
00103 bool statResultThumbnail();
00104 void createThumbnail( QString );
00105
00106 protected slots:
00107 virtual void slotResult( KIO::Job *job );
00108
00109 private slots:
00110 void startPreview();
00111 void slotThumbData(KIO::Job *, const QByteArray &);
00112
00113 private:
00114 void determineNextFile();
00115 void emitPreview(const QImage &thumb);
00116 void emitFailed(const KFileItem *item = 0);
00117
00118 protected:
00119 virtual void virtual_hook( int id, void* data );
00120 private:
00121 struct PreviewJobPrivate *d;
00122 };
00123
00144 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 );
00145
00166 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 );
00167 }
00168
00169 #endif
This file is part of the documentation for kio Library Version 3.3.0.