libyui-qt  2.43.5
/usr/src/RPM/BUILD/libyui-qt-2.43.5/src/YQOptionalWidgetFactory.h
00001 /*
00002   Copyright (C) 2000-2012 Novell, Inc
00003   This library is free software; you can redistribute it and/or modify
00004   it under the terms of the GNU Lesser General Public License as
00005   published by the Free Software Foundation; either version 2.1 of the
00006   License, or (at your option) version 3.0 of the License. This library
00007   is distributed in the hope that it will be useful, but WITHOUT ANY
00008   WARRANTY; without even the implied warranty of MERCHANTABILITY or
00009   FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00010   License for more details. You should have received a copy of the GNU
00011   Lesser General Public License along with this library; if not, write
00012   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
00013   Floor, Boston, MA 02110-1301 USA
00014 */
00015 
00016 
00017 /*-/
00018 
00019   File:         YQOptionalWidgetFactory.h
00020 
00021   Author:       Stefan Hundhammer <sh@suse.de>
00022 
00023 /-*/
00024 
00025 #ifndef YQOptionalWidgetFactory_h
00026 #define YQOptionalWidgetFactory_h
00027 
00028 
00029 #include <yui/YOptionalWidgetFactory.h>
00030 
00031 #include "YQBarGraph.h"
00032 #include "YQDateField.h"
00033 #include "YQDownloadProgress.h"
00034 #include "YQDumbTab.h"
00035 #include "YQMultiProgressMeter.h"
00036 #include "YQPartitionSplitter.h"
00037 #include "YQSlider.h"
00038 #include "YQTimeField.h"
00039 
00040 class YQWizard;
00041 
00042 using std::string;
00043 using std::vector;
00044 
00045 
00046 
00047 /**
00048  * Widget factory for optional ("special") widgets.
00049  *
00050  * Remember to always check with the corresponding "has..()" method if the
00051  * current UI actually provides the requested widget. Otherwise the
00052  * "create...()" method will throw an exception.
00053  **/
00054 class YQOptionalWidgetFactory: public YOptionalWidgetFactory
00055 {
00056 public:
00057 
00058     //
00059     // Optional Widgets
00060     //
00061 
00062 
00063     virtual bool                        hasWizard();
00064     virtual YWizard *                   createWizard            ( YWidget *             parent,
00065                                                                   const std::string &   backButtonLabel,
00066                                                                   const std::string &   abortButtonLabel,
00067                                                                   const std::string &   nextButtonLabel,
00068                                                                   YWizardMode   wizardMode = YWizardMode_Standard );
00069 
00070     virtual bool                        hasDumbTab();
00071     virtual YQDumbTab *                 createDumbTab           ( YWidget * parent );
00072 
00073     virtual bool                        hasSlider();
00074     virtual YQSlider *                  createSlider            ( YWidget *             parent,
00075                                                                   const std::string     &       label,
00076                                                                   int                   minVal,
00077                                                                   int                   maxVal,
00078                                                                   int                   initialVal );
00079 
00080     virtual bool                        hasDateField();
00081     virtual YQDateField *               createDateField         ( YWidget * parent, const std::string & label );
00082 
00083     virtual bool                        hasTimeField();
00084     virtual YQTimeField *               createTimeField         ( YWidget * parent, const std::string & label );
00085 
00086     virtual bool                        hasBarGraph();
00087     virtual YQBarGraph *                createBarGraph          ( YWidget * parent );
00088 
00089     virtual bool                        hasPatternSelector();
00090     virtual YWidget *                   createPatternSelector   ( YWidget * parent, long modeFlags = 0 );
00091 
00092     virtual bool                        hasSimplePatchSelector();
00093     virtual YWidget *                   createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
00094 
00095     virtual bool                        hasMultiProgressMeter();
00096     virtual YQMultiProgressMeter *      createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
00097 
00098     virtual bool                        hasPartitionSplitter();
00099     virtual YQPartitionSplitter *       createPartitionSplitter ( YWidget *             parent,
00100                                                                   int                   usedSize,
00101                                                                   int                   totalFreeSize,
00102                                                                   int                   newPartSize,
00103                                                                   int                   minNewPartSize,
00104                                                                   int                   minFreeSize,
00105                                                                   const std::string &   usedLabel,
00106                                                                   const std::string &   freeLabel,
00107                                                                   const std::string &   newPartLabel,
00108                                                                   const std::string &   freeFieldLabel,
00109                                                                   const std::string &   newPartFieldLabel );
00110 
00111     virtual bool                        hasDownloadProgress();
00112     virtual YQDownloadProgress *        createDownloadProgress  ( YWidget *             parent,
00113                                                                   const std::string &   label,
00114                                                                   const std::string &   filename,
00115                                                                   YFileSize_t           expectedFileSize );
00116 
00117     virtual bool                        hasTimezoneSelector();
00118     virtual YTimezoneSelector *         createTimezoneSelector( YWidget * parent,
00119                                                                 const std::string & pixmap,
00120                                                                 const map<string,string> & timezones );
00121 
00122     virtual bool                        hasGraph();
00123     virtual YGraph *                    createGraph( YWidget * parent, const std::string & filename,
00124                                                      const std::string & layoutAlgorithm );
00125     virtual YGraph *                    createGraph( YWidget * parent, /* graph_t */ void * graph );
00126 
00127     virtual bool                        hasContextMenu();
00128 
00129 protected:
00130 
00131     friend class YQUI;
00132 
00133     /**
00134      * Constructor.
00135      *
00136      * Use YUI::optionalWidgetFactory() to get the singleton for this class.
00137      **/
00138     YQOptionalWidgetFactory();
00139 
00140     /**
00141      * Destructor.
00142      **/
00143     virtual ~YQOptionalWidgetFactory();
00144 
00145 }; // class YQOptionalWidgetFactory
00146 
00147 
00148 
00149 #endif // YQOptionalWidgetFactory_h
 All Classes Functions Variables