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