- Don't create layouts with parent. Qt 4.x automatically reparents
[duncan/yast2-qt4.git] / src / YQImage.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQImage.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQImage_h
21 #define YQImage_h
22
23 #include <qlabel.h>
24 #include <qmovie.h>
25
26 #include "YImage.h"
27 #include "YUI.h"
28
29
30 class YQImage : public QLabel, public YImage
31 {
32     Q_OBJECT
33
34 public:
35     /**
36      * Constructor.
37      *
38      * 'animated' indicates if 'imageFileName' is an animated image format
39      * (e.g., MNG).
40      **/
41     YQImage( YWidget *          parent,
42              const string &     imageFileName,
43              bool               animated = false );
44
45     /**
46      * Destructor.
47      **/
48     virtual ~YQImage();
49
50     /**
51      * Set and display a new image.
52      *
53      * Reimplemented from YImage.
54      **/
55     virtual void setImage( const string & imageFileName, bool animated = false );
56     
57     /**
58      * Make the image fit into the available space.
59      *
60      * Reimplemented from YImage.
61      **/
62     virtual void setAutoScale( bool autoScale = true );
63
64     /**
65       * if false, the image will be displayed in gray
66       */
67     virtual void setEnabled( bool enabled );
68
69     /**
70      * Preferred width of the widget.
71      *
72      * Reimplemented from YWidget.
73      **/
74     virtual int preferredWidth();
75
76     /**
77      * Preferred height of the widget.
78      *
79      * Reimplemented from YWidget.
80      **/
81     virtual int preferredHeight();
82
83     /**
84      * Set the new size of the widget.
85      *
86      * Reimplemented from YWidget.
87      **/
88     virtual void setSize( int newWidth, int newHeight );
89
90 protected:
91
92     int         _pixmapWidth;
93     int         _pixmapHeight;
94 };
95
96 #endif // YQImage_h