Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

image_imp.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *  Copyright (C) 2003, Richard J. Moore <rich@kde.org>
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Library General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public License
00017  *  along with this library; see the file COPYING.LIB.  If not, write to
00018  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  *  Boston, MA 02111-1307, USA.
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 } // namespace
00073 } // namespace
00074 
00075 #endif // KJSEMBED_IMAGE_IMP_H

Generated at Sat Feb 1 03:23:35 2003 for KJSEmbed by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001