libyui-qt  2.49.2
YQOptionalWidgetFactory.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQOptionalWidgetFactory.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YQOptionalWidgetFactory_h
26 #define YQOptionalWidgetFactory_h
27 
28 
29 #include <yui/YOptionalWidgetFactory.h>
30 
31 #include "YQBarGraph.h"
32 #include "YQDateField.h"
33 #include "YQDownloadProgress.h"
34 #include "YQDumbTab.h"
35 #include "YQMultiProgressMeter.h"
36 #include "YQPartitionSplitter.h"
37 #include "YQSlider.h"
38 #include "YQTimeField.h"
39 
40 class YQWizard;
41 
42 using std::string;
43 using std::vector;
44 
45 
46 
47 /**
48  * Widget factory for optional ("special") widgets.
49  *
50  * Remember to always check with the corresponding "has..()" method if the
51  * current UI actually provides the requested widget. Otherwise the
52  * "create...()" method will throw an exception.
53  **/
54 class YQOptionalWidgetFactory: public YOptionalWidgetFactory
55 {
56 public:
57 
58  //
59  // Optional Widgets
60  //
61 
62 
63  virtual bool hasWizard();
64  virtual YWizard * createWizard ( YWidget * parent,
65  const std::string & backButtonLabel,
66  const std::string & abortButtonLabel,
67  const std::string & nextButtonLabel,
68  YWizardMode wizardMode = YWizardMode_Standard );
69 
70  virtual bool hasDumbTab();
71  virtual YQDumbTab * createDumbTab ( YWidget * parent );
72 
73  virtual bool hasSlider();
74  virtual YQSlider * createSlider ( YWidget * parent,
75  const std::string & label,
76  int minVal,
77  int maxVal,
78  int initialVal );
79 
80  virtual bool hasDateField();
81  virtual YQDateField * createDateField ( YWidget * parent, const std::string & label );
82 
83  virtual bool hasTimeField();
84  virtual YQTimeField * createTimeField ( YWidget * parent, const std::string & label );
85 
86  virtual bool hasBarGraph();
87  virtual YQBarGraph * createBarGraph ( YWidget * parent );
88 
89  virtual bool hasPatternSelector();
90  virtual YWidget * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
91 
92  virtual bool hasSimplePatchSelector();
93  virtual YWidget * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
94 
95  virtual bool hasMultiProgressMeter();
96  virtual YQMultiProgressMeter * createMultiProgressMeter( YWidget * parent, YUIDimension dim, const vector<float> & maxValues );
97 
98  virtual bool hasPartitionSplitter();
99  virtual YQPartitionSplitter * createPartitionSplitter ( YWidget * parent,
100  int usedSize,
101  int totalFreeSize,
102  int newPartSize,
103  int minNewPartSize,
104  int minFreeSize,
105  const std::string & usedLabel,
106  const std::string & freeLabel,
107  const std::string & newPartLabel,
108  const std::string & freeFieldLabel,
109  const std::string & newPartFieldLabel );
110 
111  virtual bool hasDownloadProgress();
112  virtual YQDownloadProgress * createDownloadProgress ( YWidget * parent,
113  const std::string & label,
114  const std::string & filename,
115  YFileSize_t expectedFileSize );
116 
117  virtual bool hasTimezoneSelector();
118  virtual YTimezoneSelector * createTimezoneSelector( YWidget * parent,
119  const std::string & pixmap,
120  const map<string,string> & timezones );
121 
122  virtual bool hasGraph();
123  virtual YGraph * createGraph( YWidget * parent, const std::string & filename,
124  const std::string & layoutAlgorithm );
125  virtual YGraph * createGraph( YWidget * parent, /* graph_t */ void * graph );
126 
127  virtual bool hasContextMenu();
128 
129 protected:
130 
131  friend class YQUI;
132 
133  /**
134  * Constructor.
135  *
136  * Use YUI::optionalWidgetFactory() to get the singleton for this class.
137  **/
139 
140  /**
141  * Destructor.
142  **/
143  virtual ~YQOptionalWidgetFactory();
144 
145 }; // class YQOptionalWidgetFactory
146 
147 
148 
149 #endif // YQOptionalWidgetFactory_h
Definition: YQUI.h:61
Widget factory for optional ("special") widgets.
virtual ~YQOptionalWidgetFactory()
Destructor.