1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _WIZARD_HXX_ 29 #define _WIZARD_HXX_ 30 31 #include <rtl/ustring.hxx> 32 #include <svtools/roadmapwizard.hxx> 33 #include <vcl/throbber.hxx> 34 #include <tools/resid.hxx> 35 36 namespace desktop 37 { 38 39 class WizardResId : public ResId 40 { 41 public: 42 WizardResId( sal_uInt16 nId ); 43 }; 44 45 class FirstStartWizard : public svt::RoadmapWizard 46 { 47 48 public: 49 static const WizardState STATE_WELCOME; 50 static const WizardState STATE_LICENSE; 51 static const WizardState STATE_MIGRATION; 52 static const WizardState STATE_USER; 53 static const WizardState STATE_UPDATE_CHECK; 54 static const WizardState STATE_REGISTRATION; 55 56 static ResMgr* pResMgr; 57 static ResMgr* GetResManager(); 58 59 FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath ); 60 61 virtual short Execute(); 62 virtual long PreNotify( NotifyEvent& rNEvt ); 63 64 void DisableButtonsWhileMigration(); 65 66 private: 67 sal_Bool m_bOverride; 68 WizardState _currentState; 69 ::svt::RoadmapWizardTypes::PathId m_aDefaultPath; 70 ::svt::RoadmapWizardTypes::PathId m_aMigrationPath; 71 String m_sNext; 72 String m_sCancel; 73 sal_Bool m_bDone; 74 sal_Bool m_bLicenseNeedsAcceptance; 75 sal_Bool m_bLicenseWasAccepted; 76 sal_Bool m_bAutomaticUpdChk; 77 Link m_lnkCancel; 78 Throbber m_aThrobber; 79 80 rtl::OUString m_aLicensePath; 81 82 void storeAcceptDate(); 83 void setPatchLevel(); 84 void disableWizard(); 85 void enableQuickstart(); 86 87 DECL_LINK(DeclineHdl, PushButton*); 88 89 void cleanOldOfficeRegKeys(); 90 sal_Bool showOnlineUpdatePage(); 91 ::svt::RoadmapWizardTypes::PathId defineWizardPagesDependingFromContext(); 92 93 protected: 94 // from svt::WizardMachine 95 virtual TabPage* createPage(WizardState _nState); 96 virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason ); 97 virtual sal_Bool leaveState(WizardState _nState ); 98 virtual sal_Bool onFinish(); 99 virtual void enterState(WizardState _nState); 100 101 // from svt::RoadmapWizard 102 virtual String getStateDisplayName( WizardState _nState ) const; 103 }; 104 } 105 #endif 106