libyui-ncurses
 
Loading...
Searching...
No Matches
NCWidgetFactory.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 Copyright (C) 2019 SUSE LLC
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) version 3.0 of the License. This library
8 is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11 License for more details. You should have received a copy of the GNU
12 Lesser General Public License along with this library; if not, write
13 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
14 Floor, Boston, MA 02110-1301 USA
15*/
16
17
18/*-/
19
20 File: NCWidgetFactory.h
21
22 Author: Gabriele Mohr <gs@suse.de>
23
24/-*/
25
26#ifndef NCWidgetFactory_h
27#define NCWidgetFactory_h
28
29
30#include <yui/YWidgetFactory.h>
31
32#include "NCAlignment.h"
33#include "NCBusyIndicator.h"
34#include "NCButtonBox.h"
35#include "NCCheckBox.h"
36#include "NCCheckBoxFrame.h"
37#include "NCComboBox.h"
38#include "NCCustomStatusItemSelector.h"
39#include "NCDialog.h"
40#include "NCEmpty.h"
41#include "NCFrame.h"
42#include "NCImage.h"
43#include "NCInputField.h"
44#include "NCIntField.h"
45#include "NCItemSelector.h"
46#include "NCLabel.h"
47#include "NCLogView.h"
48#include "NCMenuBar.h"
49#include "NCMenuButton.h"
50#include "NCMultiLineEdit.h"
51#include "NCMultiSelectionBox.h"
52#include "NCPackageSelectorPluginStub.h"
53#include "NCProgressBar.h"
54#include "NCPushButton.h"
55#include "NCRadioButton.h"
56#include "NCRadioButtonGroup.h"
57#include "NCReplacePoint.h"
58#include "NCRichText.h"
59#include "NCSelectionBox.h"
60#include "NCSpacing.h"
61#include "NCSquash.h"
62#include "NCTable.h"
63#include "NCTree.h"
64#include "NCLayoutBox.h"
65
66
70class NCWidgetFactory: public YWidgetFactory
71{
72public:
73 // Note: Using covariant return types for all createSomeWidget() methods
74 // (returning NCSomeWidget where the base class declares virtual methods that
75 // return YSomeWidget)
76
77
78 //
79 // Dialogs
80 //
81
82 virtual NCDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
83
84 //
85 // Layout Boxes
86 //
87
88 virtual NCLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim );
89 virtual NCButtonBox * createButtonBox ( YWidget * parent );
90
91
92 //
93 // Common Leaf Widgets
94 //
95
96 virtual NCPushButton * createPushButton ( YWidget * parent, const std::string & label );
97 virtual NCLabel * createLabel ( YWidget * parent, const std::string & text, bool isHeading = false, bool isOutputField = false );
98 virtual NCInputField * createInputField ( YWidget * parent, const std::string & label, bool passwordMode = false );
99 virtual NCCheckBox * createCheckBox ( YWidget * parent, const std::string & label, bool isChecked = false );
100 virtual NCRadioButton * createRadioButton ( YWidget * parent, const std::string & label, bool isChecked = false );
101 virtual NCComboBox * createComboBox ( YWidget * parent, const std::string & label, bool editable = false );
102 virtual NCSelectionBox * createSelectionBox ( YWidget * parent, const std::string & label );
103 virtual NCTree * createTree ( YWidget * parent, const std::string & label, bool multiselection = false, bool recursiveselection = false );
104 virtual NCTable * createTable ( YWidget * parent, YTableHeader * tableHeader, bool multiSelection = false );
105 virtual NCProgressBar * createProgressBar ( YWidget * parent, const std::string & label, int maxValue = 100 );
106 virtual NCRichText * createRichText ( YWidget * parent, const std::string & text = std::string(), bool plainTextMode = false );
107
108
109 //
110 // Less Common Leaf Widgets
111 //
112
113 virtual NCIntField * createIntField ( YWidget * parent, const std::string & label, int minVal, int maxVal, int initialVal );
114 virtual NCMenuButton * createMenuButton ( YWidget * parent, const std::string & label );
115 virtual NCMenuBar * createMenuBar ( YWidget * parent );
116 virtual NCMultiLineEdit * createMultiLineEdit ( YWidget * parent, const std::string & label );
117 virtual NCImage * createImage ( YWidget * parent, const std::string & imagePath, bool animated = false );
118 virtual NCLogView * createLogView ( YWidget * parent, const std::string & label, int visibleLines, int storedLines = 0 );
119 virtual NCMultiSelectionBox*createMultiSelectionBox ( YWidget * parent, const std::string & label );
120 virtual YPackageSelector * createPackageSelector ( YWidget * parent, long ModeFlags = 0 );
121 virtual NCBusyIndicator * createBusyIndicator ( YWidget * parent, const std::string & label, int timeout = 1000 );
122
123 // NCurses only
124 virtual YWidget * createPkgSpecial ( YWidget * parent, const std::string & subwidgetName );
125
126
127 //
128 // Layout Helpers
129 //
130
131 virtual NCSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
132 virtual NCEmpty * createEmpty ( YWidget * parent );
133 virtual NCAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
134 virtual NCSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash );
135
136
137 //
138 // Visual Grouping
139 //
140
141 virtual NCFrame * createFrame ( YWidget * parent, const std::string & label );
142 virtual NCCheckBoxFrame * createCheckBoxFrame ( YWidget * parent, const std::string & label, bool checked );
143
144
145 //
146 // Logical Grouping
147 //
148
149 virtual NCRadioButtonGroup *createRadioButtonGroup ( YWidget * parent );
150 virtual NCReplacePoint * createReplacePoint ( YWidget * parent );
151
152
153 //
154 // More leaf widgets (moved to the end to maintain ABI compatibility)
155 //
156
157 virtual NCItemSelector * createItemSelector ( YWidget * parent, bool enforceSingleSelection = true );
158 virtual NCCustomStatusItemSelector * createCustomStatusItemSelector ( YWidget * parent, const YItemCustomStatusVector & customStates );
159
160
161protected:
162
163 friend class YNCursesUI;
164
171
175 virtual ~NCWidgetFactory();
176
177}; // class NCWidgetFactory
178
179
180#endif // NCWidgetFactory_h
Definition NCAlignment.h:35
Definition NCBusyIndicator.h:42
Definition NCButtonBox.h:37
Definition NCCheckBoxFrame.h:38
Definition NCCheckBox.h:35
Definition NCComboBox.h:38
Definition NCCustomStatusItemSelector.h:82
Definition NCDialog.h:40
Definition NCEmpty.h:35
Definition NCFrame.h:37
Definition NCImage.h:37
Definition NCInputField.h:35
Definition NCIntField.h:35
Definition NCItemSelector.h:302
Definition NCLabel.h:38
Definition NCLayoutBox.h:37
Definition NCLogView.h:35
Definition NCMenuBar.h:34
Definition NCMenuButton.h:36
Definition NCMultiLineEdit.h:36
Definition NCMultiSelectionBox.h:36
Definition NCProgressBar.h:37
Definition NCPushButton.h:35
Definition NCRadioButtonGroup.h:38
Definition NCRadioButton.h:37
Definition NCReplacePoint.h:37
Definition NCRichText.h:36
Definition NCSelectionBox.h:36
Definition NCSpacing.h:37
Definition NCSquash.h:35
Definition NCTable.h:43
Definition NCTree.h:47
virtual ~NCWidgetFactory()
Definition NCWidgetFactory.cc:44
NCWidgetFactory()
Definition NCWidgetFactory.cc:37