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 MacroMigrationDialog
& getDialog();
55 class PreparationPage
: public MacroMigrationPage
58 explicit PreparationPage(vcl::Window
*pParent
);
59 virtual ~PreparationPage();
60 virtual void dispose() override
;
62 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
65 void showCloseDocsError(bool _bShow
);
68 VclPtr
<FixedText
> m_pCloseDocError
;
72 class SaveDBDocPage
: public MacroMigrationPage
75 explicit SaveDBDocPage(MacroMigrationDialog
& _rParentDialog
);
76 virtual ~SaveDBDocPage();
77 virtual void dispose() override
;
78 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
81 OUString
getBackupLocation() const { return m_pLocationController
->getURL(); }
82 void grabLocationFocus() { m_pSaveAsLocation
->GrabFocus(); }
85 VclPtr
< ::svt::OFileURLControl
> m_pSaveAsLocation
;
86 VclPtr
<PushButton
> m_pBrowseSaveAsLocation
;
87 VclPtr
<FixedText
> m_pStartMigration
;
88 svx::DatabaseLocationInputController
* m_pLocationController
;
91 // IWizardPageController overridables
92 virtual void initializePage() override
;
93 virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason
) override
;
94 virtual bool canAdvance() const override
;
97 DECL_LINK_TYPED( OnLocationModified
, Edit
&, void );
98 void impl_updateLocationDependentItems();
102 class ProgressPage
: public MacroMigrationPage
, public IMigrationProgress
105 explicit ProgressPage(vcl::Window
*pParent
);
106 virtual ~ProgressPage();
107 virtual void dispose() override
;
109 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
111 void setDocumentCounts( const sal_Int32 _nForms
, const sal_Int32 _nReports
);
112 void onFinishedSuccessfully();
115 // IMigrationProgress
116 virtual void startObject( const OUString
& _rObjectName
, const OUString
& _rCurrentAction
, const sal_uInt32 _bRange
) override
;
117 virtual void setObjectProgressText( const OUString
& _rText
) override
;
118 virtual void setObjectProgressValue( const sal_uInt32 _nValue
) override
;
119 virtual void endObject() override
;
120 virtual void start( const sal_uInt32 _nOverallRange
) override
;
121 virtual void setOverallProgressText( const OUString
& _rText
) override
;
122 virtual void setOverallProgressValue( const sal_uInt32 _nValue
) override
;
125 VclPtr
<FixedText
> m_pObjectCount
;
126 VclPtr
<FixedText
> m_pCurrentObject
;
127 VclPtr
<FixedText
> m_pCurrentAction
;
128 RangeProgressBar m_aCurrentProgress
;
129 VclPtr
<FixedText
> m_pAllProgressText
;
130 RangeProgressBar m_aAllProgress
;
131 VclPtr
<FixedText
> m_pMigrationDone
;
135 class ResultPage
: public MacroMigrationPage
138 explicit ResultPage(vcl::Window
*pParent
);
139 virtual ~ResultPage();
140 virtual void dispose() override
;
142 static VclPtr
<TabPage
> Create( ::svt::RoadmapWizard
& _rParentDialog
);
144 void displayMigrationLog( const bool _bSuccessful
, const OUString
& _rLog
);
147 VclPtr
<FixedText
> m_pSuccessLabel
;
148 VclPtr
<FixedText
> m_pFailureLabel
;
149 VclPtr
<VclMultiLineEdit
> m_pChanges
;
154 #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */