libyui-qt  2.43.5
/usr/src/RPM/BUILD/libyui-qt-2.43.5/src/YQAlignment.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:       YQAlignment.h
00020 
00021   Author:     Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 
00026 #ifndef YQAlignment_h
00027 #define YQAlignment_h
00028 
00029 #include <qwidget.h>
00030 
00031 #include <yui/YAlignment.h>
00032 
00033 class QWidget;
00034 
00035 class YQAlignment : public QWidget, public YAlignment
00036 {
00037     Q_OBJECT
00038 
00039 public:
00040 
00041     /**
00042      * Constructor.
00043      **/
00044     YQAlignment( YWidget *              parent,
00045                  YAlignmentType         horAlign,
00046                  YAlignmentType         vertAlign );
00047 
00048     /**
00049      * Constructor for cases where the YWidget parent's widgetRep() isn't the
00050      * QWidget parent, for example in compound widgets like YQWizard where it
00051      * makes sense to pass a child of the YQWizard (the client area) as the
00052      * QWidget parent.
00053      *
00054      * Use this only if you know very well what you are doing.
00055      **/
00056     YQAlignment( YWidget *              yParent,
00057                  QWidget *              qParent,
00058                  YAlignmentType         horAlign,
00059                  YAlignmentType         vertAlign );
00060 
00061     /**
00062      * Move the child widget to a new position.
00063      *
00064      * Implemented from YAlignment.
00065      **/
00066     virtual void moveChild( YWidget * child, int newX, int newY );
00067 
00068     /**
00069      * Enable or disable this widget and its child.
00070      *
00071      * Reimplemented from YWidget.
00072      **/
00073     virtual void setEnabled( bool enabled );
00074 
00075     /**
00076      * Set the new size of the widget.
00077      *
00078      * Reimplemented from YWidget.
00079      **/
00080     virtual void setSize( int newWidth, int newHeight );
00081 
00082     /**
00083      * Set the background pixmap.
00084      *
00085      * Reimplemented from YAlignment.
00086      **/
00087      virtual void setBackgroundPixmap( const std::string & pixmapFileName );
00088 
00089 protected:
00090      std::string _pixmapFileName;
00091      virtual void paintEvent ( QPaintEvent * event );
00092 
00093 };
00094 
00095 
00096 #endif // YQAlignment_h
 All Classes Functions Variables