libyui  3.10.0
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 #define YUILogComponent "owf"
32 #include "YUILog.h"
33 
34 using std::string;
35 using std::vector;
36 
37 
38 #define THROW_UNSUPPORTED( WIDGET_TYPE ) \
39  YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \
40  return 0
41 
42 
43 
45 {
46  // NOP
47 }
48 
49 
51 {
52  // NOP
53 }
54 
55 
56 bool YOptionalWidgetFactory::hasWizard()
57 {
58  return false;
59 }
60 
61 YWizard *
62 YOptionalWidgetFactory::createWizard( YWidget * parent,
63  const string & backButtonLabel,
64  const string & abortButtonLabel,
65  const string & nextButtonLabel,
66  YWizardMode wizardMode )
67 {
68  THROW_UNSUPPORTED( "YWizard" );
69 }
70 
71 
72 
73 bool YOptionalWidgetFactory::hasDumbTab()
74 {
75  return false;
76 }
77 
78 YDumbTab *
79 YOptionalWidgetFactory::createDumbTab( YWidget * parent )
80 {
81  THROW_UNSUPPORTED( "YDumbTab" );
82 }
83 
84 
85 
86 bool YOptionalWidgetFactory::hasSlider()
87 {
88  return false;
89 }
90 
91 YSlider *
92 YOptionalWidgetFactory::createSlider( YWidget * parent,
93  const string & label,
94  int minVal,
95  int maxVal,
96  int initialVal )
97 {
98  THROW_UNSUPPORTED( "YSlider" );
99 }
100 
101 
102 
103 bool YOptionalWidgetFactory::hasDateField()
104 {
105  return false;
106 }
107 
108 YDateField *
109 YOptionalWidgetFactory::createDateField( YWidget * parent, const string & label )
110 {
111  THROW_UNSUPPORTED( "YDateField" );
112 }
113 
114 
115 
116 bool YOptionalWidgetFactory::hasTimeField()
117 {
118  return false;
119 }
120 
121 YTimeField *
122 YOptionalWidgetFactory::createTimeField( YWidget * parent, const string & label )
123 {
124  THROW_UNSUPPORTED( "YTimeField" );
125 }
126 
127 
128 
129 bool YOptionalWidgetFactory::hasBarGraph()
130 {
131  return false;
132 }
133 
134 YBarGraph *
135 YOptionalWidgetFactory::createBarGraph( YWidget * parent )
136 {
137  THROW_UNSUPPORTED( "YBarGraph" );
138 }
139 
140 
141 
142 bool YOptionalWidgetFactory::hasPatternSelector()
143 {
144  return false;
145 }
146 
147 YWidget *
148 YOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags )
149 {
150  THROW_UNSUPPORTED( "YPatternSelector" );
151 }
152 
153 
154 
155 bool YOptionalWidgetFactory::hasSimplePatchSelector()
156 {
157  return false;
158 }
159 
160 YWidget *
161 YOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags )
162 {
163  THROW_UNSUPPORTED( "YSimplePatchSelector" );
164 }
165 
166 
167 
168 bool YOptionalWidgetFactory::hasMultiProgressMeter()
169 {
170  return false;
171 }
172 
174 YOptionalWidgetFactory::createMultiProgressMeter( YWidget * parent,
175  YUIDimension dim,
176  const vector<float> & maxValues )
177 {
178  THROW_UNSUPPORTED( "YMultiProgressMeter" );
179 }
180 
182 YOptionalWidgetFactory::createHMultiProgressMeter( YWidget * parent,
183  const vector<float> & maxValues )
184 {
185  return createMultiProgressMeter( parent, YD_HORIZ, maxValues );
186 }
187 
189 YOptionalWidgetFactory::createVMultiProgressMeter( YWidget * parent,
190  const vector<float> & maxValues )
191 {
192  return createMultiProgressMeter( parent, YD_VERT, maxValues );
193 }
194 
195 
196 
197 bool YOptionalWidgetFactory::hasPartitionSplitter()
198 {
199  return false;
200 }
201 
203 YOptionalWidgetFactory::createPartitionSplitter( YWidget * parent,
204  int usedSize,
205  int totalFreeSize,
206  int newPartSize,
207  int minNewPartSize,
208  int minFreeSize,
209  const string & usedLabel,
210  const string & freeLabel,
211  const string & newPartLabel,
212  const string & freeFieldLabel,
213  const string & newPartFieldLabel )
214 {
215  THROW_UNSUPPORTED( "YPartitionSplitter" );
216 }
217 
218 
219 
220 bool YOptionalWidgetFactory::hasDownloadProgress()
221 {
222  return false;
223 }
224 
226 YOptionalWidgetFactory::createDownloadProgress( YWidget * parent,
227  const string & label,
228  const string & filename,
229  YFileSize_t expectedFileSize )
230 {
231  THROW_UNSUPPORTED( "YDownloadProgress" );
232 }
233 
234 
235 
236 bool YOptionalWidgetFactory::hasDummySpecialWidget()
237 {
238  return true;
239 }
240 
241 YWidget *
242 YOptionalWidgetFactory::createDummySpecialWidget( YWidget * parent )
243 {
244  return YUI::widgetFactory()->createOutputField( parent, "YDummySpecialWidget" );
245 }
246 
247 bool YOptionalWidgetFactory::hasTimezoneSelector()
248 {
249  return false;
250 }
251 
253 YOptionalWidgetFactory::createTimezoneSelector( YWidget * parent,
254  const string & worldMap,
255  const std::map<string, string>& zones)
256 {
257  THROW_UNSUPPORTED( "YTimezoneSelector" );
258 }
259 
260 
261 bool
262 YOptionalWidgetFactory::hasGraph()
263 {
264  return false;
265 }
266 
267 
268 YGraph *
269 YOptionalWidgetFactory::createGraph( YWidget * parent,
270  const string & filename,
271  const string & layoutAlgorithm )
272 {
273  THROW_UNSUPPORTED( "YGraph" );
274 }
275 
276 
277 YGraph *
278 YOptionalWidgetFactory::createGraph( YWidget * parent, /* graph_t */ void * graph )
279 {
280  THROW_UNSUPPORTED( "YGraph" );
281 }
282 
283 
284 bool
285 YOptionalWidgetFactory::hasContextMenu()
286 {
287  return false;
288 }
YWizardMode
Kind of the wizard layout.
Definition: YWizard.h:43
A graph showing partitioning of a whole.
Definition: YBarGraph.h:41
Input field for entering a date.
Definition: YDateField.h:43
DownloadProgress: A progress bar that monitors downloading a file by repeatedly polling its size up t...
DumbTab: A very simple tab widget that can display and switch between a number of tabs,...
Definition: YDumbTab.h:41
A graph with nodes and edges, rendered with Graphviz.
Definition: YGraph.h:46
MultiProgressMeter: Progress bar with several segments that can indicate progress individually.
virtual ~YOptionalWidgetFactory()
Destructor.
PartitionSplitter: A (very custom) widget for easily splitting one existing partition into two.
Slider: Input widget for an integer value between a minimum and a maximum value.
Definition: YSlider.h:45
Input field for entering a time in "hh:mm:ss" format.
Definition: YTimeField.h:42
A fancy widget with a world map.
static YWidgetFactory * widgetFactory()
Return the widget factory that provides all the createXY() methods for standard (mandatory,...
Definition: YUI.cc:132
Abstract base class of all UI widgets.
Definition: YWidget.h:55
A wizard is a more complex frame typically used for multi-step workflows:
Definition: YWizard.h:97