libyui

/data/gitorious.org/libyui/libyui-master/src/YOptionalWidgetFactory.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:         YOptionalWidgetFactory.h
00035 
00036   Author:       Stefan Hundhammer <sh@suse.de>
00037 
00038 /-*/
00039 
00040 #ifndef YOptionalWidgetFactory_h
00041 #define YOptionalWidgetFactory_h
00042 
00043 #include <string>
00044 #include <vector>
00045 #include <map>
00046 
00047 #include "YTypes.h"
00048 #include "YWizard.h"
00049 #include "YGraph.h"
00050 
00051 using std::string;
00052 using std::vector;
00053 using std::map;
00054 
00055 class YBarGraph;
00056 class YDateField;
00057 class YDownloadProgress;
00058 class YDumbTab;
00059 class YDummySpecialWidget;
00060 class YMultiProgressMeter;
00061 class YPartitionSplitter;
00062 class YSlider;
00063 class YTimeField;
00064 class YWidget;
00065 class YTimezoneSelector;
00066 
00074 class YOptionalWidgetFactory
00075 {
00076 public:
00077 
00078     //
00079     // Optional Widgets
00080     //
00081 
00082     virtual bool                        hasWizard();
00083     virtual YWizard *                   createWizard            ( YWidget *             parent,
00084                                                                   const string &        backButtonLabel,
00085                                                                   const string &        abortButtonLabel,
00086                                                                   const string &        nextButtonLabel,
00087                                                                   YWizardMode           wizardMode = YWizardMode_Standard );
00088 
00089     virtual bool                        hasDumbTab();
00090     virtual YDumbTab *                  createDumbTab           ( YWidget * parent );
00091 
00092     virtual bool                        hasSlider();
00093     virtual YSlider *                   createSlider            ( YWidget *             parent,
00094                                                                   const string  &       label,
00095                                                                   int                   minVal,
00096                                                                   int                   maxVal,
00097                                                                   int                   initialVal );
00098 
00099     virtual bool                        hasDateField();
00100     virtual YDateField *                createDateField         ( YWidget * parent, const string & label );
00101 
00102     virtual bool                        hasTimeField();
00103     virtual YTimeField *                createTimeField         ( YWidget * parent, const string & label );
00104 
00105     virtual bool                        hasBarGraph();
00106     virtual YBarGraph *                 createBarGraph          ( YWidget * parent );
00107 
00108     virtual bool                        hasPatternSelector();
00109     virtual YWidget *                   createPatternSelector   ( YWidget * parent, long modeFlags = 0 );
00110 
00111     virtual bool                        hasSimplePatchSelector();
00112     virtual YWidget *                   createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
00113 
00114     virtual bool                        hasMultiProgressMeter();
00115     YMultiProgressMeter *               createHMultiProgressMeter( YWidget * parent, const vector<float> & maxValues );
00116     YMultiProgressMeter *               createVMultiProgressMeter( YWidget * parent, const vector<float> & maxValues );
00117     virtual YMultiProgressMeter *       createMultiProgressMeter ( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
00118 
00119     virtual bool                        hasPartitionSplitter();
00120     virtual YPartitionSplitter *        createPartitionSplitter ( YWidget *             parent,
00121                                                                   int                   usedSize,
00122                                                                   int                   totalFreeSize,
00123                                                                   int                   newPartSize,
00124                                                                   int                   minNewPartSize,
00125                                                                   int                   minFreeSize,
00126                                                                   const string &        usedLabel,
00127                                                                   const string &        freeLabel,
00128                                                                   const string &        newPartLabel,
00129                                                                   const string &        freeFieldLabel,
00130                                                                   const string &        newPartFieldLabel );
00131 
00132 
00133     virtual bool                        hasDownloadProgress();
00134     virtual YDownloadProgress *         createDownloadProgress  ( YWidget *             parent,
00135                                                                   const string &        label,
00136                                                                   const string &        filename,
00137                                                                   YFileSize_t           expectedFileSize );
00138 
00139     bool                                hasDummySpecialWidget();
00140     YWidget *                           createDummySpecialWidget( YWidget * parent );
00141 
00142     virtual bool                        hasTimezoneSelector();
00143     virtual YTimezoneSelector *         createTimezoneSelector( YWidget * parent,
00144                                                                 const string & pixmap, 
00145                                                                 const map<string,string> & timezones );
00146 
00147     virtual bool                        hasGraph();
00148     virtual YGraph *                    createGraph( YWidget * parent, const string & filename,
00149                                                      const string & layoutAlgorithm );
00150     virtual YGraph *                    createGraph( YWidget * parent, graph_t * graph );
00151 
00152     virtual bool                        hasContextMenu();
00153 
00154 protected:
00155 
00156     friend class YUI;
00157 
00163     YOptionalWidgetFactory();
00164 
00168     virtual ~YOptionalWidgetFactory();
00169 
00170 }; // class YOptionalWidgetFactory
00171 
00172 
00173 
00174 #endif // YOptionalWidgetFactory_h
 All Classes Functions Variables Enumerations Friends