libyui

/data/gitorious.org/libyui/libyui-master/src/YPartitionSplitter.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:         YPartitionSplitter.h
00035 
00036   Author:       Stefan Hundhammer <sh@suse.de>
00037 
00038 /-*/
00039 
00040 #ifndef YPartitionSplitter_h
00041 #define YPartitionSplitter_h
00042 
00043 #include "YWidget.h"
00044 
00045 
00046 class YPartitionSplitterPrivate;
00047 
00048 
00078 class YPartitionSplitter : public YWidget
00079 {
00080 protected:
00105     YPartitionSplitter( YWidget *       parent,
00106                         int             usedSize,
00107                         int             totalFreeSize,
00108                         int             newPartSize,
00109                         int             minNewPartSize,
00110                         int             minFreeSize,
00111                         const string &  usedLabel,
00112                         const string &  freeLabel,
00113                         const string &  newPartLabel,
00114                         const string &  freeFieldLabel,
00115                         const string &  newPartFieldLabel );
00116 
00117 public:
00118 
00122     virtual ~YPartitionSplitter();
00123 
00128     virtual const char * widgetClass() const { return "YPartitionSplitter"; }
00129 
00135     virtual int value() = 0;
00136 
00142     virtual void setValue( int newValue ) = 0;
00143 
00144 
00145     // Access methods
00146 
00147     int         usedSize()              const;
00148     int         totalFreeSize()         const;
00149     int         minFreeSize()           const;
00150     int         maxFreeSize()           const   { return totalFreeSize() - minNewPartSize(); }
00151     int         freeSize()                      { return totalFreeSize() - newPartSize(); }
00152     int         newPartSize()                   { return value(); }
00153     int         minNewPartSize()        const;
00154     int         maxNewPartSize()        const   { return totalFreeSize() - minFreeSize(); }
00155 
00156     string      usedLabel()             const;
00157     string      freeLabel()             const;
00158     string      newPartLabel()          const;
00159     string      freeFieldLabel()        const;
00160     string      newPartFieldLabel()     const;
00161 
00172     virtual bool setProperty( const string & propertyName,
00173                               const YPropertyValue & val );
00174 
00181     virtual YPropertyValue getProperty( const string & propertyName );
00182 
00189     virtual const YPropertySet & propertySet();
00190 
00191 
00196     const char * userInputProperty() { return YUIProperty_Value; }
00197 
00198 
00199 private:
00200 
00201     ImplPtr<YPartitionSplitterPrivate> priv;
00202 };
00203 
00204 
00205 #endif // YPartitionSplitter_h
 All Classes Functions Variables Enumerations Friends