1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQWidgetFactory.h
15 Author: Stefan Hundhammer <sh@suse.de>
19 #ifndef YQWidgetFactory_h
20 #define YQWidgetFactory_h
23 #include "YWidgetFactory.h"
25 #include "YQAlignment.h"
26 #include "YQCheckBox.h"
27 #include "YQCheckBoxFrame.h"
28 #include "YQComboBox.h"
33 #include "YQInputField.h"
34 #include "YQIntField.h"
36 #include "YQLayoutBox.h"
37 #include "YQLogView.h"
38 #include "YQMenuButton.h"
39 #include "YQMultiLineEdit.h"
40 #include "YQMultiSelectionBox.h"
41 #include "YQPackageSelector.h"
42 #include "YQProgressBar.h"
43 #include "YQPushButton.h"
44 #include "YQRadioButton.h"
45 #include "YQRadioButtonGroup.h"
46 #include "YQReplacePoint.h"
47 #include "YQRichText.h"
48 #include "YQSelectionBox.h"
49 #include "YQSpacing.h"
52 #include "YQTimeField.h"
59 * Concrete widget factory for mandatory widgets.
61 class YQWidgetFactory: public YWidgetFactory
64 // Note: Using covariant return types for all createSomeWidget() methods
65 // (returning YQSomeWidget where the base class declares virtual methods that
66 // return YSomeWidget)
73 virtual YQDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
79 virtual YQLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim );
82 // Common Leaf Widgets
85 virtual YQPushButton * createPushButton ( YWidget * parent, const string & label );
86 virtual YQLabel * createLabel ( YWidget * parent, const string & text, bool isHeading = false, bool isOutputField = false );
87 virtual YQInputField * createInputField ( YWidget * parent, const string & label, bool passwordMode = false );
88 virtual YQCheckBox * createCheckBox ( YWidget * parent, const string & label, bool isChecked = false );
89 virtual YQRadioButton * createRadioButton ( YWidget * parent, const string & label, bool isChecked = false );
90 virtual YQComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false );
91 virtual YQSelectionBox * createSelectionBox ( YWidget * parent, const string & label );
92 virtual YQTree * createTree ( YWidget * parent, const string & label );
93 virtual YQTable * createTable ( YWidget * parent, YTableHeader * header );
94 virtual YQProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 );
95 virtual YQRichText * createRichText ( YWidget * parent, const string & text = string(), bool plainTextMode = false );
98 // Less Common Leaf Widgets
101 virtual YQIntField * createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal );
102 virtual YQMenuButton * createMenuButton ( YWidget * parent, const string & label );
103 virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label );
104 virtual YQImage * createImage ( YWidget * parent, const string & imageFileName, bool animated = false );
105 virtual YQLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 );
106 virtual YQMultiSelectionBox *createMultiSelectionBox( YWidget * parent, const string & label );
108 virtual YQPackageSelector * createPackageSelector ( YWidget * parent, long modeFlags = 0 );
109 virtual YWidget * createPkgSpecial ( YWidget * parent, const string & name ); // NCurses only, will throw exception in the Qt UI
115 virtual YQSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
116 virtual YQEmpty * createEmpty ( YWidget * parent );
117 virtual YQAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
118 virtual YQSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash );
124 virtual YQFrame * createFrame ( YWidget * parent, const string & label );
125 virtual YQCheckBoxFrame * createCheckBoxFrame ( YWidget * parent, const string & label, bool checked );
131 virtual YQRadioButtonGroup *createRadioButtonGroup ( YWidget * parent );
132 virtual YQReplacePoint * createReplacePoint ( YWidget * parent );
142 * Use YUI::widgetFactory() to get the singleton for this class.
149 virtual ~YQWidgetFactory();
151 }; // class YWidgetFactory
154 #endif // YQWidgetFactory_h