00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KJSEMBED_IMAGE_IMP_H
00023 #define KJSEMBED_IMAGE_IMP_H
00024
00025 #include <qobject.h>
00026
00027 class QImage;
00028
00029 namespace KJSEmbed {
00030 namespace Bindings {
00031
00035 class Image : public QObject
00036 {
00037 Q_OBJECT
00038 Q_PROPERTY( int width READ width )
00039 Q_PROPERTY( int height READ height )
00040 Q_PROPERTY( int depth READ depth )
00041 Q_PROPERTY( bool ok READ isOk )
00042 Q_PROPERTY( QString format READ format WRITE setFormat )
00043 Q_PROPERTY( QString filename READ filename )
00044
00045 public:
00046 Image( QObject *parent, const char *name=0 );
00047 Image( QObject *parent, const char *name, QImage *img );
00048 virtual ~Image();
00049
00050 QString filename() const;
00051 QString format() const;
00052 int width() const;
00053 int height() const;
00054 int depth() const;
00055
00056 bool isOk() const;
00057
00058 public slots:
00059 bool load( const QString &filename );
00060 bool save( const QString &filename );
00061 void setFormat( const QString &fmt );
00062 void smoothScale( int w, int h );
00063 void smoothScaleMin( int w, int h );
00064
00065 private:
00066 QImage *img;
00067 QString nm;
00068 QString fmt;
00069 bool ok;
00070 };
00071
00072 }
00073 }
00074
00075 #endif // KJSEMBED_IMAGE_IMP_H