libyui-qt
2.43.5
|
00001 /* 00002 Copyright (C) 2000-2012 Novell, Inc 00003 This library is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU Lesser General Public License as 00005 published by the Free Software Foundation; either version 2.1 of the 00006 License, or (at your option) version 3.0 of the License. This library 00007 is distributed in the hope that it will be useful, but WITHOUT ANY 00008 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00010 License for more details. You should have received a copy of the GNU 00011 Lesser General Public License along with this library; if not, write 00012 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00013 Floor, Boston, MA 02110-1301 USA 00014 */ 00015 00016 00017 /*-/ 00018 00019 File: YQWidgetFactory.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 #ifndef YQWidgetFactory_h 00026 #define YQWidgetFactory_h 00027 00028 00029 #include <yui/YWidgetFactory.h> 00030 00031 #include "YQAlignment.h" 00032 #include "YQButtonBox.h" 00033 #include "YQCheckBox.h" 00034 #include "YQCheckBoxFrame.h" 00035 #include "YQComboBox.h" 00036 #include "YQDialog.h" 00037 #include "YQEmpty.h" 00038 #include "YQFrame.h" 00039 #include "YQImage.h" 00040 #include "YQInputField.h" 00041 #include "YQIntField.h" 00042 #include "YQLabel.h" 00043 #include "YQLayoutBox.h" 00044 #include "YQLogView.h" 00045 #include "YQMenuButton.h" 00046 #include "YQMultiLineEdit.h" 00047 #include "YQMultiSelectionBox.h" 00048 #include "YQProgressBar.h" 00049 #include "YQPushButton.h" 00050 #include "YQRadioButton.h" 00051 #include "YQRadioButtonGroup.h" 00052 #include "YQReplacePoint.h" 00053 #include "YQRichText.h" 00054 #include "YQSelectionBox.h" 00055 #include "YQSpacing.h" 00056 #include "YQSquash.h" 00057 #include "YQTable.h" 00058 #include "YQTimeField.h" 00059 #include "YQTree.h" 00060 #include "YQBusyIndicator.h" 00061 00062 using std::string; 00063 00064 00065 /** 00066 * Concrete widget factory for mandatory widgets. 00067 **/ 00068 class YQWidgetFactory: public YWidgetFactory 00069 { 00070 public: 00071 // Note: Using covariant return types for all createSomeWidget() methods 00072 // (returning YQSomeWidget where the base class declares virtual methods that 00073 // return YSomeWidget) 00074 00075 00076 // 00077 // Dialogs 00078 // 00079 00080 virtual YQDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor ); 00081 00082 // 00083 // Layout Boxes 00084 // 00085 00086 virtual YQLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim ); 00087 virtual YQButtonBox * createButtonBox ( YWidget * parent ); 00088 00089 // 00090 // Common Leaf Widgets 00091 // 00092 00093 virtual YQPushButton * createPushButton ( YWidget * parent, const std::string & label ); 00094 virtual YQLabel * createLabel ( YWidget * parent, const std::string & text, bool isHeading = false, bool isOutputField = false ); 00095 virtual YQInputField * createInputField ( YWidget * parent, const std::string & label, bool passwordMode = false ); 00096 virtual YQCheckBox * createCheckBox ( YWidget * parent, const std::string & label, bool isChecked = false ); 00097 virtual YQRadioButton * createRadioButton ( YWidget * parent, const std::string & label, bool isChecked = false ); 00098 virtual YQComboBox * createComboBox ( YWidget * parent, const std::string & label, bool editable = false ); 00099 virtual YQSelectionBox * createSelectionBox ( YWidget * parent, const std::string & label ); 00100 virtual YQTree * createTree ( YWidget * parent, const std::string & label, bool multiselection = false, bool recursiveselection = false ); 00101 virtual YQTable * createTable ( YWidget * parent, YTableHeader * header, bool multiSelection = false ); 00102 virtual YQProgressBar * createProgressBar ( YWidget * parent, const std::string & label, int maxValue = 100 ); 00103 virtual YQRichText * createRichText ( YWidget * parent, const std::string & text = std::string(), bool plainTextMode = false ); 00104 00105 // 00106 // Less Common Leaf Widgets 00107 // 00108 00109 virtual YQIntField * createIntField ( YWidget * parent, const std::string & label, int minVal, int maxVal, int initialVal ); 00110 virtual YQMenuButton * createMenuButton ( YWidget * parent, const std::string & label ); 00111 virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const std::string & label ); 00112 virtual YQImage * createImage ( YWidget * parent, const std::string & imageFileName, bool animated = false ); 00113 virtual YQLogView * createLogView ( YWidget * parent, const std::string & label, int visibleLines, int storedLines = 0 ); 00114 virtual YQMultiSelectionBox *createMultiSelectionBox( YWidget * parent, const std::string & label ); 00115 virtual YQBusyIndicator * createBusyIndicator ( YWidget * parent, const std::string & label, int maxValue = 100 ); 00116 00117 virtual YPackageSelector * createPackageSelector ( YWidget * parent, long modeFlags = 0 ); 00118 virtual YWidget * createPkgSpecial ( YWidget * parent, const std::string & name ); // NCurses only, will throw exception in the Qt UI 00119 00120 // 00121 // Layout Helpers 00122 // 00123 00124 virtual YQSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 ); 00125 virtual YQEmpty * createEmpty ( YWidget * parent ); 00126 virtual YQAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment ); 00127 virtual YQSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash ); 00128 00129 // 00130 // Visual Grouping 00131 // 00132 00133 virtual YQFrame * createFrame ( YWidget * parent, const std::string & label ); 00134 virtual YQCheckBoxFrame * createCheckBoxFrame ( YWidget * parent, const std::string & label, bool checked ); 00135 00136 // 00137 // Logical Grouping 00138 // 00139 00140 virtual YQRadioButtonGroup *createRadioButtonGroup ( YWidget * parent ); 00141 virtual YQReplacePoint * createReplacePoint ( YWidget * parent ); 00142 00143 00144 protected: 00145 00146 friend class YQUI; 00147 00148 /** 00149 * Constructor. 00150 * 00151 * Use YUI::widgetFactory() to get the singleton for this class. 00152 **/ 00153 YQWidgetFactory(); 00154 00155 /** 00156 * Destructor. 00157 **/ 00158 virtual ~YQWidgetFactory(); 00159 00160 }; // class YWidgetFactory 00161 00162 00163 #endif // YQWidgetFactory_h