]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQOptionalWidgetFactory.h
picking up branches/tmp/sh/qt4-port/, merging it with trunk
[duncan/yast2-qt4.git] / src / YQOptionalWidgetFactory.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:         YQOptionalWidgetFactory.h
14
15   Author:       Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19 #ifndef YQOptionalWidgetFactory_h
20 #define YQOptionalWidgetFactory_h
21
22
23 #include "YOptionalWidgetFactory.h"
24
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 "YQPatternSelector.h"
32 #include "YQSimplePatchSelector.h"
33 #include "YQSlider.h"
34 #include "YQTimeField.h"
35 #include "YQWizard.h"
36
37 using std::string;
38 using std::vector;
39
40
41
42 /**
43  * Widget factory for optional ("special") widgets.
44  *
45  * Remember to always check with the corresponding "has..()" method if the
46  * current UI actually provides the requested widget. Otherwise the
47  * "create...()" method will throw an exception.
48  **/
49 class YQOptionalWidgetFactory: public YOptionalWidgetFactory
50 {
51 public:
52
53     //
54     // Optional Widgets
55     //
56
57
58     virtual bool                        hasWizard();
59     virtual YQWizard *                  createWizard            ( YWidget *   parent,
60                                                                   YWidgetID * backButtonId,     const string & backButtonLabel,
61                                                                   YWidgetID * abortButtonId,    const string & abortButtonLabel,
62                                                                   YWidgetID * nextButtonId,     const string & nextButtonLabel,
63                                                                   YWizardMode wizardMode = YWizardMode_Standard );
64
65     virtual bool                        hasDumbTab();
66     virtual YQDumbTab *                 createDumbTab           ( YWidget * parent );
67
68     virtual bool                        hasSlider();
69     virtual YQSlider *                  createSlider            ( YWidget *             parent,
70                                                                   const string  &       label,
71                                                                   int                   minVal,
72                                                                   int                   maxVal,
73                                                                   int                   initialVal );
74
75     virtual bool                        hasDateField();
76     virtual YQDateField *               createDateField         ( YWidget * parent, const string & label );
77
78     virtual bool                        hasTimeField();
79     virtual YQTimeField *               createTimeField         ( YWidget * parent, const string & label );
80
81     virtual bool                        hasBarGraph();
82     virtual YQBarGraph *                createBarGraph          ( YWidget * parent );
83
84     virtual bool                        hasPatternSelector();
85     virtual YQPatternSelector *         createPatternSelector   ( YWidget * parent, long modeFlags = 0 );
86
87     virtual bool                        hasSimplePatchSelector();
88     virtual YQSimplePatchSelector *     createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
89
90     virtual bool                        hasMultiProgressMeter();
91     virtual YQMultiProgressMeter *      createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
92
93     virtual bool                        hasPartitionSplitter();
94     virtual YQPartitionSplitter *       createPartitionSplitter ( YWidget *             parent,
95                                                                   int                   usedSize,
96                                                                   int                   totalFreeSize,
97                                                                   int                   newPartSize,
98                                                                   int                   minNewPartSize,
99                                                                   int                   minFreeSize,
100                                                                   const string &        usedLabel,
101                                                                   const string &        freeLabel,
102                                                                   const string &        newPartLabel,
103                                                                   const string &        freeFieldLabel,
104                                                                   const string &        newPartFieldLabel );
105
106     virtual bool                        hasDownloadProgress();
107     virtual YQDownloadProgress *        createDownloadProgress  ( YWidget *             parent,
108                                                                   const string &        label,
109                                                                   const string &        filename,
110                                                                   YFileSize_t           expectedFileSize );
111
112 protected:
113
114     friend class YQUI;
115
116     /**
117      * Constructor.
118      *
119      * Use YUI::optionalWidgetFactory() to get the singleton for this class.
120      **/
121     YQOptionalWidgetFactory();
122
123     /**
124      * Destructor.
125      **/
126     virtual ~YQOptionalWidgetFactory();
127
128 }; // class YQOptionalWidgetFactory
129
130
131
132 #endif // YQOptionalWidgetFactory_h