~neon/juk/master

« back to all changes in this revision

Viewing changes to googlefetcherdialog.h

  • Committer: Laurent Montel
  • Date: 2006-10-05 08:04:57 UTC
  • Revision ID: git-v1:6d286b4be0b244323cd0953569d56deccc4afb05
Port to uic4

svn path=/trunk/KDE/kdemultimedia/juk/; revision=592631

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    copyright            : (C) 2004 Nathan Toone
 
3
    email                : nathan@toonetown.com
 
4
***************************************************************************/
 
5
 
 
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
 ***************************************************************************/
 
14
 
 
15
#ifndef GOOGLEFETCHERDIALOG_H
 
16
#define GOOGLEFETCHERDIALOG_H
 
17
 
 
18
#include <k3iconview.h>
 
19
#include <kio/job.h>
 
20
 
 
21
 
 
22
#include "googlefetcher.h"
 
23
//Added by qt3to4:
 
24
#include <QPixmap>
 
25
 
 
26
class KUrl;
 
27
 
 
28
class GoogleFetcherDialog : public KDialog
 
29
{
 
30
    Q_OBJECT
 
31
 
 
32
public:
 
33
    GoogleFetcherDialog(const QString &name,
 
34
                        const GoogleImageList &urlList,
 
35
                        const FileHandle &file,
 
36
                        QWidget *parent = 0);
 
37
 
 
38
    virtual ~GoogleFetcherDialog();
 
39
 
 
40
    QPixmap result() const { return m_pixmap; }
 
41
    bool takeIt() const { return m_takeIt; }
 
42
    bool newSearch() const { return m_newSearch; }
 
43
 
 
44
    void setLayout();
 
45
    void setImageList(const GoogleImageList &urlList);
 
46
 
 
47
public slots:
 
48
    int exec();
 
49
    void refreshScreen(GoogleImageList &list);
 
50
 
 
51
signals:
 
52
    void sizeChanged(GoogleFetcher::ImageSize);
 
53
 
 
54
protected slots:
 
55
    void slotOk();
 
56
    void slotCancel();
 
57
    void slotUser1();
 
58
    void imgSizeChanged(int index);
 
59
 
 
60
private:
 
61
    QPixmap fetchedImage(int index) const;
 
62
    QPixmap pixmapFromURL(const KUrl &url) const;
 
63
 
 
64
    QPixmap m_pixmap;
 
65
    GoogleImageList m_imageList;
 
66
    K3IconView *m_iconWidget;
 
67
    bool m_takeIt;
 
68
    bool m_newSearch;
 
69
    FileHandle m_file;
 
70
};
 
71
 
 
72
namespace KIO
 
73
{
 
74
    class TransferJob;
 
75
}
 
76
 
 
77
class CoverIconViewItem : public QObject, public K3IconViewItem
 
78
{
 
79
    Q_OBJECT
 
80
 
 
81
public:
 
82
    CoverIconViewItem(Q3IconView *parent, const GoogleImage &image);
 
83
    ~CoverIconViewItem();
 
84
 
 
85
private slots:
 
86
    void imageData(KIO::Job *job, const QByteArray &data);
 
87
    void imageResult(KJob* job);
 
88
 
 
89
private:
 
90
    QByteArray m_buffer;
 
91
    QPointer<KIO::TransferJob> m_job;
 
92
};
 
93
 
 
94
#endif
 
95
 
 
96
// vim: set et sw=4 tw=0 sta: