KIO
previewjob.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, 00021 Boston, MA 02110-1301, 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 { 00033 class PreviewJobPrivate; 00038 class KIO_EXPORT PreviewJob : public KIO::Job 00039 { 00040 Q_OBJECT 00041 public: 00057 PreviewJob( const KFileItemList& items, int width, int height, 00058 int iconSize, int iconAlpha, bool scale, bool save, 00059 const QStringList *enabledPlugins ); 00060 virtual ~PreviewJob(); 00061 00068 void removeItem( const KUrl& url ); 00069 00074 void setIgnoreMaximumSize(bool ignoreSize = true); 00075 00084 void setSequenceIndex(int index); 00085 00091 int sequenceIndex() const; 00092 00099 static QStringList availablePlugins(); 00100 00106 static QStringList supportedMimeTypes(); 00107 00115 #ifndef KDE_NO_DEPRECATED 00116 KDE_DEPRECATED static KIO::filesize_t maximumFileSize(); 00117 #endif 00118 00119 00120 Q_SIGNALS: 00127 void gotPreview( const KFileItem& item, const QPixmap &preview ); 00134 void failed( const KFileItem& item ); 00135 00136 protected Q_SLOTS: 00137 virtual void slotResult( KJob *job ); 00138 00139 private: 00140 Q_PRIVATE_SLOT(d_func(), void startPreview()) 00141 Q_PRIVATE_SLOT(d_func(), void slotThumbData(KIO::Job *, const QByteArray &)) 00142 Q_DECLARE_PRIVATE(PreviewJob) 00143 }; 00144 00165 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 ); // KDE5: use enums instead of bool scale + bool save 00166 00187 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 ); 00188 } 00189 00190 #endif
KDE 4.6 API Reference