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