]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQOptionalWidgetFactory.h
don't create QObjects in ycp thread - make timeouts work
[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 "pkg/YQPatternSelector.h"
32 #include "pkg/YQSimplePatchSelector.h"
33 #include "YQSlider.h"
34 #include "YQTimeField.h"
35
36 class YQWizard;
37
38 using std::string;
39 using std::vector;
40
41
42
43 /**
44  * Widget factory for optional ("special") widgets.
45  *
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.
49  **/
50 class YQOptionalWidgetFactory: public YOptionalWidgetFactory
51 {
52 public:
53
54     //
55     // Optional Widgets
56     //
57
58
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 );
65
66     virtual bool                        hasDumbTab();
67     virtual YQDumbTab *                 createDumbTab           ( YWidget * parent );
68
69     virtual bool                        hasSlider();
70     virtual YQSlider *                  createSlider            ( YWidget *             parent,
71                                                                   const string  &       label,
72                                                                   int                   minVal,
73                                                                   int                   maxVal,
74                                                                   int                   initialVal );
75
76     virtual bool                        hasDateField();
77     virtual YQDateField *               createDateField         ( YWidget * parent, const string & label );
78
79     virtual bool                        hasTimeField();
80     virtual YQTimeField *               createTimeField         ( YWidget * parent, const string & label );
81
82     virtual bool                        hasBarGraph();
83     virtual YQBarGraph *                createBarGraph          ( YWidget * parent );
84
85     virtual bool                        hasPatternSelector();
86     virtual YQPatternSelector *         createPatternSelector   ( YWidget * parent, long modeFlags = 0 );
87
88     virtual bool                        hasSimplePatchSelector();
89     virtual YQSimplePatchSelector *     createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
90
91     virtual bool                        hasMultiProgressMeter();
92     virtual YQMultiProgressMeter *      createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
93
94     virtual bool                        hasPartitionSplitter();
95     virtual YQPartitionSplitter *       createPartitionSplitter ( YWidget *             parent,
96                                                                   int                   usedSize,
97                                                                   int                   totalFreeSize,
98                                                                   int                   newPartSize,
99                                                                   int                   minNewPartSize,
100                                                                   int                   minFreeSize,
101                                                                   const string &        usedLabel,
102                                                                   const string &        freeLabel,
103                                                                   const string &        newPartLabel,
104                                                                   const string &        freeFieldLabel,
105                                                                   const string &        newPartFieldLabel );
106
107     virtual bool                        hasDownloadProgress();
108     virtual YQDownloadProgress *        createDownloadProgress  ( YWidget *             parent,
109                                                                   const string &        label,
110                                                                   const string &        filename,
111                                                                   YFileSize_t           expectedFileSize );
112
113 protected:
114
115     friend class YQUI;
116
117     /**
118      * Constructor.
119      *
120      * Use YUI::optionalWidgetFactory() to get the singleton for this class.
121      **/
122     YQOptionalWidgetFactory();
123
124     /**
125      * Destructor.
126      **/
127     virtual ~YQOptionalWidgetFactory();
128
129 }; // class YQOptionalWidgetFactory
130
131
132
133 #endif // YQOptionalWidgetFactory_h