# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# previewjob.h

    00001 // -*- c++ -*-
    00002 // vim: ts=4 sw=4 et
    00003 /*  This file is part of the KDE libraries
    00004     Copyright (C) 2000 David Faure <faure@kde.org>
    00005                   2000 Carsten Pfeiffer <pfeiffer@kde.org>
    00006                   2001 Malte Starostik <malte.starostik@t-online.de>
    00007
    00008     This library is free software; you can redistribute it and/or
    00009     modify it under the terms of the GNU Library General Public
    00010     License as published by the Free Software Foundation; either
    00011     version 2 of the License, or (at your option) any later version.
    00012
    00013     This library is distributed in the hope that it will be useful,
    00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00016     Library General Public License for more details.
    00017
    00018     You should have received a copy of the GNU Library General Public License
    00019     along with this library; see the file COPYING.LIB.  If not, write to
    00020     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00021     Boston, MA 02111-1307, USA.
    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 {
    00036     class PreviewJob : public KIO::Job
    00037     {
    00038         Q_OBJECT
    00039     public:
    00040         PreviewJob( const KFileItemList &items, int width, int height,
    00041             int iconSize, int iconAlpha, bool scale, bool save,
    00042             const QStringList *enabledPlugins, bool deleteItems = false );
    00043         virtual ~PreviewJob();
    00044
    00051         void removeItem( const KFileItem *item );
    00052
    00058         static QStringList availablePlugins();
    00059
    00064         static QStringList supportedMimeTypes();
    00065
    00066     signals:
    00071         void gotPreview( const KFileItem *item, const QPixmap &preview );
    00077         void failed( const KFileItem *item );
    00078
    00079     protected:
    00080         void getOrCreateThumbnail();
    00081         bool statResultThumbnail();
    00082         void createThumbnail( QString );
    00083
    00084     protected slots:
    00085         virtual void slotResult( KIO::Job *job );
    00086
    00087     private slots:
    00088         void startPreview();
    00089         void slotThumbData(KIO::Job *, const QByteArray &);
    00090
    00091     private:
    00092         void determineNextFile();
    00093         void emitPreview(const QImage &thumb);
    00094         void emitFailed(const KFileItem *item = 0);
    00095
    00096     protected:
    00097         virtual void virtual_hook( int id, void* data );
    00098     private:
    00099         struct PreviewJobPrivate *d;
    00100     };
    00101
    00120     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 );
    00121
    00125     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 );
    00126 }
    00127
    00128 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:14:36 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001