libyui
YAlignment.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: YAlignment.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YAlignment_h
26 #define YAlignment_h
27 
28 #include "YSingleChildContainerWidget.h"
29 
30 
31 class YAlignmentPrivate;
32 
42 {
43 protected:
48  YAlignmentType horAlign,
49  YAlignmentType vertAlign );
50 
51 public:
55  virtual ~YAlignment();
56 
61  virtual const char * widgetClass() const;
62 
66  YAlignmentType alignment( YUIDimension dim ) const;
67 
72  int leftMargin() const;
73 
78  int rightMargin() const;
79 
84  int topMargin() const;
85 
90  int bottomMargin() const;
91 
95  int totalMargins( YUIDimension dim ) const;
96 
100  void setLeftMargin( int margin );
101 
105  void setRightMargin( int margin );
106 
110  void setTopMargin( int margin );
111 
115  void setBottomMargin( int margin );
116 
121  int minWidth() const;
122 
127  int minHeight() const;
128 
132  void setMinWidth( int width );
133 
137  void setMinHeight( int height );
138 
149  virtual void setBackgroundPixmap( const std::string & pixmapFileName );
150 
155  std::string backgroundPixmap() const;
156 
163  virtual void addChild( YWidget * child );
164 
168  virtual void moveChild( YWidget *child, int newx, int newy ) = 0;
169 
178  virtual bool stretchable( YUIDimension dim ) const;
179 
185  virtual int preferredWidth();
186 
192  virtual int preferredHeight();
193 
201  virtual void setSize( int newWidth, int newHeight );
202 
203 
204 protected:
205 
207 };
208 
209 
210 #endif // YAlignment_h
std::string backgroundPixmap() const
Definition: YAlignment.cc:170
int minWidth() const
Definition: YAlignment.cc:146
int minHeight() const
Definition: YAlignment.cc:152
virtual bool stretchable(YUIDimension dim) const
Definition: YAlignment.cc:185
virtual int preferredHeight()
Definition: YAlignment.cc:206
virtual void moveChild(YWidget *child, int newx, int newy)=0
YWidget * parent() const
Definition: YWidget.cc:271
YAlignment(YWidget *parent, YAlignmentType horAlign, YAlignmentType vertAlign)
Definition: YAlignment.cc:75
virtual void addChild(YWidget *child)
Definition: YAlignment.cc:176
void setMinHeight(int height)
Definition: YAlignment.cc:164
virtual void setSize(int newWidth, int newHeight)
Definition: YAlignment.cc:218
void setMinWidth(int width)
Definition: YAlignment.cc:158
YAlignmentType alignment(YUIDimension dim) const
Definition: YAlignment.cc:92
Definition: YSingleChildContainerWidget.h:34
virtual const char * widgetClass() const
Definition: YAlignment.cc:353
void setRightMargin(int margin)
Definition: YAlignment.cc:128
virtual int preferredWidth()
Definition: YAlignment.cc:194
void setBottomMargin(int margin)
Definition: YAlignment.cc:140
int topMargin() const
Definition: YAlignment.cc:110
Definition: YAlignment.h:41
virtual void setBackgroundPixmap(const std::string &pixmapFileName)
Definition: YAlignment.cc:333
int bottomMargin() const
Definition: YAlignment.cc:116
void setTopMargin(int margin)
Definition: YAlignment.cc:134
int totalMargins(YUIDimension dim) const
Definition: YAlignment.cc:325
Definition: YAlignment.cc:37
int leftMargin() const
Definition: YAlignment.cc:98
int rightMargin() const
Definition: YAlignment.cc:104
virtual ~YAlignment()
Definition: YAlignment.cc:85
Definition: YWidget.h:54
void setLeftMargin(int margin)
Definition: YAlignment.cc:122