libyui
|
00001 /************************************************************************** 00002 Copyright (C) 2000 - 2010 Novell, Inc. 00003 All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 **************************************************************************/ 00020 00021 00022 /*---------------------------------------------------------------------\ 00023 | | 00024 | __ __ ____ _____ ____ | 00025 | \ \ / /_ _/ ___|_ _|___ \ | 00026 | \ V / _` \___ \ | | __) | | 00027 | | | (_| |___) || | / __/ | 00028 | |_|\__,_|____/ |_| |_____| | 00029 | | 00030 | core system | 00031 | (C) SuSE GmbH | 00032 \----------------------------------------------------------------------/ 00033 00034 File: YWizard.h 00035 00036 Author: Stefan Hundhammer <sh@suse.de> 00037 00038 /-*/ 00039 00040 #ifndef YWizard_h 00041 #define YWizard_h 00042 00043 #include "YWidget.h" 00044 00045 class YMacroRecorder; 00046 class YWizardPrivate; 00047 class YPushButton; 00048 class YReplacePoint; 00049 00050 #define YWizardID "wizard" 00051 #define YWizardContentsReplacePointID "contents" 00052 00053 00054 enum YWizardMode 00055 { 00056 YWizardMode_Standard, // Normal wizard (help panel or nothing) 00057 YWizardMode_Steps, // Steps visible in left side panel 00058 YWizardMode_Tree // Tree in left side panel 00059 }; 00060 00061 00107 class YWizard: public YWidget 00108 { 00109 protected: 00115 YWizard( YWidget * parent, 00116 const string & backButtonLabel, 00117 const string & abortButtonLabel, 00118 const string & nextButtonLabel, 00119 YWizardMode wizardMode = YWizardMode_Standard ); 00120 00121 public: 00122 00126 virtual ~YWizard(); 00127 00132 virtual const char * widgetClass() const { return "YWizard"; } 00133 00134 00135 // 00136 // Wizard basics 00137 // 00138 00143 YWizardMode wizardMode() const; 00144 00150 virtual YPushButton * backButton() const = 0; 00151 virtual YPushButton * abortButton() const = 0; 00152 virtual YPushButton * nextButton() const = 0; 00153 00159 virtual YReplacePoint * contentsReplacePoint() const = 0; 00160 00164 void protectNextButton( bool protect ); 00165 00170 bool nextButtonIsProtected() const; 00171 00178 virtual void setButtonLabel( YPushButton * button, const string & newLabel ); 00179 00183 virtual void setHelpText( const string & helpText ) = 0; 00184 00188 virtual void setDialogIcon( const string & iconName ) = 0; 00189 00194 virtual void setDialogTitle( const string & titleText ) = 0; 00195 00199 virtual void setDialogHeading( const string & headingText ) = 0; 00200 00201 00202 // 00203 // Steps handling 00204 // 00205 00211 virtual void addStep( const string & text, const string & id ) = 0; 00212 00218 virtual void addStepHeading( const string & text ) = 0; 00219 00224 virtual void deleteSteps() = 0; 00225 00229 virtual void setCurrentStep( const string & id ) = 0; 00230 00235 virtual void updateSteps() = 0; 00236 00237 00238 // 00239 // Tree handling 00240 // 00241 00248 virtual void addTreeItem( const string & parentID, 00249 const string & text, 00250 const string & id ) = 0; 00251 00255 virtual void selectTreeItem( const string & id ) = 0; 00256 00261 virtual string currentTreeSelection() = 0; 00262 00266 virtual void deleteTreeItems() = 0; 00267 00268 00269 // 00270 // Menu handling 00271 // 00272 00279 virtual void addMenu( const string & text, 00280 const string & id ) = 0; 00281 00285 virtual void addSubMenu( const string & parentMenuID, 00286 const string & text, 00287 const string & id ) = 0; 00288 00293 virtual void addMenuEntry( const string & parentMenuID, 00294 const string & text, 00295 const string & id ) = 0; 00296 00300 virtual void addMenuSeparator( const string & parentMenuID ) = 0; 00301 00305 virtual void deleteMenus() = 0; 00306 00312 virtual void showReleaseNotesButton( const string & label, 00313 const string & id ) = 0; 00314 00315 // 00316 // Misc 00317 // 00318 00322 virtual void hideReleaseNotesButton() = 0; 00323 00330 virtual void retranslateInternalButtons() = 0; 00331 00335 void ping(); 00336 00337 00338 // 00339 // Property handling 00340 // 00341 00348 virtual YPropertyValue getProperty( const string & propertyName ); 00349 00356 virtual const YPropertySet & propertySet(); 00357 00358 00359 private: 00360 00361 ImplPtr<YWizardPrivate> priv; 00362 }; 00363 00364 00365 #endif // YWizard_h