libyui-qt  2.43.5
/usr/src/RPM/BUILD/libyui-qt-2.43.5/src/YQImage.h
00001 /*
00002   Copyright (C) 2000-2012 Novell, Inc
00003   This library is free software; you can redistribute it and/or modify
00004   it under the terms of the GNU Lesser General Public License as
00005   published by the Free Software Foundation; either version 2.1 of the
00006   License, or (at your option) version 3.0 of the License. This library
00007   is distributed in the hope that it will be useful, but WITHOUT ANY
00008   WARRANTY; without even the implied warranty of MERCHANTABILITY or
00009   FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00010   License for more details. You should have received a copy of the GNU
00011   Lesser General Public License along with this library; if not, write
00012   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
00013   Floor, Boston, MA 02110-1301 USA
00014 */
00015 
00016 
00017 /*-/
00018 
00019   File:       YQImage.h
00020 
00021   Author:     Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 
00026 #ifndef YQImage_h
00027 #define YQImage_h
00028 
00029 #include <qlabel.h>
00030 #include <qmovie.h>
00031 
00032 #include <yui/YImage.h>
00033 #include <yui/YUI.h>
00034 
00035 
00036 class YQImage : public QLabel, public YImage
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     /**
00042      * Constructor.
00043      *
00044      * 'animated' indicates if 'imageFileName' is an animated image format
00045      * (e.g., MNG).
00046      **/
00047     YQImage( YWidget *          parent,
00048              const std::string &        imageFileName,
00049              bool               animated = false );
00050 
00051     /**
00052      * Destructor.
00053      **/
00054     virtual ~YQImage();
00055 
00056     /**
00057      * Set and display a new image.
00058      *
00059      * Reimplemented from YImage.
00060      **/
00061     virtual void setImage( const std::string & imageFileName, bool animated = false );
00062 
00063     /**
00064      * Make the image fit into the available space.
00065      *
00066      * Reimplemented from YImage.
00067      **/
00068     virtual void setAutoScale( bool autoScale = true );
00069 
00070     /**
00071       * if false, the image will be displayed in gray
00072       */
00073     virtual void setEnabled( bool enabled );
00074 
00075     /**
00076      * Preferred width of the widget.
00077      *
00078      * Reimplemented from YWidget.
00079      **/
00080     virtual int preferredWidth();
00081 
00082     /**
00083      * Preferred height of the widget.
00084      *
00085      * Reimplemented from YWidget.
00086      **/
00087     virtual int preferredHeight();
00088 
00089     /**
00090      * Set the new size of the widget.
00091      *
00092      * Reimplemented from YWidget.
00093      **/
00094     virtual void setSize( int newWidth, int newHeight );
00095 
00096 protected:
00097 
00098     int         _pixmapWidth;
00099     int         _pixmapHeight;
00100 };
00101 
00102 #endif // YQImage_h
 All Classes Functions Variables