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 DBACCESS_MACROMIGRATIONPAGES_HXX
29*cdf0e10cSrcweir #define DBACCESS_MACROMIGRATIONPAGES_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "migrationprogress.hxx"
32*cdf0e10cSrcweir #include "rangeprogressbar.hxx"
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <svtools/svmedit.hxx>
35*cdf0e10cSrcweir #include <svtools/urlcontrol.hxx>
36*cdf0e10cSrcweir #include <svtools/wizardmachine.hxx>
37*cdf0e10cSrcweir #include <svx/databaselocationinput.hxx>
38*cdf0e10cSrcweir #include <vcl/fixed.hxx>
39*cdf0e10cSrcweir #include <vcl/edit.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir namespace svt
42*cdf0e10cSrcweir {
43*cdf0e10cSrcweir     class RoadmapWizard;
44*cdf0e10cSrcweir }
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir //........................................................................
47*cdf0e10cSrcweir namespace dbmm
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir //........................................................................
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir     class MacroMigrationDialog;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir 	//====================================================================
54*cdf0e10cSrcweir 	//= MacroMigrationPage
55*cdf0e10cSrcweir 	//====================================================================
56*cdf0e10cSrcweir     typedef ::svt::OWizardPage  MacroMigrationPage_Base;
57*cdf0e10cSrcweir     class MacroMigrationPage : public MacroMigrationPage_Base
58*cdf0e10cSrcweir 	{
59*cdf0e10cSrcweir     public:
60*cdf0e10cSrcweir         MacroMigrationPage( MacroMigrationDialog& _rParentDialog, const ResId& _rRes );
61*cdf0e10cSrcweir         ~MacroMigrationPage();
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir     protected:
64*cdf0e10cSrcweir         const MacroMigrationDialog& getDialog() const;
65*cdf0e10cSrcweir               MacroMigrationDialog& getDialog()      ;
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir     protected:
68*cdf0e10cSrcweir         FixedText   m_aHeader;
69*cdf0e10cSrcweir 	};
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 	//====================================================================
72*cdf0e10cSrcweir 	//= PreparationPage
73*cdf0e10cSrcweir 	//====================================================================
74*cdf0e10cSrcweir     class PreparationPage : public MacroMigrationPage
75*cdf0e10cSrcweir     {
76*cdf0e10cSrcweir     public:
77*cdf0e10cSrcweir         PreparationPage( MacroMigrationDialog& _rParentDialog );
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir         static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     public:
82*cdf0e10cSrcweir         void    showCloseDocsError( bool _bShow );
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir     protected:
85*cdf0e10cSrcweir         FixedText   m_aIntroduction;
86*cdf0e10cSrcweir         FixedText   m_aCloseDocError;
87*cdf0e10cSrcweir     };
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir 	//====================================================================
90*cdf0e10cSrcweir 	//= SaveDBDocPage
91*cdf0e10cSrcweir 	//====================================================================
92*cdf0e10cSrcweir     class SaveDBDocPage : public MacroMigrationPage
93*cdf0e10cSrcweir     {
94*cdf0e10cSrcweir     public:
95*cdf0e10cSrcweir         SaveDBDocPage( MacroMigrationDialog& _rParentDialog );
96*cdf0e10cSrcweir         static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir     public:
99*cdf0e10cSrcweir         ::rtl::OUString getBackupLocation() const { return m_aLocationController.getURL(); }
100*cdf0e10cSrcweir         void            grabLocationFocus() { m_aSaveAsLocation.GrabFocus(); }
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir     protected:
103*cdf0e10cSrcweir         FixedText               m_aExplanation;
104*cdf0e10cSrcweir         FixedText               m_aSaveAsLabel;
105*cdf0e10cSrcweir 		::svt::OFileURLControl	m_aSaveAsLocation;
106*cdf0e10cSrcweir         PushButton              m_aBrowseSaveAsLocation;
107*cdf0e10cSrcweir         FixedText               m_aStartMigration;
108*cdf0e10cSrcweir         ::svx::DatabaseLocationInputController
109*cdf0e10cSrcweir                                 m_aLocationController;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     protected:
112*cdf0e10cSrcweir         // IWizardPageController overridables
113*cdf0e10cSrcweir 		virtual void        initializePage();
114*cdf0e10cSrcweir         virtual sal_Bool    commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
115*cdf0e10cSrcweir 		virtual bool        canAdvance() const;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir     private:
118*cdf0e10cSrcweir         DECL_LINK( OnLocationModified, Edit* );
119*cdf0e10cSrcweir         void impl_updateLocationDependentItems();
120*cdf0e10cSrcweir     };
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	//====================================================================
123*cdf0e10cSrcweir 	//= ProgressPage
124*cdf0e10cSrcweir 	//====================================================================
125*cdf0e10cSrcweir     class ProgressPage : public MacroMigrationPage, public IMigrationProgress
126*cdf0e10cSrcweir     {
127*cdf0e10cSrcweir     public:
128*cdf0e10cSrcweir         ProgressPage( MacroMigrationDialog& _rParentDialog );
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir         static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir         void    setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports );
133*cdf0e10cSrcweir         void    onFinishedSuccessfully();
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir     protected:
136*cdf0e10cSrcweir         // IMigrationProgress
137*cdf0e10cSrcweir         virtual void    startObject( const ::rtl::OUString& _rObjectName, const ::rtl::OUString& _rCurrentAction, const sal_uInt32 _bRange );
138*cdf0e10cSrcweir         virtual void    setObjectProgressText( const ::rtl::OUString& _rText );
139*cdf0e10cSrcweir         virtual void    setObjectProgressValue( const sal_uInt32 _nValue );
140*cdf0e10cSrcweir         virtual void    endObject();
141*cdf0e10cSrcweir         virtual void    start( const sal_uInt32 _nOverallRange );
142*cdf0e10cSrcweir         virtual void    setOverallProgressText( const ::rtl::OUString& _rText );
143*cdf0e10cSrcweir         virtual void    setOverallProgressValue( const sal_uInt32 _nValue );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     private:
146*cdf0e10cSrcweir         FixedText           m_aObjectCount;
147*cdf0e10cSrcweir         FixedText           m_aCurrentObjectLabel;
148*cdf0e10cSrcweir         FixedText           m_aCurrentObject;
149*cdf0e10cSrcweir         FixedText           m_aCurrentActionLabel;
150*cdf0e10cSrcweir         FixedText           m_aCurrentAction;
151*cdf0e10cSrcweir         RangeProgressBar    m_aCurrentProgress;
152*cdf0e10cSrcweir         FixedText           m_aAllProgressLabel;
153*cdf0e10cSrcweir         FixedText           m_aAllProgressText;
154*cdf0e10cSrcweir         RangeProgressBar    m_aAllProgress;
155*cdf0e10cSrcweir         FixedText           m_aMigrationDone;
156*cdf0e10cSrcweir     };
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	//====================================================================
159*cdf0e10cSrcweir 	//= ResultPage
160*cdf0e10cSrcweir 	//====================================================================
161*cdf0e10cSrcweir     class ResultPage : public MacroMigrationPage
162*cdf0e10cSrcweir     {
163*cdf0e10cSrcweir     public:
164*cdf0e10cSrcweir         ResultPage( MacroMigrationDialog& _rParentDialog );
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir         static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir         void            displayMigrationLog( const bool _bSuccessful, const String& _rLog );
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir     private:
171*cdf0e10cSrcweir         FixedText       m_aChangesLabel;
172*cdf0e10cSrcweir         MultiLineEdit   m_aChanges;
173*cdf0e10cSrcweir         String          m_aSuccessful;
174*cdf0e10cSrcweir         String          m_aUnsuccessful;
175*cdf0e10cSrcweir     };
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir //........................................................................
178*cdf0e10cSrcweir } // namespace dbmm
179*cdf0e10cSrcweir //........................................................................
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir #endif // DBACCESS_MACROMIGRATIONPAGES_HXX
182