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 	::svt::RoadmapWizardTypes::PathId m_aDefaultPath;
66 	::svt::RoadmapWizardTypes::PathId m_aMigrationPath;
67     String m_sNext;
68     String m_sCancel;
69     sal_Bool m_bDone;
70     sal_Bool m_bLicenseNeedsAcceptance;
71     sal_Bool m_bLicenseWasAccepted;
72     sal_Bool m_bAutomaticUpdChk;
73     Link m_lnkCancel;
74     Throbber  m_aThrobber;
75 
76     rtl::OUString m_aLicensePath;
77 
78     void storeAcceptDate();
79     void setPatchLevel();
80     void disableWizard();
81     void enableQuickstart();
82 
83     DECL_LINK(DeclineHdl, PushButton*);
84 
85 	void cleanOldOfficeRegKeys();
86     sal_Bool showOnlineUpdatePage();
87     ::svt::RoadmapWizardTypes::PathId defineWizardPagesDependingFromContext();
88 
89 protected:
90     // from svt::WizardMachine
91     virtual TabPage* createPage(WizardState _nState);
92     virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
93     virtual	sal_Bool leaveState(WizardState _nState );
94 	virtual sal_Bool onFinish();
95     virtual void     enterState(WizardState _nState);
96 
97     // from svt::RoadmapWizard
98     virtual String       getStateDisplayName( WizardState _nState ) const;
99 };
100 }
101 #endif
102