libyui-qt  2.49.2
YQWidgetFactory.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: YQWidgetFactory.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YQWidgetFactory_h
26 #define YQWidgetFactory_h
27 
28 
29 #include <yui/YWidgetFactory.h>
30 
31 #include "YQAlignment.h"
32 #include "YQButtonBox.h"
33 #include "YQCheckBox.h"
34 #include "YQCheckBoxFrame.h"
35 #include "YQComboBox.h"
36 #include "YQDialog.h"
37 #include "YQEmpty.h"
38 #include "YQFrame.h"
39 #include "YQImage.h"
40 #include "YQInputField.h"
41 #include "YQIntField.h"
42 #include "YQLabel.h"
43 #include "YQLayoutBox.h"
44 #include "YQLogView.h"
45 #include "YQMenuButton.h"
46 #include "YQMultiLineEdit.h"
47 #include "YQMultiSelectionBox.h"
48 #include "YQProgressBar.h"
49 #include "YQPushButton.h"
50 #include "YQRadioButton.h"
51 #include "YQRadioButtonGroup.h"
52 #include "YQReplacePoint.h"
53 #include "YQRichText.h"
54 #include "YQSelectionBox.h"
55 #include "YQSpacing.h"
56 #include "YQSquash.h"
57 #include "YQTable.h"
58 #include "YQTimeField.h"
59 #include "YQTree.h"
60 #include "YQBusyIndicator.h"
61 
62 using std::string;
63 
64 
65 /**
66  * Concrete widget factory for mandatory widgets.
67  **/
68 class YQWidgetFactory: public YWidgetFactory
69 {
70 public:
71  // Note: Using covariant return types for all createSomeWidget() methods
72  // (returning YQSomeWidget where the base class declares virtual methods that
73  // return YSomeWidget)
74 
75 
76  //
77  // Dialogs
78  //
79 
80  virtual YQDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
81 
82  //
83  // Layout Boxes
84  //
85 
86  virtual YQLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim );
87  virtual YQButtonBox * createButtonBox ( YWidget * parent );
88 
89  //
90  // Common Leaf Widgets
91  //
92 
93  virtual YQPushButton * createPushButton ( YWidget * parent, const std::string & label );
94  virtual YQLabel * createLabel ( YWidget * parent, const std::string & text, bool isHeading = false, bool isOutputField = false );
95  virtual YQInputField * createInputField ( YWidget * parent, const std::string & label, bool passwordMode = false );
96  virtual YQCheckBox * createCheckBox ( YWidget * parent, const std::string & label, bool isChecked = false );
97  virtual YQRadioButton * createRadioButton ( YWidget * parent, const std::string & label, bool isChecked = false );
98  virtual YQComboBox * createComboBox ( YWidget * parent, const std::string & label, bool editable = false );
99  virtual YQSelectionBox * createSelectionBox ( YWidget * parent, const std::string & label );
100  virtual YQTree * createTree ( YWidget * parent, const std::string & label, bool multiselection = false, bool recursiveselection = false );
101  virtual YQTable * createTable ( YWidget * parent, YTableHeader * header, bool multiSelection = false );
102  virtual YQProgressBar * createProgressBar ( YWidget * parent, const std::string & label, int maxValue = 100 );
103  virtual YQRichText * createRichText ( YWidget * parent, const std::string & text = std::string(), bool plainTextMode = false );
104 
105  //
106  // Less Common Leaf Widgets
107  //
108 
109  virtual YQIntField * createIntField ( YWidget * parent, const std::string & label, int minVal, int maxVal, int initialVal );
110  virtual YQMenuButton * createMenuButton ( YWidget * parent, const std::string & label );
111  virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const std::string & label );
112  virtual YQImage * createImage ( YWidget * parent, const std::string & imageFileName, bool animated = false );
113  virtual YQLogView * createLogView ( YWidget * parent, const std::string & label, int visibleLines, int storedLines = 0 );
114  virtual YQMultiSelectionBox *createMultiSelectionBox( YWidget * parent, const std::string & label );
115  virtual YQBusyIndicator * createBusyIndicator ( YWidget * parent, const std::string & label, int maxValue = 100 );
116 
117  virtual YPackageSelector * createPackageSelector ( YWidget * parent, long modeFlags = 0 );
118  virtual YWidget * createPkgSpecial ( YWidget * parent, const std::string & name ); // NCurses only, will throw exception in the Qt UI
119 
120  //
121  // Layout Helpers
122  //
123 
124  virtual YQSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
125  virtual YQEmpty * createEmpty ( YWidget * parent );
126  virtual YQAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
127  virtual YQSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash );
128 
129  //
130  // Visual Grouping
131  //
132 
133  virtual YQFrame * createFrame ( YWidget * parent, const std::string & label );
134  virtual YQCheckBoxFrame * createCheckBoxFrame ( YWidget * parent, const std::string & label, bool checked );
135 
136  //
137  // Logical Grouping
138  //
139 
140  virtual YQRadioButtonGroup *createRadioButtonGroup ( YWidget * parent );
141  virtual YQReplacePoint * createReplacePoint ( YWidget * parent );
142 
143 
144 protected:
145 
146  friend class YQUI;
147 
148  /**
149  * Constructor.
150  *
151  * Use YUI::widgetFactory() to get the singleton for this class.
152  **/
153  YQWidgetFactory();
154 
155  /**
156  * Destructor.
157  **/
158  virtual ~YQWidgetFactory();
159 
160 }; // class YWidgetFactory
161 
162 
163 #endif // YQWidgetFactory_h
MultiLineEdit - an input area for multi-line text.
YQWidgetFactory()
Constructor.
Definition: YQTree.h:38
Definition: YQUI.h:61
Concrete widget factory for mandatory widgets.
virtual ~YQWidgetFactory()
Destructor.