libyui

/data/gitorious.org/libyui/libyui-master/src/YAlignment.h

00001 /**************************************************************************
00002 Copyright (C) 2000 - 2010 Novell, Inc.
00003 All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License along
00016 with this program; if not, write to the Free Software Foundation, Inc.,
00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 **************************************************************************/
00020 
00021 
00022 /*---------------------------------------------------------------------\
00023 |                                                                      |
00024 |                      __   __    ____ _____ ____                      |
00025 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00026 |                       \ V / _` \___ \ | |   __) |                    |
00027 |                        | | (_| |___) || |  / __/                     |
00028 |                        |_|\__,_|____/ |_| |_____|                    |
00029 |                                                                      |
00030 |                               core system                            |
00031 |                                                        (C) SuSE GmbH |
00032 \----------------------------------------------------------------------/
00033 
00034   File:         YAlignment.h
00035 
00036   Author:       Stefan Hundhammer <sh@suse.de>
00037 
00038 /-*/
00039 
00040 #ifndef YAlignment_h
00041 #define YAlignment_h
00042 
00043 #include "YSingleChildContainerWidget.h"
00044 
00045 using std::string;
00046 
00047 class YAlignmentPrivate;
00048 
00057 class YAlignment : public YSingleChildContainerWidget
00058 {
00059 protected:
00063     YAlignment( YWidget *       parent,
00064                 YAlignmentType  horAlign,
00065                 YAlignmentType  vertAlign );
00066 
00067 public:
00071     virtual ~YAlignment();
00072 
00077     virtual const char * widgetClass() const;
00078 
00082     YAlignmentType alignment( YUIDimension dim ) const;
00083     
00088     int leftMargin() const;
00089 
00094     int rightMargin() const;
00095 
00100     int topMargin() const;
00101 
00106     int bottomMargin() const;
00107 
00111     int totalMargins( YUIDimension dim ) const;
00112 
00116     void setLeftMargin( int margin );
00117 
00121     void setRightMargin( int margin );
00122 
00126     void setTopMargin( int margin );
00127 
00131     void setBottomMargin( int margin );
00132 
00137     int minWidth() const;
00138 
00143     int minHeight() const;
00144 
00148     void setMinWidth( int width );
00149 
00153     void setMinHeight( int height );
00154 
00165     virtual void setBackgroundPixmap( const string & pixmapFileName );
00166 
00171     string backgroundPixmap() const;
00172 
00179     virtual void addChild( YWidget * child );
00180 
00184     virtual void moveChild( YWidget *child, int newx, int newy ) = 0;
00185 
00194     virtual bool stretchable( YUIDimension dim ) const;
00195 
00201     virtual int preferredWidth();
00202 
00208     virtual int preferredHeight();
00209 
00217     virtual void setSize( int newWidth, int newHeight );
00218 
00219 
00220 protected:
00221 
00222     ImplPtr<YAlignmentPrivate> priv;
00223 };
00224 
00225 
00226 #endif // YAlignment_h
00227 
 All Classes Functions Variables Enumerations Friends