diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 19:31:25 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 19:31:25 +0000 |
commit | 6afd9d8dddbe9e450690e05d498a503c00333a5e (patch) | |
tree | ee3eaca74e8e33dd66f24f5fb6c1431d7a9ff429 /ksquirrel/sq_thumbnailloadjob.h | |
download | ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.tar.gz ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.zip |
Added KDE3 version of ksquirrel photo manager
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sq_thumbnailloadjob.h')
-rw-r--r-- | ksquirrel/sq_thumbnailloadjob.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/ksquirrel/sq_thumbnailloadjob.h b/ksquirrel/sq_thumbnailloadjob.h new file mode 100644 index 0000000..4182014 --- /dev/null +++ b/ksquirrel/sq_thumbnailloadjob.h @@ -0,0 +1,101 @@ +/* + copyright : (C) 2004 by Baryshev Dmitry + KSquirrel - image viewer for KDE +*/ + +/* This file is part of the KDE project + Copyright (C) 2000 David Faure <faure@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef SQ_THUMBNAILLOADJOB_H +#define SQ_THUMBNAILLOADJOB_H + +#include <qimage.h> + +#include <kio/job.h> + +#include "sq_thumbnailinfo.h" + +class KFileItem; +class KTempFile; + +class SQ_DirThumbs; +class SQ_FileThumbView; + +typedef QPtrList<KFileItem> KFileItemList; + +/* + * SQ_ThumbnailLoadJob is a job for loading thumbnails + * in given directory. + */ + +class SQ_ThumbnailLoadJob : public KIO::Job +{ + Q_OBJECT + + public: + SQ_ThumbnailLoadJob(const KFileItemList &itemList, SQ_FileThumbView *parnt); + ~SQ_ThumbnailLoadJob(); + + virtual void kill(bool q = true); + + void start(); + void itemRemoved(const KFileItem* item); + void itemsRemoved(const KFileItemList &list); + void appendItem(const KFileItem* item); + void appendItems(const KFileItemList &items); + void prependItems(const KFileItemList &items); + + void pop(const KFileItemList &items); + + private: + void determineNextIcon(); + bool statResultThumbnail(); + void createThumbnail(const KURL &); + void emitThumbnailLoaded(SQ_Thumbnail &); + void emitThumbnailLoadingFailed(); + void insertOrSync(const KURL &, SQ_Thumbnail &th); + void nextFile(bool b); + + signals: + void thumbnailLoaded(const KFileItem* item, const SQ_Thumbnail &t); + void done(); + + private slots: + void slotResult(KIO::Job *job); + void slotData(KIO::Job *job, const QByteArray &data); + + private: + enum { STATE_STATORIG, STATE_PREDOWNLOAD, STATE_DOWNLOAD } mState; + + KFileItemList mItems; + KFileItem *mCurrentItem; + KURL mCurrentURL; + KURL mThumbURL; + KURL mTempURL; + KIO::filesize_t totalSize, size; + KTempFile *tmp; + time_t mOriginalTime; + QString mime; + bool continueDownload, donothing; + + SQ_DirThumbs *dir; + SQ_Thumbnail mBrokenThumbnail; + SQ_FileThumbView *parent; +}; + +#endif |