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