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