1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
21 #define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
23 #include "migrationprogress.hxx"
24 #include "rangeprogressbar.hxx"
26 #include <svtools/svmedit.hxx>
27 #include <svtools/urlcontrol.hxx>
28 #include <svtools/wizardmachine.hxx>
29 #include <svx/databaselocationinput.hxx>
30 #include <vcl/fixed.hxx>
31 #include <vcl/edit.hxx>
41 class MacroMigrationDialog
;
44 typedef ::svt::OWizardPage MacroMigrationPage_Base
;
45 class MacroMigrationPage
: public MacroMigrationPage_Base
48 MacroMigrationPage(vcl::Window
*pParent
, const OString
& rID
, const OUString
& rUIXMLDescription
);
51 const MacroMigrationDialog
& getDialog() const;
52 MacroMigrationDialog
& getDialog();
56 class PreparationPage
: public MacroMigrationPage
59 PreparationPage(vcl::Window
*pParent
);
60 virtual ~PreparationPage();
61 virtual void dispose() SAL_OVERRIDE
;
63 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
66 void showCloseDocsError(bool _bShow
);
69 VclPtr
<FixedText
> m_pCloseDocError
;
73 class SaveDBDocPage
: public MacroMigrationPage
76 SaveDBDocPage(MacroMigrationDialog
& _rParentDialog
);
77 virtual ~SaveDBDocPage();
78 virtual void dispose() SAL_OVERRIDE
;
79 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
82 OUString
getBackupLocation() const { return m_pLocationController
->getURL(); }
83 void grabLocationFocus() { m_pSaveAsLocation
->GrabFocus(); }
86 VclPtr
< ::svt::OFileURLControl
> m_pSaveAsLocation
;
87 VclPtr
<PushButton
> m_pBrowseSaveAsLocation
;
88 VclPtr
<FixedText
> m_pStartMigration
;
89 svx::DatabaseLocationInputController
* m_pLocationController
;
92 // IWizardPageController overridables
93 virtual void initializePage() SAL_OVERRIDE
;
94 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason
) SAL_OVERRIDE
;
95 virtual bool canAdvance() const SAL_OVERRIDE
;
98 DECL_LINK( OnLocationModified
, Edit
* );
99 void impl_updateLocationDependentItems();
103 class ProgressPage
: public MacroMigrationPage
, public IMigrationProgress
106 ProgressPage(vcl::Window
*pParent
);
107 virtual ~ProgressPage();
108 virtual void dispose() SAL_OVERRIDE
;
110 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
112 void setDocumentCounts( const sal_Int32 _nForms
, const sal_Int32 _nReports
);
113 void onFinishedSuccessfully();
116 // IMigrationProgress
117 virtual void startObject( const OUString
& _rObjectName
, const OUString
& _rCurrentAction
, const sal_uInt32 _bRange
) SAL_OVERRIDE
;
118 virtual void setObjectProgressText( const OUString
& _rText
) SAL_OVERRIDE
;
119 virtual void setObjectProgressValue( const sal_uInt32 _nValue
) SAL_OVERRIDE
;
120 virtual void endObject() SAL_OVERRIDE
;
121 virtual void start( const sal_uInt32 _nOverallRange
) SAL_OVERRIDE
;
122 virtual void setOverallProgressText( const OUString
& _rText
) SAL_OVERRIDE
;
123 virtual void setOverallProgressValue( const sal_uInt32 _nValue
) SAL_OVERRIDE
;
126 VclPtr
<FixedText
> m_pObjectCount
;
127 VclPtr
<FixedText
> m_pCurrentObject
;
128 VclPtr
<FixedText
> m_pCurrentAction
;
129 RangeProgressBar m_aCurrentProgress
;
130 VclPtr
<FixedText
> m_pAllProgressText
;
131 RangeProgressBar m_aAllProgress
;
132 VclPtr
<FixedText
> m_pMigrationDone
;
136 class ResultPage
: public MacroMigrationPage
139 ResultPage(vcl::Window
*pParent
);
140 virtual ~ResultPage();
141 virtual void dispose() SAL_OVERRIDE
;
143 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
145 void displayMigrationLog( const bool _bSuccessful
, const OUString
& _rLog
);
148 VclPtr
<FixedText
> m_pSuccessLabel
;
149 VclPtr
<FixedText
> m_pFailureLabel
;
150 VclPtr
<VclMultiLineEdit
> m_pChanges
;
155 #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */