1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pages.hxx,v $
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 ************************************************************************/
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>
46 class WelcomePage
: public svt::OWizardPage
51 svt::OWizardMachine
*m_pParent
;
52 sal_Bool m_bLicenseNeedsAcceptance
;
55 OEM_NONE
, OEM_NORMAL
, OEM_EXTENDED
64 WelcomePage( svt::OWizardMachine
* parent
, const ResId
& resid
, sal_Bool bLicenseNeedsAcceptance
);
66 virtual void ActivatePage();
69 class LicenseView
: public MultiLineEdit
, public SfxListener
76 LicenseView( Window
* pParent
, const ResId
& rResId
);
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
);
94 using MultiLineEdit::Notify
;
97 class LicensePage
: public svt::OWizardPage
100 svt::OWizardMachine
*m_pParent
;
103 FixedText m_ftBody1Txt
;
105 FixedText m_ftBody2Txt
;
106 LicenseView m_mlLicense
;
108 sal_Bool m_bLicenseRead
;
110 LicensePage( svt::OWizardMachine
* parent
, const ResId
& resid
, const rtl::OUString
&rLicensePath
);
112 DECL_LINK(PageDownHdl
, PushButton
*);
113 DECL_LINK(EndReachedHdl
, LicenseView
*);
114 DECL_LINK(ScrolledHdl
, LicenseView
*);
116 virtual bool canAdvance() const;
117 virtual void ActivatePage();
120 class MigrationPage
: public svt::OWizardPage
125 CheckBox m_cbMigration
;
126 sal_Bool m_bMigrationDone
;
128 MigrationPage( svt::OWizardMachine
* parent
, const ResId
& resid
);
129 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
132 virtual void ActivatePage();
135 class UserPage
: public svt::OWizardPage
144 FixedText m_ftInitials
;
146 FixedText m_ftFather
;
151 UserPage( svt::OWizardMachine
* parent
, const ResId
& resid
);
152 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
154 virtual void ActivatePage();
157 class UpdateCheckPage
: public svt::OWizardPage
162 CheckBox m_cbUpdateCheck
;
164 UpdateCheckPage( svt::OWizardMachine
* parent
, const ResId
& resid
);
165 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
168 virtual void ActivatePage();
172 class RegistrationPage
: public svt::OWizardPage
175 FixedText m_ftHeader
;
178 RadioButton m_rbLater
;
179 RadioButton m_rbNever
;
180 FixedLine m_flSeparator
;
183 sal_Bool m_bNeverVisible
;
185 void updateButtonStates();
186 void impl_retrieveConfigurationData();
189 virtual bool canAdvance() const;
190 virtual void ActivatePage();
192 virtual sal_Bool
commitPage( CommitPageReason _eReason
);
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_