From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- juk/webimagefetcher.h | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 juk/webimagefetcher.h (limited to 'juk/webimagefetcher.h') diff --git a/juk/webimagefetcher.h b/juk/webimagefetcher.h new file mode 100644 index 00000000..796e205e --- /dev/null +++ b/juk/webimagefetcher.h @@ -0,0 +1,93 @@ +/*************************************************************************** + copyright : (C) 2004 Nathan Toone + email : nathan@toonetown.com + copyright : (C) 2007 Michael Pyne + email : michael.pyne@kdemail.net +***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef WEBIMAGEFETCHER_H +#define WEBIMAGEFETCHER_H + +#include + +#include +#include +#include + +#include "filehandle.h" + +class KURL; + +class QHttp; + +class WebImageFetcherDialog; + +class WebImage +{ +public: + WebImage(); + + WebImage(const QString &imageURL, + const QString &thumbURL, + int width, int height); + + QString imageURL() const { return m_imageURL; } + QString thumbURL() const { return m_thumbURL; } + QString size() const { return m_size; } + +private: + QString m_imageURL; + QString m_thumbURL; + QString m_size; +}; + +typedef QValueList WebImageList; + +class WebImageFetcher : public QObject +{ + Q_OBJECT + +public: + WebImageFetcher(QObject *parent); + ~WebImageFetcher(); + + void setFile(const FileHandle &file); + void chooseCover(); + +public slots: + void abortSearch(); + +signals: + void signalNewSearch(WebImageList &images); + void signalCoverChanged(int coverId); + +private: + void displayWaitMessage(); + void requestNewSearchTerms(bool noResults = false); + +private slots: + void slotLoadImageURLs(); + void slotWebRequestFinished(int id, bool error); + void slotCoverChosen(); + void slotNewSearch(); + +private: + FileHandle m_file; + QString m_searchString; + QString m_loadedQuery; + WebImageList m_imageList; + uint m_selectedIndex; + QHttp *m_connection; + int m_connectionId; + WebImageFetcherDialog *m_dialog; +}; +#endif -- cgit v1.2.1