libyui  3.0.10
/usr/src/RPM/BUILD/libyui-3.0.10/src/YSquash.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:         YSquash.h
00020 
00021   Author:       Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 #ifndef YSquash_h
00026 #define YSquash_h
00027 
00028 #include "YSingleChildContainerWidget.h"
00029 #include "ImplPtr.h"
00030 
00031 
00032 class YSquashPrivate;
00033 
00034 /**
00035  * HSquash, VSquash HVSquash:
00036  *
00037  * Squash is a widget that "squashes" its one child during layout, i.e., it
00038  * reduces it in size down to its preferred size. It may squash vertically,
00039  * horizontally or in both dimensions.
00040  **/
00041 class YSquash : public YSingleChildContainerWidget
00042 {
00043 protected:
00044     /**
00045      * Constructor.
00046      *
00047      * Squashes horizontally if 'horSquash' is 'true',
00048      * vertically if 'vertSquash' is 'true'.
00049      **/
00050     YSquash( YWidget * parent, bool horSquash, bool vertSquash );
00051 
00052 public:
00053     /**
00054      * Destructor.
00055      **/
00056     virtual ~YSquash();
00057 
00058     /**
00059      * Returns a descriptive name of this widget class for logging,
00060      * debugging etc.
00061      **/
00062     virtual const char * widgetClass() const;
00063 
00064     /**
00065      * Returns 'true' if this widget squashes horizontally.
00066      **/
00067     bool horSquash() const;
00068 
00069     /**
00070      * Returns 'true' if this widget squashes vertically.
00071      **/
00072     bool vertSquash() const;
00073 
00074 
00075     /**
00076      * In a squashed dimension the widget NOT stretchable.
00077      * In an unsquashed dimension the widget is stretchable if the
00078      * child is stretchable.
00079      **/
00080     bool stretchable( YUIDimension dim ) const;
00081 
00082 private:
00083 
00084     ImplPtr<YSquashPrivate> priv;
00085 };
00086 
00087 
00088 #endif // YSquash_h
 All Classes Functions Variables Enumerations Friends