libyui
3.0.10
|
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: YOptionalWidgetFactory.cc 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 #include "YOptionalWidgetFactory.h" 00026 #include "YWidgetFactory.h" 00027 #include "YUIException.h" 00028 #include "YLabel.h" 00029 #include "YUI.h" 00030 00031 00032 #define THROW_UNSUPPORTED( WIDGET_TYPE ) \ 00033 YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \ 00034 return 0 00035 00036 00037 00038 YOptionalWidgetFactory::YOptionalWidgetFactory() 00039 { 00040 // NOP 00041 } 00042 00043 YOptionalWidgetFactory::~YOptionalWidgetFactory() 00044 { 00045 // NOP 00046 } 00047 00048 00049 00050 bool YOptionalWidgetFactory::hasWizard() 00051 { 00052 return false; 00053 } 00054 00055 YWizard * 00056 YOptionalWidgetFactory::createWizard( YWidget * parent, 00057 const std::string & backButtonLabel, 00058 const std::string & abortButtonLabel, 00059 const std::string & nextButtonLabel, 00060 YWizardMode wizardMode ) 00061 { 00062 THROW_UNSUPPORTED( "YWizard" ); 00063 } 00064 00065 00066 00067 bool YOptionalWidgetFactory::hasDumbTab() 00068 { 00069 return false; 00070 } 00071 00072 YDumbTab * 00073 YOptionalWidgetFactory::createDumbTab( YWidget * parent ) 00074 { 00075 THROW_UNSUPPORTED( "YDumbTab" ); 00076 } 00077 00078 00079 00080 bool YOptionalWidgetFactory::hasSlider() 00081 { 00082 return false; 00083 } 00084 00085 YSlider * 00086 YOptionalWidgetFactory::createSlider( YWidget * parent, 00087 const std::string & label, 00088 int minVal, 00089 int maxVal, 00090 int initialVal ) 00091 { 00092 THROW_UNSUPPORTED( "YSlider" ); 00093 } 00094 00095 00096 00097 bool YOptionalWidgetFactory::hasDateField() 00098 { 00099 return false; 00100 } 00101 00102 YDateField * 00103 YOptionalWidgetFactory::createDateField( YWidget * parent, const std::string & label ) 00104 { 00105 THROW_UNSUPPORTED( "YDateField" ); 00106 } 00107 00108 00109 00110 bool YOptionalWidgetFactory::hasTimeField() 00111 { 00112 return false; 00113 } 00114 00115 YTimeField * 00116 YOptionalWidgetFactory::createTimeField( YWidget * parent, const std::string & label ) 00117 { 00118 THROW_UNSUPPORTED( "YTimeField" ); 00119 } 00120 00121 00122 00123 bool YOptionalWidgetFactory::hasBarGraph() 00124 { 00125 return false; 00126 } 00127 00128 YBarGraph * 00129 YOptionalWidgetFactory::createBarGraph( YWidget * parent ) 00130 { 00131 THROW_UNSUPPORTED( "YBarGraph" ); 00132 } 00133 00134 00135 00136 bool YOptionalWidgetFactory::hasPatternSelector() 00137 { 00138 return false; 00139 } 00140 00141 YWidget * 00142 YOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags ) 00143 { 00144 THROW_UNSUPPORTED( "YPatternSelector" ); 00145 } 00146 00147 00148 00149 bool YOptionalWidgetFactory::hasSimplePatchSelector() 00150 { 00151 return false; 00152 } 00153 00154 YWidget * 00155 YOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags ) 00156 { 00157 THROW_UNSUPPORTED( "YSimplePatchSelector" ); 00158 } 00159 00160 00161 00162 bool YOptionalWidgetFactory::hasMultiProgressMeter() 00163 { 00164 return false; 00165 } 00166 00167 YMultiProgressMeter * 00168 YOptionalWidgetFactory::createMultiProgressMeter( YWidget * parent, YUIDimension dim, const std::vector<float> & maxValues ) 00169 { 00170 THROW_UNSUPPORTED( "YMultiProgressMeter" ); 00171 } 00172 00173 YMultiProgressMeter * 00174 YOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent, const std::vector<float> & maxValues ) 00175 { 00176 return createMultiProgressMeter( parent, YD_HORIZ, maxValues ); 00177 } 00178 00179 YMultiProgressMeter * 00180 YOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent, const std::vector<float> & maxValues ) 00181 { 00182 return createMultiProgressMeter( parent, YD_VERT, maxValues ); 00183 } 00184 00185 00186 00187 bool YOptionalWidgetFactory::hasPartitionSplitter() 00188 { 00189 return false; 00190 } 00191 00192 YPartitionSplitter * 00193 YOptionalWidgetFactory::createPartitionSplitter( YWidget * parent, 00194 int usedSize, 00195 int totalFreeSize, 00196 int newPartSize, 00197 int minNewPartSize, 00198 int minFreeSize, 00199 const std::string & usedLabel, 00200 const std::string & freeLabel, 00201 const std::string & newPartLabel, 00202 const std::string & freeFieldLabel, 00203 const std::string & newPartFieldLabel ) 00204 { 00205 THROW_UNSUPPORTED( "YPartitionSplitter" ); 00206 } 00207 00208 00209 00210 bool YOptionalWidgetFactory::hasDownloadProgress() 00211 { 00212 return false; 00213 } 00214 00215 YDownloadProgress * 00216 YOptionalWidgetFactory::createDownloadProgress( YWidget * parent, 00217 const std::string & label, 00218 const std::string & filename, 00219 YFileSize_t expectedFileSize ) 00220 { 00221 THROW_UNSUPPORTED( "YDownloadProgress" ); 00222 } 00223 00224 00225 00226 bool YOptionalWidgetFactory::hasDummySpecialWidget() 00227 { 00228 return true; 00229 } 00230 00231 YWidget * 00232 YOptionalWidgetFactory::createDummySpecialWidget( YWidget * parent ) 00233 { 00234 return YUI::widgetFactory()->createOutputField( parent, "YDummySpecialWidget" ); 00235 } 00236 00237 bool YOptionalWidgetFactory::hasTimezoneSelector() 00238 { 00239 return false; 00240 } 00241 00242 YTimezoneSelector * 00243 YOptionalWidgetFactory::createTimezoneSelector( YWidget * parent, 00244 const std::string & _map, 00245 const std::map<std::string, std::string>& zones) 00246 { 00247 THROW_UNSUPPORTED( "YTimezoneSelector" ); 00248 } 00249 00250 00251 bool 00252 YOptionalWidgetFactory::hasGraph() 00253 { 00254 return false; 00255 } 00256 00257 00258 YGraph * 00259 YOptionalWidgetFactory::createGraph( YWidget * parent, const std::string & filename, 00260 const std::string & layoutAlgorithm ) 00261 { 00262 THROW_UNSUPPORTED( "YGraph" ); 00263 } 00264 00265 00266 YGraph * 00267 YOptionalWidgetFactory::createGraph( YWidget * parent, /* graph_t */ void * graph ) 00268 { 00269 THROW_UNSUPPORTED( "YGraph" ); 00270 } 00271 00272 00273 bool 00274 YOptionalWidgetFactory::hasContextMenu() 00275 { 00276 return false; 00277 }