libyui-ncurses  2.44.1
/usr/src/RPM/BUILD/libyui-ncurses-2.44.1/src/NCWidgetFactory.h
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:         NCWidgetFactory.h
00020 
00021   Author:       Gabriele Mohr <gs@suse.de>
00022 
00023 /-*/
00024 
00025 #ifndef NCWidgetFactory_h
00026 #define NCWidgetFactory_h
00027 
00028 
00029 #include <yui/YWidgetFactory.h>
00030 
00031 #include "NCAlignment.h"
00032 #include "NCBusyIndicator.h"
00033 #include "NCButtonBox.h"
00034 #include "NCCheckBox.h"
00035 #include "NCCheckBoxFrame.h"
00036 #include "NCComboBox.h"
00037 #include "NCDialog.h"
00038 #include "NCEmpty.h"
00039 #include "NCFrame.h"
00040 #include "NCImage.h"
00041 #include "NCInputField.h"
00042 #include "NCIntField.h"
00043 #include "NCLabel.h"
00044 #include "NCLogView.h"
00045 #include "NCMenuButton.h"
00046 #include "NCMultiLineEdit.h"
00047 #include "NCMultiSelectionBox.h"
00048 #include "NCPackageSelectorPluginStub.h"
00049 #include "NCProgressBar.h"
00050 #include "NCPushButton.h"
00051 #include "NCRadioButton.h"
00052 #include "NCRadioButtonGroup.h"
00053 #include "NCReplacePoint.h"
00054 #include "NCRichText.h"
00055 #include "NCSelectionBox.h"
00056 #include "NCSpacing.h"
00057 #include "NCSquash.h"
00058 #include "NCTable.h"
00059 #include "NCTree.h"
00060 #include "NCLayoutBox.h"
00061 
00062 
00063 /**
00064  * Concrete widget factory for mandatory widgets.
00065  **/
00066 class NCWidgetFactory: public YWidgetFactory
00067 {
00068 public:
00069     // Note: Using covariant return types for all createSomeWidget() methods
00070     // (returning NCSomeWidget where the base class declares virtual methods that
00071     // return YSomeWidget)
00072 
00073 
00074     //
00075     // Dialogs
00076     //
00077 
00078     virtual NCDialog *          createDialog            ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
00079 
00080     //
00081     // Layout Boxes
00082     //
00083 
00084     virtual NCLayoutBox *       createLayoutBox         ( YWidget * parent, YUIDimension dim );
00085     virtual NCButtonBox *       createButtonBox         ( YWidget * parent );
00086 
00087 
00088     //
00089     // Common Leaf Widgets
00090     //
00091 
00092     virtual NCPushButton *      createPushButton        ( YWidget * parent, const std::string & label );
00093     virtual NCLabel *           createLabel             ( YWidget * parent, const std::string & text,  bool isHeading    = false, bool isOutputField = false );
00094     virtual NCInputField *      createInputField        ( YWidget * parent, const std::string & label, bool passwordMode = false );
00095     virtual NCCheckBox *        createCheckBox          ( YWidget * parent, const std::string & label, bool isChecked    = false );
00096     virtual NCRadioButton *     createRadioButton       ( YWidget * parent, const std::string & label, bool isChecked    = false );
00097     virtual NCComboBox *        createComboBox          ( YWidget * parent, const std::string & label, bool editable     = false );
00098     virtual NCSelectionBox *    createSelectionBox      ( YWidget * parent, const std::string & label );
00099     virtual NCTree *            createTree              ( YWidget * parent, const std::string & label, bool multiselection = false, bool recursiveselection = false );
00100     virtual NCTable *           createTable             ( YWidget * parent, YTableHeader * tableHeader, bool multiSelection = false );
00101     virtual NCProgressBar *     createProgressBar       ( YWidget * parent, const std::string & label, int maxValue = 100 );
00102     virtual NCRichText *        createRichText          ( YWidget * parent, const std::string & text = std::string(), bool plainTextMode = false );
00103 
00104 
00105     //
00106     // Less Common Leaf Widgets
00107     //
00108 
00109     virtual NCIntField *        createIntField          ( YWidget * parent, const std::string & label, int minVal, int maxVal, int initialVal );
00110     virtual NCMenuButton *      createMenuButton        ( YWidget * parent, const std::string & label );
00111     virtual NCMultiLineEdit *   createMultiLineEdit     ( YWidget * parent, const std::string & label );
00112     virtual NCImage *           createImage             ( YWidget * parent, const std::string & imagePath, bool animated = false );
00113     virtual NCLogView *         createLogView           ( YWidget * parent, const std::string & label, int visibleLines, int storedLines = 0 );
00114     virtual NCMultiSelectionBox*createMultiSelectionBox ( YWidget * parent, const std::string & label );
00115     virtual YPackageSelector *  createPackageSelector   ( YWidget * parent, long ModeFlags = 0 );
00116     virtual NCBusyIndicator *   createBusyIndicator     ( YWidget * parent, const std::string & label, int timeout = 1000 );
00117 
00118     // NCurses only
00119     virtual YWidget *           createPkgSpecial        ( YWidget * parent,  const std::string & subwidgetName );
00120 
00121 
00122     //
00123     // Layout Helpers
00124     //
00125 
00126     virtual NCSpacing *         createSpacing           ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
00127     virtual NCEmpty *           createEmpty             ( YWidget * parent );
00128     virtual NCAlignment *       createAlignment         ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
00129     virtual NCSquash *          createSquash            ( YWidget * parent, bool horSquash, bool vertSquash );
00130 
00131 
00132     //
00133     // Visual Grouping
00134     //
00135 
00136     virtual NCFrame *           createFrame             ( YWidget * parent, const std::string & label );
00137     virtual NCCheckBoxFrame *   createCheckBoxFrame     ( YWidget * parent, const std::string & label, bool checked );
00138 
00139 
00140     //
00141     // Logical Grouping
00142     //
00143 
00144     virtual NCRadioButtonGroup *createRadioButtonGroup  ( YWidget * parent );
00145     virtual NCReplacePoint *    createReplacePoint      ( YWidget * parent );
00146 
00147 
00148 protected:
00149 
00150     friend class YNCursesUI;
00151 
00152     /**
00153      * Constructor.
00154      *
00155      * Use YUI::widgetFactory() to get the singleton for this class.
00156      **/
00157     NCWidgetFactory();
00158 
00159     /**
00160      * Destructor.
00161      **/
00162     virtual ~NCWidgetFactory();
00163 
00164 }; // class NCWidgetFactory
00165 
00166 
00167 #endif // NCWidgetFactory_h
 All Classes Functions Variables