xref: /aoo41x/main/desktop/source/migration/pages.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _PAGES_HXX_
29*cdf0e10cSrcweir #define _PAGES_HXX_
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <vcl/tabpage.hxx>
32*cdf0e10cSrcweir #include <vcl/button.hxx>
33*cdf0e10cSrcweir #include <vcl/dialog.hxx>
34*cdf0e10cSrcweir #include <vcl/scrbar.hxx>
35*cdf0e10cSrcweir #include <vcl/throbber.hxx>
36*cdf0e10cSrcweir #include <svtools/wizardmachine.hxx>
37*cdf0e10cSrcweir #include <svtools/svmedit.hxx>
38*cdf0e10cSrcweir #include <svl/lstner.hxx>
39*cdf0e10cSrcweir #include <svtools/xtextedt.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir namespace desktop
42*cdf0e10cSrcweir {
43*cdf0e10cSrcweir class WelcomePage : public svt::OWizardPage
44*cdf0e10cSrcweir {
45*cdf0e10cSrcweir private:
46*cdf0e10cSrcweir     FixedText m_ftHead;
47*cdf0e10cSrcweir     FixedText m_ftBody;
48*cdf0e10cSrcweir     svt::OWizardMachine *m_pParent;
49*cdf0e10cSrcweir     sal_Bool m_bLicenseNeedsAcceptance;
50*cdf0e10cSrcweir     enum OEMType
51*cdf0e10cSrcweir     {
52*cdf0e10cSrcweir         OEM_NONE, OEM_NORMAL, OEM_EXTENDED
53*cdf0e10cSrcweir     };
54*cdf0e10cSrcweir     bool bIsEvalVersion;
55*cdf0e10cSrcweir     bool bNoEvalText;
56*cdf0e10cSrcweir     void checkEval();
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir public:
60*cdf0e10cSrcweir     WelcomePage( svt::OWizardMachine* parent, const ResId& resid, sal_Bool bLicenseNeedsAcceptance );
61*cdf0e10cSrcweir protected:
62*cdf0e10cSrcweir     virtual void ActivatePage();
63*cdf0e10cSrcweir };
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir class LicenseView : public MultiLineEdit, public SfxListener
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir     sal_Bool            mbEndReached;
68*cdf0e10cSrcweir     Link            maEndReachedHdl;
69*cdf0e10cSrcweir     Link            maScrolledHdl;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir public:
72*cdf0e10cSrcweir     LicenseView( Window* pParent, const ResId& rResId );
73*cdf0e10cSrcweir     ~LicenseView();
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir     void ScrollDown( ScrollType eScroll );
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir     sal_Bool IsEndReached() const;
78*cdf0e10cSrcweir     sal_Bool EndReached() const { return mbEndReached; }
79*cdf0e10cSrcweir     void SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     void SetEndReachedHdl( const Link& rHdl )  { maEndReachedHdl = rHdl; }
82*cdf0e10cSrcweir     const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     void SetScrolledHdl( const Link& rHdl )  { maScrolledHdl = rHdl; }
85*cdf0e10cSrcweir     const Link& GetScrolledHdl() const { return maScrolledHdl; }
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir protected:
90*cdf0e10cSrcweir     using MultiLineEdit::Notify;
91*cdf0e10cSrcweir };
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir class LicensePage : public svt::OWizardPage
94*cdf0e10cSrcweir {
95*cdf0e10cSrcweir private:
96*cdf0e10cSrcweir     svt::OWizardMachine *m_pParent;
97*cdf0e10cSrcweir     FixedText m_ftHead;
98*cdf0e10cSrcweir     FixedText m_ftBody1;
99*cdf0e10cSrcweir     FixedText m_ftBody1Txt;
100*cdf0e10cSrcweir     FixedText m_ftBody2;
101*cdf0e10cSrcweir     FixedText m_ftBody2Txt;
102*cdf0e10cSrcweir     LicenseView m_mlLicense;
103*cdf0e10cSrcweir     PushButton m_pbDown;
104*cdf0e10cSrcweir     sal_Bool m_bLicenseRead;
105*cdf0e10cSrcweir public:
106*cdf0e10cSrcweir     LicensePage( svt::OWizardMachine* parent, const ResId& resid, const rtl::OUString &rLicensePath );
107*cdf0e10cSrcweir private:
108*cdf0e10cSrcweir     DECL_LINK(PageDownHdl, PushButton*);
109*cdf0e10cSrcweir     DECL_LINK(EndReachedHdl, LicenseView*);
110*cdf0e10cSrcweir     DECL_LINK(ScrolledHdl, LicenseView*);
111*cdf0e10cSrcweir protected:
112*cdf0e10cSrcweir     virtual bool canAdvance() const;
113*cdf0e10cSrcweir     virtual void ActivatePage();
114*cdf0e10cSrcweir };
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir class MigrationPage : public svt::OWizardPage
117*cdf0e10cSrcweir {
118*cdf0e10cSrcweir private:
119*cdf0e10cSrcweir     FixedText m_ftHead;
120*cdf0e10cSrcweir     FixedText m_ftBody;
121*cdf0e10cSrcweir     CheckBox  m_cbMigration;
122*cdf0e10cSrcweir     Throbber& m_rThrobber;
123*cdf0e10cSrcweir     sal_Bool m_bMigrationDone;
124*cdf0e10cSrcweir public:
125*cdf0e10cSrcweir     MigrationPage( svt::OWizardMachine* parent, const ResId& resid, Throbber& i_throbber );
126*cdf0e10cSrcweir     virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir protected:
129*cdf0e10cSrcweir     virtual void ActivatePage();
130*cdf0e10cSrcweir };
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir class UserPage : public svt::OWizardPage
133*cdf0e10cSrcweir {
134*cdf0e10cSrcweir private:
135*cdf0e10cSrcweir     FixedText m_ftHead;
136*cdf0e10cSrcweir     FixedText m_ftBody;
137*cdf0e10cSrcweir     FixedText m_ftFirst;
138*cdf0e10cSrcweir     Edit m_edFirst;
139*cdf0e10cSrcweir 	FixedText m_ftLast;
140*cdf0e10cSrcweir 	Edit m_edLast;
141*cdf0e10cSrcweir 	FixedText m_ftInitials;
142*cdf0e10cSrcweir 	Edit m_edInitials;
143*cdf0e10cSrcweir 	FixedText m_ftFather;
144*cdf0e10cSrcweir 	Edit m_edFather;
145*cdf0e10cSrcweir     LanguageType m_lang;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir public:
148*cdf0e10cSrcweir     UserPage( svt::OWizardMachine* parent, const ResId& resid);
149*cdf0e10cSrcweir     virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
150*cdf0e10cSrcweir protected:
151*cdf0e10cSrcweir     virtual void ActivatePage();
152*cdf0e10cSrcweir };
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir class UpdateCheckPage : public svt::OWizardPage
155*cdf0e10cSrcweir {
156*cdf0e10cSrcweir private:
157*cdf0e10cSrcweir     FixedText m_ftHead;
158*cdf0e10cSrcweir     FixedText m_ftBody;
159*cdf0e10cSrcweir     CheckBox m_cbUpdateCheck;
160*cdf0e10cSrcweir public:
161*cdf0e10cSrcweir     UpdateCheckPage( svt::OWizardMachine* parent, const ResId& resid);
162*cdf0e10cSrcweir     virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir protected:
165*cdf0e10cSrcweir     virtual void ActivatePage();
166*cdf0e10cSrcweir };
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir class RegistrationPage : public svt::OWizardPage
170*cdf0e10cSrcweir {
171*cdf0e10cSrcweir private:
172*cdf0e10cSrcweir     FixedText   m_ftHeader;
173*cdf0e10cSrcweir     FixedText   m_ftBody;
174*cdf0e10cSrcweir     RadioButton m_rbNow;
175*cdf0e10cSrcweir     RadioButton m_rbLater;
176*cdf0e10cSrcweir     RadioButton m_rbNever;
177*cdf0e10cSrcweir     FixedLine   m_flSeparator;
178*cdf0e10cSrcweir     FixedText   m_ftEnd;
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir     sal_Bool    m_bNeverVisible;
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     void updateButtonStates();
183*cdf0e10cSrcweir     void impl_retrieveConfigurationData();
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir protected:
186*cdf0e10cSrcweir     virtual bool canAdvance() const;
187*cdf0e10cSrcweir     virtual void ActivatePage();
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir     virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir public:
192*cdf0e10cSrcweir     RegistrationPage( Window* parent, const ResId& resid);
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir     enum RegistrationMode
195*cdf0e10cSrcweir     {
196*cdf0e10cSrcweir         rmNow,      // register now
197*cdf0e10cSrcweir         rmLater,    // register later
198*cdf0e10cSrcweir         rmNever     // register never
199*cdf0e10cSrcweir     };
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir     RegistrationMode    getRegistrationMode() const;
202*cdf0e10cSrcweir     void                prepareSingleMode();
203*cdf0e10cSrcweir     inline String       getSingleModeTitle() const { return m_ftHeader.GetText(); }
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir     static bool         hasReminderDateCome();
206*cdf0e10cSrcweir     static void         executeSingleMode();
207*cdf0e10cSrcweir };
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir } // namespace desktop
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir #endif // #ifndef _PAGES_HXX_
212*cdf0e10cSrcweir 
213