previewjob.h
// -*- c++ -*-
// vim: ts=4 sw=4 et
/* This file is part of the KDE libraries
Copyright (C) 2000 David Faure <faure@kde.org>
2000 Carsten Pfeiffer <pfeiffer@kde.org>
2001 Malte Starostik <malte.starostik@t-online.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kio_previewjob_h__
#define __kio_previewjob_h__
#include <kfileitem.h>
#include <kio/job.h>
class QPixmap;
namespace KIO {
class KIO_EXPORT PreviewJob : public KIO::Job
{
Q_OBJECT
public:
PreviewJob( const KFileItemList &items, int width, int height,
int iconSize, int iconAlpha, bool scale, bool save,
const QStringList *enabledPlugins, bool deleteItems = false );
virtual ~PreviewJob();
void removeItem( const KFileItem *item );
void setIgnoreMaximumSize(bool ignoreSize = true);
static QStringList availablePlugins();
static QStringList supportedMimeTypes();
virtual void kill( bool quietly = true );
signals:
void gotPreview( const KFileItem *item, const QPixmap &preview );
void failed( const KFileItem *item );
protected:
void getOrCreateThumbnail();
bool statResultThumbnail();
void createThumbnail( QString );
protected slots:
virtual void slotResult( KIO::Job *job );
private slots:
void startPreview();
void slotThumbData(KIO::Job *, const QByteArray &);
private:
void determineNextFile();
void emitPreview(const QImage &thumb);
void emitFailed(const KFileItem *item = 0);
protected:
virtual void virtual_hook( int id, void* data );
private:
struct PreviewJobPrivate *d;
};
KIO_EXPORT 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 );
KIO_EXPORT 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 );
}
#endif
KIO::PreviewJob
KIO Job to get a thumbnail picture.
Definition: previewjob.h:37
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::filePreview
KIO_EXPORT 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:569
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:41

KDE Home | KDE Accessibility Home | Description of Access Keys