27 #include "NCWidgetFactory.h"
28 #include <yui/YUIException.h>
30 #define YUILogComponent "ncurses"
31 #include <yui/YUILog.h>
32 #include "YNCursesUI.h"
57 NCWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
59 yuiDebug() <<
"Flush input buffer - new dialog" << std::endl;
63 YUI_CHECK_NEW( dialog );
74 NCWidgetFactory::createPushButton( YWidget * parent,
const std::string & label )
77 YUI_CHECK_NEW( pushButton );
85 NCWidgetFactory::createLabel( YWidget * parent,
86 const std::string & text,
90 NCLabel * label =
new NCLabel( parent, text, isHeading, isOutputField );
91 YUI_CHECK_NEW( label );
98 NCWidgetFactory::createInputField( YWidget * parent,
const std::string & label,
bool passwordMode )
101 YUI_CHECK_NEW( inputField );
108 NCWidgetFactory::createCheckBox( YWidget * parent,
const std::string & label,
bool isChecked )
111 YUI_CHECK_NEW( checkBox );
118 NCWidgetFactory::createRadioButton( YWidget * parent,
const std::string & label,
bool checked )
121 YUI_CHECK_NEW( radioButton );
127 if ( radioButton->buttonGroup() )
128 radioButton->buttonGroup()->addRadioButton( radioButton );
135 NCWidgetFactory::createComboBox( YWidget * parent,
const std::string & label,
bool editable )
138 YUI_CHECK_NEW( comboBox );
145 NCWidgetFactory::createSelectionBox( YWidget * parent,
const std::string & label )
148 YUI_CHECK_NEW( selectionBox );
155 NCWidgetFactory::createTree( YWidget * parent,
const std::string & label,
bool multiselection,
bool recursiveselection )
157 NCTree * tree =
new NCTree( parent, label, multiselection, recursiveselection );
158 YUI_CHECK_NEW( tree );
165 NCWidgetFactory::createTable( YWidget * parent, YTableHeader * tableHeader,
bool multiSelection )
167 NCTable *table =
new NCTable( parent, tableHeader, multiSelection );
168 YUI_CHECK_NEW( table );
175 NCWidgetFactory::createProgressBar( YWidget * parent,
const std::string & label,
int maxValue )
178 YUI_CHECK_NEW( progressBar );
185 NCWidgetFactory::createBusyIndicator( YWidget * parent,
const std::string & label,
int timeout)
188 YUI_CHECK_NEW( busyIndicator );
190 return busyIndicator;
195 NCWidgetFactory::createRichText( YWidget * parent,
const std::string & text,
bool plainTextMode )
198 YUI_CHECK_NEW( richText );
209 NCWidgetFactory::createIntField( YWidget * parent,
const std::string & label,
int minVal,
int maxVal,
int initialVal )
212 YUI_CHECK_NEW( intField );
219 NCWidgetFactory::createMenuButton( YWidget * parent,
const std::string & label )
222 YUI_CHECK_NEW( menuButton );
229 NCWidgetFactory::createMultiLineEdit( YWidget * parent,
const std::string & label )
232 YUI_CHECK_NEW( multiLineEdit );
234 return multiLineEdit;
239 NCWidgetFactory::createLogView( YWidget * parent,
const std::string & label,
int visibleLines,
int storedLines )
242 YUI_CHECK_NEW( logView );
249 NCWidgetFactory::createMultiSelectionBox( YWidget * parent,
const std::string & label )
252 YUI_CHECK_NEW( multiSelectionBox );
254 return multiSelectionBox;
259 NCWidgetFactory::createItemSelector( YWidget * parent,
bool enforceSingleSelection )
262 YUI_CHECK_NEW( itemSelector );
269 NCWidgetFactory::createCustomStatusItemSelector( YWidget * parent,
const YItemCustomStatusVector & customStates )
272 YUI_CHECK_NEW( itemSelector );
284 NCWidgetFactory::createSpacing( YWidget * parent, YUIDimension dim,
bool stretchable, YLayoutSize_t size )
287 YUI_CHECK_NEW( spacing );
294 NCWidgetFactory::createLayoutBox( YWidget * parent, YUIDimension dim )
297 YUI_CHECK_NEW( layoutBox );
304 NCWidgetFactory::createButtonBox( YWidget * parent )
307 YUI_CHECK_NEW( buttonBox );
314 NCWidgetFactory::createEmpty( YWidget * parent )
317 YUI_CHECK_NEW( empty );
324 NCWidgetFactory::createAlignment( YWidget * parent,
325 YAlignmentType horAlignment,
326 YAlignmentType vertAlignment )
329 YUI_CHECK_NEW( alignment );
336 NCWidgetFactory::createSquash( YWidget * parent,
bool horSquash,
bool vertSquash )
339 YUI_CHECK_NEW( squash );
346 NCWidgetFactory::createFrame( YWidget * parent,
const std::string & label )
349 YUI_CHECK_NEW( frame );
356 NCWidgetFactory::createCheckBoxFrame( YWidget * parent,
const std::string & label,
bool checked )
359 YUI_CHECK_NEW( checkBoxFrame );
361 return checkBoxFrame;
366 NCWidgetFactory::createRadioButtonGroup( YWidget * parent )
369 YUI_CHECK_NEW( radioButtonGroup );
371 return radioButtonGroup;
376 NCWidgetFactory::createReplacePoint( YWidget * parent )
379 YUI_CHECK_NEW( replacePoint );
386 NCWidgetFactory::createImage( YWidget * parent,
const std::string & imageFileName,
bool animated )
389 YUI_CHECK_NEW( image );
396 NCWidgetFactory::createPackageSelector( YWidget * parent,
long modeFlags )
411 NCWidgetFactory::createPkgSpecial( YWidget * parent,
const std::string & subwidget )
virtual YPackageSelector * createPackageSelector(YWidget *parent, long modeFlags)
Create a package selector.
virtual YWidget * createPkgSpecial(YWidget *parent, const std::string &subwidget)
Create a special widget.
static YNCursesUI * ui()
Access the global Y2NCursesUI.
NCPackageSelectorPluginStub * packageSelectorPlugin()
Returns the package selector plugin singleton of this UI or creates it (including loading the plugin ...