libyui
 
Loading...
Searching...
No Matches
YWidgetFactory.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: YWidgetFactory.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25#ifndef YWidgetFactory_h
26#define YWidgetFactory_h
27
28#include <string>
29
30#include "YTypes.h"
31#include "YItemCustomStatus.h"
32
33
34class YWidget;
35class YAlignment;
36class YBusyIndicator;
37class YButtonBox;
38class YCheckBox;
39class YCheckBoxFrame;
40class YComboBox;
41class YDialog;
42class YEmpty;
43class YFrame;
44class YImage;
45class YInputField;
46class YIntField;
47class YItemSelector;
48class YLabel;
49class YLayoutBox;
50class YLogView;
51class YMenuBar;
52class YMenuButton;
53class YMultiLineEdit;
56class YProgressBar;
57class YPushButton;
58class YRadioButton;
60class YReplacePoint;
61class YRichText;
62class YSelectionBox;
63class YSpacing;
64class YSquash;
65class YTable;
66class YTableHeader;
67class YTimeField;
68class YTree;
69
70
71
80{
81public:
82
83 //
84 // Dialogs
85 //
86
87 YDialog * createMainDialog ( YDialogColorMode colorMode = YDialogNormalColor );
88 YDialog * createPopupDialog ( YDialogColorMode colorMode = YDialogNormalColor );
89 virtual YDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor ) = 0;
90
91 //
92 // Layout Boxes
93 //
94
95 YLayoutBox * createVBox ( YWidget * parent );
96 YLayoutBox * createHBox ( YWidget * parent );
97 virtual YLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dimension ) = 0;
98 virtual YButtonBox * createButtonBox ( YWidget * parent ) = 0;
99
100 //
101 // Common Leaf Widgets
102 //
103
104 virtual YPushButton * createPushButton ( YWidget * parent, const std::string & label ) = 0;
105 virtual YLabel * createLabel ( YWidget * parent, const std::string & text, bool isHeading = false, bool isOutputField = false ) = 0;
106 YLabel * createHeading ( YWidget * parent, const std::string & label );
107 virtual YInputField * createInputField ( YWidget * parent, const std::string & label, bool passwordMode = false ) = 0;
108 virtual YCheckBox * createCheckBox ( YWidget * parent, const std::string & label, bool isChecked = false ) = 0;
109 virtual YRadioButton * createRadioButton ( YWidget * parent, const std::string & label, bool isChecked = false ) = 0;
110 virtual YComboBox * createComboBox ( YWidget * parent, const std::string & label, bool editable = false ) = 0;
111 virtual YSelectionBox * createSelectionBox ( YWidget * parent, const std::string & label ) = 0;
112 virtual YTree * createTree ( YWidget * parent, const std::string & label, bool multiselection = false, bool recursiveselection = false ) = 0;
113 virtual YTable * createTable ( YWidget * parent, YTableHeader * header_disown, bool multiSelection = false ) = 0;
114 virtual YProgressBar * createProgressBar ( YWidget * parent, const std::string & label, int maxValue = 100 ) = 0;
115 virtual YRichText * createRichText ( YWidget * parent, const std::string & text = std::string(), bool plainTextMode = false ) = 0;
116 virtual YBusyIndicator * createBusyIndicator ( YWidget * parent, const std::string & label, int timeout = 1000 ) = 0;
117
118 //
119 // Less Common Leaf Widgets
120 //
121
122 YPushButton * createIconButton ( YWidget * parent, const std::string & iconName, const std::string & fallbackTextLabel );
123 YLabel * createOutputField ( YWidget * parent, const std::string & label );
124 virtual YIntField * createIntField ( YWidget * parent, const std::string & label, int minVal, int maxVal, int initialVal ) = 0;
125 YInputField * createPasswordField ( YWidget * parent, const std::string & label );
126
127 virtual YMenuButton * createMenuButton ( YWidget * parent, const std::string & label ) = 0;
128 virtual YMultiLineEdit * createMultiLineEdit ( YWidget * parent, const std::string & label ) = 0;
129 virtual YImage * createImage ( YWidget * parent, const std::string & imageFileName, bool animated = false ) = 0;
130 virtual YLogView * createLogView ( YWidget * parent, const std::string & label, int visibleLines, int storedLines = 0 ) = 0;
131 virtual YMultiSelectionBox *createMultiSelectionBox ( YWidget * parent, const std::string & label ) = 0;
132
133 virtual YPackageSelector * createPackageSelector ( YWidget * parent, long ModeFlags = 0 ) = 0;
134 virtual YWidget * createPkgSpecial ( YWidget * parent, const std::string & subwidgetName ) = 0; // NCurses only
135
136 //
137 // Layout Helpers
138 //
139
140 YSpacing * createHStretch ( YWidget * parent );
141 YSpacing * createVStretch ( YWidget * parent );
142 YSpacing * createHSpacing ( YWidget * parent, YLayoutSize_t size = 1.0 );
143 YSpacing * createVSpacing ( YWidget * parent, YLayoutSize_t size = 1.0 );
144 virtual YSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 ) = 0;
145 virtual YEmpty * createEmpty ( YWidget * parent ) = 0;
146
147 YAlignment * createLeft ( YWidget * parent );
148 YAlignment * createRight ( YWidget * parent );
149 YAlignment * createTop ( YWidget * parent );
150 YAlignment * createBottom ( YWidget * parent );
151 YAlignment * createHCenter ( YWidget * parent );
152 YAlignment * createVCenter ( YWidget * parent );
153 YAlignment * createHVCenter ( YWidget * parent );
154
155 YAlignment * createMarginBox ( YWidget * parent, YLayoutSize_t horMargin, YLayoutSize_t vertMargin );
156 YAlignment * createMarginBox ( YWidget * parent,
157 YLayoutSize_t leftMargin, YLayoutSize_t rightMargin,
158 YLayoutSize_t topMargin, YLayoutSize_t bottomMargin );
159
160 YAlignment * createMinWidth ( YWidget * parent, YLayoutSize_t minWidth );
161 YAlignment * createMinHeight ( YWidget * parent, YLayoutSize_t minHeight );
162 YAlignment * createMinSize ( YWidget * parent, YLayoutSize_t minWidth, YLayoutSize_t minHeight );
163
164 virtual YAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ) = 0;
165
166 YSquash * createHSquash ( YWidget * parent );
167 YSquash * createVSquash ( YWidget * parent );
168 YSquash * createHVSquash ( YWidget * parent );
169 virtual YSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash ) = 0;
170
171 //
172 // Visual Grouping
173 //
174
175 virtual YFrame * createFrame ( YWidget * parent, const std::string & label ) = 0;
176 virtual YCheckBoxFrame * createCheckBoxFrame ( YWidget * parent, const std::string & label, bool checked ) = 0;
177
178 //
179 // Logical Grouping
180 //
181
182 virtual YRadioButtonGroup * createRadioButtonGroup ( YWidget * parent ) = 0;
183 virtual YReplacePoint * createReplacePoint ( YWidget * parent ) = 0;
184
185 //
186 // More leaf widgets (moved to the end to maintain ABI compatibility)
187 //
188
189 virtual YItemSelector * createItemSelector ( YWidget * parent, bool enforceSingleSelection = true );
190 YItemSelector * createSingleItemSelector ( YWidget * parent );
191 YItemSelector * createMultiItemSelector ( YWidget * parent );
192 virtual YItemSelector * createCustomStatusItemSelector ( YWidget * parent, const YItemCustomStatusVector & customStates );
193
194 virtual YMenuBar * createMenuBar ( YWidget * parent );
195
196
197protected:
198
205
209 virtual ~YWidgetFactory();
210
211}; // class YWidgetFactory
212
213
214#endif // YWidgetFactory_h
YDialogType
Definition YTypes.h:67
Definition YAlignment.h:42
Definition YBusyIndicator.h:39
Definition YButtonBox.h:149
Definition YCheckBoxFrame.h:40
Definition YCheckBox.h:47
Definition YComboBox.h:54
Definition YDialog.h:48
Definition YEmpty.h:38
Definition YFrame.h:39
Definition YImage.h:38
Definition YInputField.h:47
Definition YIntField.h:39
Definition YItemSelector.h:44
Definition YLabel.h:39
Definition YLayoutBox.h:38
Definition YLogView.h:38
Definition YMenuBar.h:51
Definition YMenuButton.h:48
Definition YMultiLineEdit.h:36
Definition YMultiSelectionBox.h:37
Definition YPackageSelector.h:44
Definition YProgressBar.h:37
Definition YPushButton.h:38
Definition YRadioButtonGroup.h:42
Definition YRadioButton.h:52
Definition YReplacePoint.h:34
Definition YRichText.h:41
Definition YSelectionBox.h:57
Definition YSpacing.h:38
Definition YSquash.h:42
Definition YTableHeader.h:44
Definition YTable.h:60
Definition YTimeField.h:42
Definition YTree.h:58
virtual ~YWidgetFactory()
Definition YWidgetFactory.cc:43
YWidgetFactory()
Definition YWidgetFactory.cc:37
Definition YWidget.h:55