]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQWidgetFactory.h
merge Huha's ydialog changes
[duncan/yast2-qt4.git] / src / YQWidgetFactory.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:         YQWidgetFactory.h
14
15   Author:       Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19 #ifndef YQWidgetFactory_h
20 #define YQWidgetFactory_h
21
22
23 #include "YWidgetFactory.h"
24
25 #include "YQAlignment.h"
26 #include "YQCheckBox.h"
27 #include "YQCheckBoxFrame.h"
28 #include "YQComboBox.h"
29 #include "YQDialog.h"
30 #include "YQEmpty.h"
31 #include "YQFrame.h"
32 #include "YQImage.h"
33 #include "YQInputField.h"
34 #include "YQIntField.h"
35 #include "YQLabel.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"
50 #include "YQSquash.h"
51 #include "YQTable.h"
52 #include "YQTimeField.h"
53 #include "YQTree.h"
54
55 using std::string;
56
57
58 /**
59  * Concrete widget factory for mandatory widgets.
60  **/
61 class YQWidgetFactory: public YWidgetFactory
62 {
63 public:
64     // Note: Using covariant return types for all createSomeWidget() methods
65     // (returning YQSomeWidget where the base class declares virtual methods that
66     // return YSomeWidget) 
67
68
69     //
70     // Dialogs
71     //
72
73     virtual YQDialog *          createDialog            ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
74
75     //
76     // Layout Boxes
77     //
78
79     virtual YQLayoutBox *       createLayoutBox         ( YWidget * parent, YUIDimension dim );
80
81     //
82     // Common Leaf Widgets
83     //
84
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 );
96
97     //
98     // Less Common Leaf Widgets
99     //
100
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 );
107
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
110
111     //
112     // Layout Helpers
113     //
114
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 );
119
120     //
121     // Visual Grouping
122     //
123
124     virtual YQFrame *           createFrame             ( YWidget * parent, const string & label );
125     virtual YQCheckBoxFrame *   createCheckBoxFrame     ( YWidget * parent, const string & label, bool checked );
126
127     //
128     // Logical Grouping
129     //
130
131     virtual YQRadioButtonGroup *createRadioButtonGroup  ( YWidget * parent );
132     virtual YQReplacePoint *    createReplacePoint      ( YWidget * parent );
133
134
135 protected:
136
137     friend class YQUI;
138
139     /**
140      * Constructor.
141      *
142      * Use YUI::widgetFactory() to get the singleton for this class.
143      **/
144     YQWidgetFactory();
145
146     /**
147      * Destructory.
148      **/
149     virtual ~YQWidgetFactory();
150
151 }; // class YWidgetFactory
152
153
154 #endif // YQWidgetFactory_h