home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kimagefilepreview.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  1.8 KB  |  78 lines

  1. /*
  2.  *
  3.  * This file is part of the KDE project.
  4.  * Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
  5.  *               2001 Carsten Pfeiffer <pfeiffer@kde.org>
  6.  *
  7.  * You can Freely distribute this program under the GNU Library General Public
  8.  * License. See the file "COPYING" for the exact licensing terms.
  9.  */
  10.  
  11. #ifndef KIMAGEFILEPREVIEW_H
  12. #define KIMAGEFILEPREVIEW_H
  13.  
  14. #include <qpixmap.h>
  15.  
  16. #include <kurl.h>
  17. #include <kpreviewwidgetbase.h>
  18.  
  19. class QCheckBox;
  20. class QPushButton;
  21. class QLabel;
  22. class QTimer;
  23.  
  24. class KFileDialog;
  25. class KFileItem;
  26. namespace KIO { class Job; class PreviewJob; }
  27.  
  28. /**
  29.  * Image preview widget for the file dialog.
  30.  */
  31. class KIO_EXPORT KImageFilePreview : public KPreviewWidgetBase
  32. {
  33.     Q_OBJECT
  34.  
  35.     public:
  36.         KImageFilePreview(QWidget *parent);
  37.         ~KImageFilePreview();
  38.  
  39.         virtual QSize sizeHint() const;
  40.  
  41.     public slots:
  42.         virtual void showPreview(const KURL &url);
  43.         virtual void clearPreview();
  44.  
  45.     protected slots:
  46.         void showPreview();
  47.         void showPreview( const KURL& url, bool force );
  48.  
  49.         void toggleAuto(bool);
  50.         virtual void gotPreview( const KFileItem*, const QPixmap& );
  51.  
  52.     protected:
  53.         virtual void resizeEvent(QResizeEvent *e);
  54.         virtual KIO::PreviewJob * createJob( const KURL& url,
  55.                                                      int w, int h );
  56.  
  57.     private slots:
  58.         void slotResult( KIO::Job * );
  59.         virtual void slotFailed( const KFileItem* );
  60.  
  61.     private:
  62.         bool autoMode;
  63.         KURL currentURL;
  64.         QTimer *timer;
  65.         QLabel *imageLabel;
  66.         QLabel *infoLabel;
  67.         QCheckBox *autoPreview;
  68.         QPushButton *previewButton;
  69.         KIO::PreviewJob *m_job;
  70.         protected:
  71.                 virtual void virtual_hook( int id, void* data );
  72.         private:
  73.                 class KImageFilePreviewPrivate;
  74.                 KImageFilePreviewPrivate *d;
  75. };
  76.  
  77. #endif // KIMAGEFILEPREVIEW_H
  78.