summaryrefslogtreecommitdiffstats
path: root/kio/kfile/kimagefilepreview.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /kio/kfile/kimagefilepreview.h
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
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/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/kfile/kimagefilepreview.h')
-rw-r--r--kio/kfile/kimagefilepreview.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/kio/kfile/kimagefilepreview.h b/kio/kfile/kimagefilepreview.h
new file mode 100644
index 000000000..cb034265a
--- /dev/null
+++ b/kio/kfile/kimagefilepreview.h
@@ -0,0 +1,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 <qpixmap.h>
+
+#include <kurl.h>
+#include <kpreviewwidgetbase.h>
+
+class QCheckBox;
+class QPushButton;
+class QLabel;
+class QTimer;
+
+class KFileDialog;
+class KFileItem;
+namespace KIO { class Job; class PreviewJob; }
+
+/**
+ * Image preview widget for the file dialog.
+ */
+class KIO_EXPORT KImageFilePreview : public KPreviewWidgetBase
+{
+ Q_OBJECT
+
+ public:
+ KImageFilePreview(QWidget *parent);
+ ~KImageFilePreview();
+
+ virtual QSize 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 QPixmap& );
+
+ protected:
+ virtual void resizeEvent(QResizeEvent *e);
+ virtual KIO::PreviewJob * createJob( const KURL& url,
+ int w, int h );
+
+ private slots:
+ void slotResult( KIO::Job * );
+ virtual void slotFailed( const KFileItem* );
+
+ private:
+ bool autoMode;
+ KURL currentURL;
+ QTimer *timer;
+ QLabel *imageLabel;
+ QLabel *infoLabel;
+ QCheckBox *autoPreview;
+ QPushButton *previewButton;
+ KIO::PreviewJob *m_job;
+ protected:
+ virtual void virtual_hook( int id, void* data );
+ private:
+ class KImageFilePreviewPrivate;
+ KImageFilePreviewPrivate *d;
+};
+
+#endif // KIMAGEFILEPREVIEW_H