Fairly large overhaul of the JuK codebase to beat out a lot of the Qt 3 stuff.
[kdemultimedia.git] / juk / googlefetcherdialog.h
blob74f205f8e8d4616afc311deed1a0dc784340340d
1 /***************************************************************************
2 copyright : (C) 2004 Nathan Toone
3 email : nathan@toonetown.com
4 ***************************************************************************/
6 /***************************************************************************
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 ***************************************************************************/
15 #ifndef GOOGLEFETCHERDIALOG_H
16 #define GOOGLEFETCHERDIALOG_H
18 #include <kdialog.h>
19 #include <k3iconview.h>
21 #include "googlefetcher.h"
22 #include "filehandle.h"
24 #include <QPixmap>
25 #include <QPointer>
27 class KUrl;
29 class GoogleFetcherDialog : public KDialog
31 Q_OBJECT
33 public:
34 GoogleFetcherDialog(const QString &name,
35 const GoogleImageList &urlList,
36 const FileHandle &file,
37 QWidget *parent = 0);
39 virtual ~GoogleFetcherDialog();
41 QPixmap result() const { return m_pixmap; }
42 bool takeIt() const { return m_takeIt; }
43 bool newSearch() const { return m_newSearch; }
45 void setLayout();
46 void setImageList(const GoogleImageList &urlList);
48 public slots:
49 int exec();
50 void refreshScreen(GoogleImageList &list);
52 signals:
53 void sizeChanged(GoogleFetcher::ImageSize);
55 protected slots:
56 void slotOk();
57 void slotCancel();
58 void slotUser1();
59 void imgSizeChanged(int index);
61 private:
62 QPixmap fetchedImage(int index) const;
63 QPixmap pixmapFromURL(const KUrl &url) const;
65 QPixmap m_pixmap;
66 GoogleImageList m_imageList;
67 K3IconView *m_iconWidget;
68 bool m_takeIt;
69 bool m_newSearch;
70 FileHandle m_file;
73 namespace KIO
75 class TransferJob;
76 class Job;
79 class CoverIconViewItem : public QObject, public K3IconViewItem
81 Q_OBJECT
83 public:
84 CoverIconViewItem(Q3IconView *parent, const GoogleImage &image);
85 ~CoverIconViewItem();
87 private slots:
88 void imageData(KIO::Job *job, const QByteArray &data);
89 void imageResult(KIO::Job *job);
91 private:
92 QByteArray m_buffer;
93 QPointer<KIO::TransferJob> m_job;
96 #endif
98 // vim: set et sw=4 tw=0 sta: