YPartitionSplitter.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:       YPartitionSplitter.h
00014 
00015   Author:     Stefan Hundhammer <sh@suse.de>
00016 
00017 /-*/
00018 
00019 #ifndef YPartitionSplitter_h
00020 #define YPartitionSplitter_h
00021 
00022 #include "YWidget.h"
00023 #include <ycp/YCPString.h>
00024 #include <ycp/YCPInteger.h>
00025 
00026 
00027 class YMacroRecorder;
00028 
00032 class YPartitionSplitter : public YWidget
00033 {
00034 public:
00035 
00039     YPartitionSplitter( const YWidgetOpt &      opt,
00040                         int                     usedSize,
00041                         int                     totalFreeSize,
00042                         int                     newPartSize,
00043                         int                     minNewPartSize,
00044                         int                     minFreeSize,
00045                         const YCPString &       usedLabel,
00046                         const YCPString &       freeLabel,
00047                         const YCPString &       newPartLabel,
00048                         const YCPString &       freeFieldLabel,
00049                         const YCPString &       newPartFieldLabel );
00050 
00055     virtual char *widgetClass() { return "YPartitionSplitter"; }
00056 
00060     YCPValue changeWidget( const YCPSymbol & property,
00061                            const YCPValue &  newValue );
00062 
00066     YCPValue queryWidget( const YCPSymbol & property );
00067 
00068 
00075     virtual void setValue( int newValue );
00076 
00077 
00078     // Access methods
00079 
00080     int                 usedSize()              { return _usedSize;             }
00081     int                 totalFreeSize()         { return _totalFreeSize;        }
00082     int                 newPartSize()           { return _newPartSize;          }
00083     int                 minNewPartSize()        { return _minNewPartSize;       }
00084     int                 maxNewPartSize()        { return _totalFreeSize - _minFreeSize;    }
00085     int                 minFreeSize()           { return _minFreeSize;                     }
00086     int                 maxFreeSize()           { return _totalFreeSize - _minNewPartSize; }
00087     int                 remainingFreeSize()     { return _totalFreeSize - _newPartSize;    }
00088     const YCPString     usedLabel()             { return _usedLabel;            }
00089     const YCPString     freeLabel()             { return _freeLabel;            }
00090     const YCPString     newPartLabel()          { return _newPartLabel;         }
00091     const YCPString     freeFieldLabel()        { return _freeFieldLabel;       }
00092     const YCPString     newPartFieldLabel()     { return _newPartFieldLabel;    }
00093 
00094 
00105     const char *shortcutProperty() { return ( const char * ) 0; }
00106 
00111     const char *userInputProperty() { return YUIProperty_Value; }
00112 
00113 
00114 private:
00115 
00121     virtual void saveUserInput( YMacroRecorder *macroRecorder );
00122 
00123 
00124     int                         _usedSize;
00125     int                         _totalFreeSize;
00126     int                         _newPartSize;
00127     int                         _minNewPartSize;
00128     int                         _minFreeSize;
00129     const YCPString &   _usedLabel;
00130     const YCPString &   _freeLabel;
00131     const YCPString &   _newPartLabel;
00132     const YCPString &   _freeFieldLabel;
00133     const YCPString &   _newPartFieldLabel;
00134 };
00135 
00136 
00137 #endif // YPartitionSplitter_h

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