]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/YWebWidgetFactory.cc
57acb765055aecc12b75409f4655e49fd5eff8e3
[duncan/yast2-web-wt.git] / src / YWebWidgetFactory.cc
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:         YWebWidgetFactory.cc
14
15   Author:       Stanislav Visnovsky <visnov@suse.de>
16
17 /-*/
18
19 #define y2log_component "web-ui"
20 #include <ycp/y2log.h>
21
22 #include "YWebWidgetFactory.h"
23
24 #include "YWebPushButton.h"
25 #include "YWebLabel.h"
26
27 #include <string>
28
29
30 using std::string;
31
32 class YWidget;
33 class YAlignment;
34 class YCheckBox;
35 class YCheckBoxFrame;
36 class YComboBox;
37 class YDialog;
38 class YEmpty;
39 class YFrame;
40 class YImage;
41 class YInputField;
42 class YIntField;
43 class YLabel;
44 class YLayoutBox;
45 class YLogView;
46 class YMenuButton;
47 class YMultiLineEdit;
48 class YMultiSelectionBox;
49 class YPackageSelector;
50 class YProgressBar;
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
73     //
74     // Dialogs
75     //
76
77     YDialog *           YWebWidgetFactory::createMainDialog()   { return 0L; }
78     YDialog *           YWebWidgetFactory::createPopupDialog()  { return 0L; }
79
80     //
81     // Layout Boxes
82     //
83
84     YLayoutBox *        YWebWidgetFactory::createVBox           ( YWidget * parent ){ return 0L; }
85     YLayoutBox *        YWebWidgetFactory::createHBox           ( YWidget * parent ){ return 0L; }
86     YLayoutBox *        YWebWidgetFactory::createLayoutBox              ( YWidget * parent, YUIDimension dimension )                            { return 0L; }          
87     YAlignment *        YWebWidgetFactory::createAlignment         ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ) { return 0L; }
88     //
89     // Common Leaf Widgets
90     //
91
92 YPushButton *   YWebWidgetFactory::createPushButton     ( YWidget * parent, const string & label )                              
93 {
94     y2milestone( "Creating push button '%s'", label.c_str() );
95     return new YWebPushButton( parent, label );
96 }
97
98 YLabel * YWebWidgetFactory::createLabel( YWidget * parent, const string & text, bool isHeading, bool isOutputField )
99 {
100   return new YWebLabel(parent, text);
101 }
102
103
104     YInputField *       YWebWidgetFactory::createInputField     ( YWidget * parent, const string & label, bool passwordMode )   { return 0L; }
105     YCheckBox *         YWebWidgetFactory::createCheckBox               ( YWidget * parent, const string & label, bool isChecked )      { return 0L; }
106     YRadioButton *      YWebWidgetFactory::createRadioButton    ( YWidget * parent, const string & label, bool isChecked )      { return 0L; }
107     YComboBox *         YWebWidgetFactory::createComboBox               ( YWidget * parent, const string & label, bool editable )       { return 0L; }
108     YSelectionBox *     YWebWidgetFactory::createSelectionBox   ( YWidget * parent, const string & label )                              { return 0L; }
109     YTree *             YWebWidgetFactory::createTree           ( YWidget * parent, const string & label )                              { return 0L; }
110     YTable *            YWebWidgetFactory::createTable          ( YWidget * parent, YTableHeader * header )                             { return 0L; }
111     YProgressBar *      YWebWidgetFactory::createProgressBar    ( YWidget * parent, const string & label, int maxValue )                { return 0L; }
112     YRichText *         YWebWidgetFactory::createRichText       ( YWidget * parent, const string & text, bool plainTextMode )   { return 0L; }
113
114     //
115     // Less Common Leaf Widgets
116     //
117
118     YIntField *         YWebWidgetFactory::createIntField       ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal )      { return 0L; }
119
120     YMenuButton *       YWebWidgetFactory::createMenuButton     ( YWidget * parent, const string & label )                                              { return 0L; }
121     YMultiLineEdit *    YWebWidgetFactory::createMultiLineEdit  ( YWidget * parent, const string & label )                                              { return 0L; }
122     YImage *            YWebWidgetFactory::createImage          ( YWidget * parent, const string & imageFileName, bool animated )               { return 0L; }
123     YLogView *          YWebWidgetFactory::createLogView        ( YWidget * parent, const string & label, int visibleLines, int storedLines )   { return 0L; }
124     YMultiSelectionBox *YWebWidgetFactory::createMultiSelectionBox ( YWidget * parent, const string & label )                                           { return 0L; }
125
126     YPackageSelector *  YWebWidgetFactory::createPackageSelector( YWidget * parent, long ModeFlags )            { return 0L; }
127     YWidget *           YWebWidgetFactory::createPkgSpecial     ( YWidget * parent, const string & subwidgetName )      { return 0L; } // NCurses only
128
129     //
130     // Layout Helpers
131     //
132
133     YSpacing *          YWebWidgetFactory::createSpacing        ( YWidget * parent, YUIDimension dim, bool stretchable, YLayoutSize_t size ) { return 0L; }
134     YEmpty *            YWebWidgetFactory::createEmpty          ( YWidget * parent )    { return 0L; }
135
136     YSquash *           YWebWidgetFactory::createSquash         ( YWidget * parent, bool horSquash, bool vertSquash ) { return 0L; }
137
138     //
139     // Visual Grouping
140     //
141
142     YFrame *            YWebWidgetFactory::createFrame          ( YWidget * parent, const string & label )               { return 0L; }
143     YCheckBoxFrame *    YWebWidgetFactory::createCheckBoxFrame  ( YWidget * parent, const string & label, bool checked ) { return 0L; }
144
145     //
146     // Logical Grouping
147     //
148
149     YRadioButtonGroup * YWebWidgetFactory::createRadioButtonGroup       ( YWidget * parent )    { return 0L; }
150     YReplacePoint *     YWebWidgetFactory::createReplacePoint   ( YWidget * parent )    { return 0L; }
151
152
153     /**
154      * Constructor.
155      *
156      * Use YUI::widgetFactory() to get the singleton for this class.
157      **/
158     YWebWidgetFactory::YWebWidgetFactory(){}
159
160     /**
161      * Destructory.
162      **/
163     YWebWidgetFactory::~YWebWidgetFactory(){}
164