libyui  3.3.2
YSquash.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YSquash.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YSquash_h
26 #define YSquash_h
27 
28 #include "YSingleChildContainerWidget.h"
29 #include "ImplPtr.h"
30 
31 
32 class YSquashPrivate;
33 
34 /**
35  * HSquash, VSquash HVSquash: reduce child to its preferred size.
36  *
37  * Squash is a widget that "squashes" its one child during layout, i.e., it
38  * reduces it in size down to its preferred size. It may squash vertically,
39  * horizontally or in both dimensions.
40  **/
42 {
43 protected:
44  /**
45  * Constructor.
46  *
47  * Squashes horizontally if 'horSquash' is 'true',
48  * vertically if 'vertSquash' is 'true'.
49  **/
50  YSquash( YWidget * parent, bool horSquash, bool vertSquash );
51 
52 public:
53  /**
54  * Destructor.
55  **/
56  virtual ~YSquash();
57 
58  /**
59  * Returns a descriptive name of this widget class for logging,
60  * debugging etc.
61  **/
62  virtual const char * widgetClass() const;
63 
64  /**
65  * Returns 'true' if this widget squashes horizontally.
66  **/
67  bool horSquash() const;
68 
69  /**
70  * Returns 'true' if this widget squashes vertically.
71  **/
72  bool vertSquash() const;
73 
74 
75  /**
76  * In a squashed dimension the widget NOT stretchable.
77  * In an unsquashed dimension the widget is stretchable if the
78  * child is stretchable.
79  **/
80  bool stretchable( YUIDimension dim ) const;
81 
82 private:
83 
85 };
86 
87 
88 #endif // YSquash_h
bool vertSquash() const
Returns &#39;true&#39; if this widget squashes vertically.
Definition: YSquash.cc:64
bool horSquash() const
Returns &#39;true&#39; if this widget squashes horizontally.
Definition: YSquash.cc:58
YSquash(YWidget *parent, bool horSquash, bool vertSquash)
Constructor.
Definition: YSquash.cc:44
HSquash, VSquash HVSquash: reduce child to its preferred size.
Definition: YSquash.h:41
YWidget * parent() const
Return this widget&#39;s parent or 0 if it doesn&#39;t have a parent.
Definition: YWidget.cc:269
virtual ~YSquash()
Destructor.
Definition: YSquash.cc:52
Container widget class that manages one child.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
Definition: YSquash.cc:80
bool stretchable(YUIDimension dim) const
In a squashed dimension the widget NOT stretchable.
Definition: YSquash.cc:70
Abstract base class of all UI widgets.
Definition: YWidget.h:54