kstars
imageviewer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef IMAGEVIEWER_H
00019 #define IMAGEVIEWER_H
00020
00021 #include <qimage.h>
00022 #include <qpixmap.h>
00023
00024 #include <kpixmapio.h>
00025 #include <kio/job.h>
00026 #include <ktempfile.h>
00027 #include <kmainwindow.h>
00028
00045 class KURL;
00046 class QFile;
00047
00048 class ImageViewer : public KMainWindow {
00049 Q_OBJECT
00050
00051 public:
00053 ImageViewer (const KURL *imageName, const QString &capText, QWidget *parent, const char *name = 0);
00054
00056 ~ImageViewer();
00057
00058 protected:
00060 void paintEvent (QPaintEvent *ev);
00061
00066 void resizeEvent (QResizeEvent *ev);
00067
00069 void closeEvent (QCloseEvent *ev);
00070
00075 void keyPressEvent (QKeyEvent *ev);
00076
00080 void keyReleaseEvent (QKeyEvent *ev);
00081
00082 private:
00087 void showImage( void );
00088
00091 void loadImageFromURL( void );
00092
00095 void saveFile (KURL &url);
00096
00099 void checkJob();
00100
00101 QImage image;
00102 QPixmap pix;
00103 KPixmapIO kpix;
00104 KTempFile tempfile;
00105 QFile *file;
00106
00107 const KURL imageURL;
00108 bool fileIsImage;
00109 QString filename;
00110 bool ctrl, key_s, key_q;
00111
00112 KIO::Job *downloadJob;
00113
00114 private slots:
00116 void downloadReady (KIO::Job *);
00117
00119 void saveFileToDisc( void );
00120
00122 void close( void );
00123 };
00124
00125 #endif