summaryrefslogtreecommitdiffstats
path: root/kio/kfile/kimagefilepreview.h
blob: 0604e08f06dfa21829b4906b8d3712f7abcca733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 *
 * This file is part of the KDE project.
 * Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
 *               2001 Carsten Pfeiffer <pfeiffer@kde.org>
 *
 * You can Freely distribute this program under the GNU Library General Public
 * License. See the file "COPYING" for the exact licensing terms.
 */

#ifndef KIMAGEFILEPREVIEW_H
#define KIMAGEFILEPREVIEW_H

#include <tqpixmap.h>

#include <kurl.h>
#include <kpreviewwidgetbase.h>

class TQCheckBox;
class TQPushButton;
class TQLabel;
class TQTimer;

class KFileDialog;
class KFileItem;
namespace TDEIO { class Job; class PreviewJob; }

/**
 * Image preview widget for the file dialog.
 */
class TDEIO_EXPORT KImageFilePreview : public KPreviewWidgetBase
{
	Q_OBJECT

	public:
		KImageFilePreview(TQWidget *parent);
		~KImageFilePreview();

		virtual TQSize sizeHint() const;

	public slots:
		virtual void showPreview(const KURL &url);
		virtual void clearPreview();

	protected slots:
		void showPreview();
		void showPreview( const KURL& url, bool force );

		void toggleAuto(bool);
		virtual void gotPreview( const KFileItem*, const TQPixmap& );

	protected:
		virtual void resizeEvent(TQResizeEvent *e);
		virtual TDEIO::PreviewJob * createJob( const KURL& url,
                                                     int w, int h );

	private slots:
		void slotResult( TDEIO::Job * );
		virtual void slotFailed( const KFileItem* );

	private:
		bool autoMode;
		KURL currentURL;
		TQTimer *timer;
		TQLabel *imageLabel;
		TQLabel *infoLabel;
		TQCheckBox *autoPreview;
		TQPushButton *previewButton;
		TDEIO::PreviewJob *m_job;
        protected:
                virtual void virtual_hook( int id, void* data );
        private:
                class KImageFilePreviewPrivate;
                KImageFilePreviewPrivate *d;
};

#endif // KIMAGEFILEPREVIEW_H