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