]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/YWebWidgetFactory.h
examples
[duncan/yast2-web-wt.git] / src / YWebWidgetFactory.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:         YWebWidgetFactory.h
14
15   Author:       Stefan Hundhammer <sh@suse.de>
16                 Stanislav Visnovsky <visnov@suse.de>
17
18 /-*/
19
20 #ifndef YWebWidgetFactory_h
21 #define YWebWidgetFactory_h
22
23 #include <yui/YWidgetFactory.h>
24
25 #include <string>
26
27 #include "YTypes.h"
28
29 using std::string;
30
31 class YWidget;
32 class YAlignment;
33 class YCheckBox;
34 class YCheckBoxFrame;
35 class YComboBox;
36 class YDialog;
37 class YEmpty;
38 class YFrame;
39 class YImage;
40 class YInputField;
41 class YIntField;
42 class YLabel;
43 class YLayoutBox;
44 class YLogView;
45 class YMenuButton;
46 class YMultiLineEdit;
47 class YMultiSelectionBox;
48 class YPackageSelector;
49 class YProgressBar;
50 class YPushButton;
51 class YRadioButton;
52 class YRadioButtonGroup;
53 class YReplacePoint;
54 class YRichText;
55 class YSelectionBox;
56 class YSpacing;
57 class YSquash;
58 class YTable;
59 class YTableHeader;
60 class YTimeField;
61 class YTree;
62
63
64
65 /**
66  * Abstract widget factory for mandatory widgets.
67  * Use YOptionalWidgetFactory for optional ("special") widgets.
68  *
69  * Refer to the respective widget's documentation (in the header file) for
70  * documentation about the function parameters.
71  **/
72 class YWebWidgetFactory: public YWidgetFactory
73 {
74 public:
75
76     //
77     // Dialogs
78     //
79
80     virtual YDialog *           createMainDialog()      ;
81     virtual YDialog *           createPopupDialog()     ;
82
83     //
84     // Layout Boxes
85     //
86
87     YLayoutBox *                createVBox              ( YWidget * parent );
88     YLayoutBox *                createHBox              ( YWidget * parent );
89     virtual YLayoutBox *        createLayoutBox         ( YWidget * parent, YUIDimension dimension )                            ;               
90
91     virtual YAlignment *        createAlignment         ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ) ;
92     //
93     // Common Leaf Widgets
94     //
95
96     virtual YPushButton *       createPushButton        ( YWidget * parent, const string & label )                              ;
97     virtual YLabel *            createLabel             ( YWidget * parent, const string & text, bool isHeading = false, bool isOutputField = false ) ;
98     virtual YInputField *       createInputField        ( YWidget * parent, const string & label, bool passwordMode = false )   ;
99     virtual YCheckBox *         createCheckBox          ( YWidget * parent, const string & label, bool isChecked = false )      ;
100     virtual YRadioButton *      createRadioButton       ( YWidget * parent, const string & label, bool isChecked = false )      ;
101     virtual YComboBox *         createComboBox          ( YWidget * parent, const string & label, bool editable  = false )      ;
102     virtual YSelectionBox *     createSelectionBox      ( YWidget * parent, const string & label )                              ;
103     virtual YTree *             createTree              ( YWidget * parent, const string & label )                              ;
104     virtual YTable *            createTable             ( YWidget * parent, YTableHeader * header )                             ;
105     virtual YProgressBar *      createProgressBar       ( YWidget * parent, const string & label, int maxValue = 100 )          ;
106     virtual YRichText *         createRichText          ( YWidget * parent, const string & text, bool plainTextMode = false )   ;
107
108     //
109     // Less Common Leaf Widgets
110     //
111
112     virtual YIntField *         createIntField          ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal )      ;
113
114     virtual YMenuButton *       createMenuButton        ( YWidget * parent, const string & label )                                              ;
115     virtual YMultiLineEdit *    createMultiLineEdit     ( YWidget * parent, const string & label )                                              ;
116     virtual YImage *            createImage             ( YWidget * parent, const string & imageFileName, bool animated = false )               ;
117     virtual YLogView *          createLogView           ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 )       ;
118     virtual YMultiSelectionBox *createMultiSelectionBox ( YWidget * parent, const string & label )                                              ;
119
120     virtual YPackageSelector *  createPackageSelector   ( YWidget * parent, long ModeFlags = 0 )                ;
121     virtual YWidget *           createPkgSpecial        ( YWidget * parent, const string & subwidgetName )      ; // NCurses only
122
123     //
124     // Layout Helpers
125     //
126
127     YSpacing *                  createHStretch          ( YWidget * parent );
128     YSpacing *                  createVStretch          ( YWidget * parent );
129     YSpacing *                  createHSpacing          ( YWidget * parent, YLayoutSize_t size = 1.0 );
130     YSpacing *                  createVSpacing          ( YWidget * parent, YLayoutSize_t size = 1.0 );
131     virtual YSpacing *          createSpacing           ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 ) ;
132     virtual YEmpty *            createEmpty             ( YWidget * parent )    ;
133
134     virtual YSquash *           createSquash            ( YWidget * parent, bool horSquash, bool vertSquash ) ;
135
136     //
137     // Visual Grouping
138     //
139
140     virtual YFrame *            createFrame             ( YWidget * parent, const string & label )               ;
141     virtual YCheckBoxFrame *    createCheckBoxFrame     ( YWidget * parent, const string & label, bool checked ) ;
142
143     //
144     // Logical Grouping
145     //
146
147     virtual YRadioButtonGroup * createRadioButtonGroup  ( YWidget * parent )    ;
148     virtual YReplacePoint *     createReplacePoint      ( YWidget * parent )    ;
149
150
151 protected:
152
153     friend class YWebUI;
154
155     /**
156      * Constructor.
157      *
158      * Use YUI::widgetFactory() to get the singleton for this class.
159      **/
160     YWebWidgetFactory();
161
162     /**
163      * Destructory.
164      **/
165     virtual ~YWebWidgetFactory();
166
167 }; // class YWebWidgetFactory
168
169
170 #endif // YWebWidgetFactory_h