YSplit.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013   File:         YSplit.h
00014 
00015   Author:       Stefan Hundhammer <sh@suse.de>
00016                 ( complete rewrite 09/2000 )
00017 
00018 /-*/
00019 
00020 #ifndef YSplit_h
00021 #define YSplit_h
00022 
00023 
00024 #include "YContainerWidget.h"
00025 
00029 class YSplit : public YContainerWidget
00030 {
00031 public:
00032     typedef vector<long>sizeVector;
00033     typedef vector<long>posVector;
00034 
00038     YSplit( const YWidgetOpt & opt, YUIDimension newPrimaryDimension );
00039 
00044     virtual char *widgetClass() { return "YSplit"; }
00045 
00049     YUIDimension dimension() const              { return primary; }
00050     YUIDimension primaryDimension() const       { return primary; }
00051     YUIDimension secondaryDimension() const     { return secondary; }
00052 
00067     virtual long nicesize( YUIDimension dimension );
00068 
00074     virtual bool stretchable( YUIDimension dimension ) const;
00075 
00081     void setSize( long newwidth, long newheight );
00082 
00086     virtual void moveChild( YWidget *child, long newx, long newy ) = 0;
00087 
00088 
00089 protected:
00090 
00094     long childrenTotalWeight( YUIDimension dimension );
00095 
00099     long childrenMaxNiceSize( YUIDimension dimension );
00100 
00104     long totalNonWeightedChildrenNiceSize( YUIDimension dimension );
00105 
00109     int countNonWeightedChildren( YUIDimension dimension );
00110 
00115     int countStretchableChildren( YUIDimension dimension );
00116 
00122     int countLayoutStretchChildren( YUIDimension dimension );
00123 
00130     int bossChild();
00131 
00136     void calcPrimaryGeometry    ( long          newSize,
00137                                   sizeVector &  childSize,
00138                                   posVector  &  childPos );
00139 
00144     void calcSecondaryGeometry  ( long          newSize,
00145                                   sizeVector &  childSize,
00146                                   posVector  &  childPos );
00147 
00155     void doResize( sizeVector & width,
00156                    sizeVector & height,
00157                    posVector  & x_pos,
00158                    posVector  & y_pos  );
00159 
00160 
00161 protected:
00162 
00166     YUIDimension primary;
00167     YUIDimension secondary;
00168     bool debugLayout;
00169 };
00170 
00171 
00172 #endif // YSplit_h

Generated on Fri Jun 16 18:07:45 2006 for yast2-core by  doxygen 1.4.6