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