libyui  3.0.5
 All Classes Functions Variables Enumerations Friends
YOptionalWidgetFactory.cc
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YOptionalWidgetFactory.cc
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #include "YOptionalWidgetFactory.h"
26 #include "YWidgetFactory.h"
27 #include "YUIException.h"
28 #include "YLabel.h"
29 #include "YUI.h"
30 
31 
32 #define THROW_UNSUPPORTED( WIDGET_TYPE ) \
33  YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \
34  return 0
35 
36 
37 
39 {
40  // NOP
41 }
42 
44 {
45  // NOP
46 }
47 
48 
49 
50 bool YOptionalWidgetFactory::hasWizard()
51 {
52  return false;
53 }
54 
55 YWizard *
56 YOptionalWidgetFactory::createWizard( YWidget * parent,
57  const std::string & backButtonLabel,
58  const std::string & abortButtonLabel,
59  const std::string & nextButtonLabel,
60  YWizardMode wizardMode )
61 {
62  THROW_UNSUPPORTED( "YWizard" );
63 }
64 
65 
66 
67 bool YOptionalWidgetFactory::hasDumbTab()
68 {
69  return false;
70 }
71 
72 YDumbTab *
73 YOptionalWidgetFactory::createDumbTab( YWidget * parent )
74 {
75  THROW_UNSUPPORTED( "YDumbTab" );
76 }
77 
78 
79 
80 bool YOptionalWidgetFactory::hasSlider()
81 {
82  return false;
83 }
84 
85 YSlider *
86 YOptionalWidgetFactory::createSlider( YWidget * parent,
87  const std::string & label,
88  int minVal,
89  int maxVal,
90  int initialVal )
91 {
92  THROW_UNSUPPORTED( "YSlider" );
93 }
94 
95 
96 
97 bool YOptionalWidgetFactory::hasDateField()
98 {
99  return false;
100 }
101 
102 YDateField *
103 YOptionalWidgetFactory::createDateField( YWidget * parent, const std::string & label )
104 {
105  THROW_UNSUPPORTED( "YDateField" );
106 }
107 
108 
109 
110 bool YOptionalWidgetFactory::hasTimeField()
111 {
112  return false;
113 }
114 
115 YTimeField *
116 YOptionalWidgetFactory::createTimeField( YWidget * parent, const std::string & label )
117 {
118  THROW_UNSUPPORTED( "YTimeField" );
119 }
120 
121 
122 
123 bool YOptionalWidgetFactory::hasBarGraph()
124 {
125  return false;
126 }
127 
128 YBarGraph *
129 YOptionalWidgetFactory::createBarGraph( YWidget * parent )
130 {
131  THROW_UNSUPPORTED( "YBarGraph" );
132 }
133 
134 
135 
136 bool YOptionalWidgetFactory::hasPatternSelector()
137 {
138  return false;
139 }
140 
141 YWidget *
142 YOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags )
143 {
144  THROW_UNSUPPORTED( "YPatternSelector" );
145 }
146 
147 
148 
149 bool YOptionalWidgetFactory::hasSimplePatchSelector()
150 {
151  return false;
152 }
153 
154 YWidget *
155 YOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags )
156 {
157  THROW_UNSUPPORTED( "YSimplePatchSelector" );
158 }
159 
160 
161 
162 bool YOptionalWidgetFactory::hasMultiProgressMeter()
163 {
164  return false;
165 }
166 
168 YOptionalWidgetFactory::createMultiProgressMeter( YWidget * parent, YUIDimension dim, const std::vector<float> & maxValues )
169 {
170  THROW_UNSUPPORTED( "YMultiProgressMeter" );
171 }
172 
174 YOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent, const std::vector<float> & maxValues )
175 {
176  return createMultiProgressMeter( parent, YD_HORIZ, maxValues );
177 }
178 
180 YOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent, const std::vector<float> & maxValues )
181 {
182  return createMultiProgressMeter( parent, YD_VERT, maxValues );
183 }
184 
185 
186 
187 bool YOptionalWidgetFactory::hasPartitionSplitter()
188 {
189  return false;
190 }
191 
193 YOptionalWidgetFactory::createPartitionSplitter( YWidget * parent,
194  int usedSize,
195  int totalFreeSize,
196  int newPartSize,
197  int minNewPartSize,
198  int minFreeSize,
199  const std::string & usedLabel,
200  const std::string & freeLabel,
201  const std::string & newPartLabel,
202  const std::string & freeFieldLabel,
203  const std::string & newPartFieldLabel )
204 {
205  THROW_UNSUPPORTED( "YPartitionSplitter" );
206 }
207 
208 
209 
210 bool YOptionalWidgetFactory::hasDownloadProgress()
211 {
212  return false;
213 }
214 
216 YOptionalWidgetFactory::createDownloadProgress( YWidget * parent,
217  const std::string & label,
218  const std::string & filename,
219  YFileSize_t expectedFileSize )
220 {
221  THROW_UNSUPPORTED( "YDownloadProgress" );
222 }
223 
224 
225 
226 bool YOptionalWidgetFactory::hasDummySpecialWidget()
227 {
228  return true;
229 }
230 
231 YWidget *
232 YOptionalWidgetFactory::createDummySpecialWidget( YWidget * parent )
233 {
234  return YUI::widgetFactory()->createOutputField( parent, "YDummySpecialWidget" );
235 }
236 
237 bool YOptionalWidgetFactory::hasTimezoneSelector()
238 {
239  return false;
240 }
241 
243 YOptionalWidgetFactory::createTimezoneSelector( YWidget * parent,
244  const std::string & _map,
245  const std::map<std::string, std::string>& zones)
246 {
247  THROW_UNSUPPORTED( "YTimezoneSelector" );
248 }
249 
250 
251 bool
252 YOptionalWidgetFactory::hasGraph()
253 {
254  return false;
255 }
256 
257 
258 YGraph *
259 YOptionalWidgetFactory::createGraph( YWidget * parent, const std::string & filename,
260  const std::string & layoutAlgorithm )
261 {
262  THROW_UNSUPPORTED( "YGraph" );
263 }
264 
265 
266 YGraph *
267 YOptionalWidgetFactory::createGraph( YWidget * parent, graph_t * graph )
268 {
269  THROW_UNSUPPORTED( "YGraph" );
270 }
271 
272 
273 bool
274 YOptionalWidgetFactory::hasContextMenu()
275 {
276  return false;
277 }