xref: /trunk/main/desktop/source/migration/wizard.hxx (revision 0a1e2f0e)
1*0a1e2f0eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0a1e2f0eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0a1e2f0eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0a1e2f0eSAndrew Rist  * distributed with this work for additional information
6*0a1e2f0eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0a1e2f0eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0a1e2f0eSAndrew Rist  * "License"); you may not use this file except in compliance
9*0a1e2f0eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*0a1e2f0eSAndrew Rist  *
11*0a1e2f0eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*0a1e2f0eSAndrew Rist  *
13*0a1e2f0eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0a1e2f0eSAndrew Rist  * software distributed under the License is distributed on an
15*0a1e2f0eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0a1e2f0eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*0a1e2f0eSAndrew Rist  * specific language governing permissions and limitations
18*0a1e2f0eSAndrew Rist  * under the License.
19*0a1e2f0eSAndrew Rist  *
20*0a1e2f0eSAndrew Rist  *************************************************************/
21*0a1e2f0eSAndrew Rist 
22*0a1e2f0eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _WIZARD_HXX_
25cdf0e10cSrcweir #define _WIZARD_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <rtl/ustring.hxx>
28cdf0e10cSrcweir #include <svtools/roadmapwizard.hxx>
29cdf0e10cSrcweir #include <vcl/throbber.hxx>
30cdf0e10cSrcweir #include <tools/resid.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace desktop
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class WizardResId : public ResId
36cdf0e10cSrcweir {
37cdf0e10cSrcweir public:
38cdf0e10cSrcweir     WizardResId( sal_uInt16 nId );
39cdf0e10cSrcweir };
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class FirstStartWizard : public svt::RoadmapWizard
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 
44cdf0e10cSrcweir public:
45cdf0e10cSrcweir     static const WizardState STATE_WELCOME;
46cdf0e10cSrcweir     static const WizardState STATE_LICENSE;
47cdf0e10cSrcweir     static const WizardState STATE_MIGRATION;
48cdf0e10cSrcweir 	static const WizardState STATE_USER;
49cdf0e10cSrcweir 	static const WizardState STATE_UPDATE_CHECK;
50cdf0e10cSrcweir     static const WizardState STATE_REGISTRATION;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     static ResMgr* pResMgr;
53cdf0e10cSrcweir     static ResMgr* GetResManager();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     virtual short Execute();
58cdf0e10cSrcweir     virtual long PreNotify( NotifyEvent& rNEvt );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     void DisableButtonsWhileMigration();
61cdf0e10cSrcweir 
62cdf0e10cSrcweir private:
63cdf0e10cSrcweir     sal_Bool m_bOverride;
64cdf0e10cSrcweir     WizardState _currentState;
65cdf0e10cSrcweir 	::svt::RoadmapWizardTypes::PathId m_aDefaultPath;
66cdf0e10cSrcweir 	::svt::RoadmapWizardTypes::PathId m_aMigrationPath;
67cdf0e10cSrcweir     String m_sNext;
68cdf0e10cSrcweir     String m_sCancel;
69cdf0e10cSrcweir     sal_Bool m_bDone;
70cdf0e10cSrcweir     sal_Bool m_bLicenseNeedsAcceptance;
71cdf0e10cSrcweir     sal_Bool m_bLicenseWasAccepted;
72cdf0e10cSrcweir     sal_Bool m_bAutomaticUpdChk;
73cdf0e10cSrcweir     Link m_lnkCancel;
74cdf0e10cSrcweir     Throbber  m_aThrobber;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     rtl::OUString m_aLicensePath;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     void storeAcceptDate();
79cdf0e10cSrcweir     void setPatchLevel();
80cdf0e10cSrcweir     void disableWizard();
81cdf0e10cSrcweir     void enableQuickstart();
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     DECL_LINK(DeclineHdl, PushButton*);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	void cleanOldOfficeRegKeys();
86cdf0e10cSrcweir     sal_Bool showOnlineUpdatePage();
87cdf0e10cSrcweir     ::svt::RoadmapWizardTypes::PathId defineWizardPagesDependingFromContext();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir protected:
90cdf0e10cSrcweir     // from svt::WizardMachine
91cdf0e10cSrcweir     virtual TabPage* createPage(WizardState _nState);
92cdf0e10cSrcweir     virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
93cdf0e10cSrcweir     virtual	sal_Bool leaveState(WizardState _nState );
94cdf0e10cSrcweir 	virtual sal_Bool onFinish();
95cdf0e10cSrcweir     virtual void     enterState(WizardState _nState);
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     // from svt::RoadmapWizard
98cdf0e10cSrcweir     virtual String       getStateDisplayName( WizardState _nState ) const;
99cdf0e10cSrcweir };
100cdf0e10cSrcweir }
101cdf0e10cSrcweir #endif
102