1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQOptionalWidgetFactory.h
15 Author: Stefan Hundhammer <sh@suse.de>
19 #ifndef YQOptionalWidgetFactory_h
20 #define YQOptionalWidgetFactory_h
23 #include "YOptionalWidgetFactory.h"
25 #include "YQBarGraph.h"
26 #include "YQDateField.h"
27 #include "YQDownloadProgress.h"
28 #include "YQDumbTab.h"
29 #include "YQMultiProgressMeter.h"
30 #include "YQPartitionSplitter.h"
31 #include "pkg/YQPatternSelector.h"
32 #include "pkg/YQSimplePatchSelector.h"
34 #include "YQTimeField.h"
44 * Widget factory for optional ("special") widgets.
46 * Remember to always check with the corresponding "has..()" method if the
47 * current UI actually provides the requested widget. Otherwise the
48 * "create...()" method will throw an exception.
50 class YQOptionalWidgetFactory: public YOptionalWidgetFactory
59 virtual bool hasWizard();
60 virtual YWizard * createWizard ( YWidget * parent,
61 const string & backButtonLabel,
62 const string & abortButtonLabel,
63 const string & nextButtonLabel,
64 YWizardMode wizardMode = YWizardMode_Standard );
66 virtual bool hasDumbTab();
67 virtual YQDumbTab * createDumbTab ( YWidget * parent );
69 virtual bool hasSlider();
70 virtual YQSlider * createSlider ( YWidget * parent,
76 virtual bool hasDateField();
77 virtual YQDateField * createDateField ( YWidget * parent, const string & label );
79 virtual bool hasTimeField();
80 virtual YQTimeField * createTimeField ( YWidget * parent, const string & label );
82 virtual bool hasBarGraph();
83 virtual YQBarGraph * createBarGraph ( YWidget * parent );
85 virtual bool hasPatternSelector();
86 virtual YQPatternSelector * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
88 virtual bool hasSimplePatchSelector();
89 virtual YQSimplePatchSelector * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
91 virtual bool hasMultiProgressMeter();
92 virtual YQMultiProgressMeter * createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
94 virtual bool hasPartitionSplitter();
95 virtual YQPartitionSplitter * createPartitionSplitter ( YWidget * parent,
101 const string & usedLabel,
102 const string & freeLabel,
103 const string & newPartLabel,
104 const string & freeFieldLabel,
105 const string & newPartFieldLabel );
107 virtual bool hasDownloadProgress();
108 virtual YQDownloadProgress * createDownloadProgress ( YWidget * parent,
109 const string & label,
110 const string & filename,
111 YFileSize_t expectedFileSize );
120 * Use YUI::optionalWidgetFactory() to get the singleton for this class.
122 YQOptionalWidgetFactory();
127 virtual ~YQOptionalWidgetFactory();
129 }; // class YQOptionalWidgetFactory
133 #endif // YQOptionalWidgetFactory_h