Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
21 : #define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
22 :
23 : #include "migrationprogress.hxx"
24 : #include "rangeprogressbar.hxx"
25 :
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>
32 :
33 : namespace svt
34 : {
35 : class RoadmapWizard;
36 : }
37 :
38 : namespace dbmm
39 : {
40 :
41 : class MacroMigrationDialog;
42 :
43 : // MacroMigrationPage
44 : typedef ::svt::OWizardPage MacroMigrationPage_Base;
45 0 : class MacroMigrationPage : public MacroMigrationPage_Base
46 : {
47 : public:
48 : MacroMigrationPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
49 :
50 : protected:
51 : const MacroMigrationDialog& getDialog() const;
52 : MacroMigrationDialog& getDialog();
53 : };
54 :
55 : // PreparationPage
56 : class PreparationPage : public MacroMigrationPage
57 : {
58 : public:
59 : PreparationPage(vcl::Window *pParent);
60 : virtual ~PreparationPage();
61 : virtual void dispose() SAL_OVERRIDE;
62 :
63 : static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
64 :
65 : public:
66 : void showCloseDocsError(bool _bShow);
67 :
68 : protected:
69 : VclPtr<FixedText> m_pCloseDocError;
70 : };
71 :
72 : // SaveDBDocPage
73 : class SaveDBDocPage : public MacroMigrationPage
74 : {
75 : public:
76 : SaveDBDocPage(MacroMigrationDialog& _rParentDialog);
77 : virtual ~SaveDBDocPage();
78 : virtual void dispose() SAL_OVERRIDE;
79 : static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
80 :
81 : public:
82 0 : OUString getBackupLocation() const { return m_pLocationController->getURL(); }
83 0 : void grabLocationFocus() { m_pSaveAsLocation->GrabFocus(); }
84 :
85 : protected:
86 : VclPtr< ::svt::OFileURLControl> m_pSaveAsLocation;
87 : VclPtr<PushButton> m_pBrowseSaveAsLocation;
88 : VclPtr<FixedText> m_pStartMigration;
89 : svx::DatabaseLocationInputController* m_pLocationController;
90 :
91 : protected:
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;
96 :
97 : private:
98 : DECL_LINK( OnLocationModified, Edit* );
99 : void impl_updateLocationDependentItems();
100 : };
101 :
102 : // ProgressPage
103 : class ProgressPage : public MacroMigrationPage, public IMigrationProgress
104 : {
105 : public:
106 : ProgressPage(vcl::Window *pParent);
107 : virtual ~ProgressPage();
108 : virtual void dispose() SAL_OVERRIDE;
109 :
110 : static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
111 :
112 : void setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports );
113 : void onFinishedSuccessfully();
114 :
115 : protected:
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;
124 :
125 : private:
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;
133 : };
134 :
135 : // ResultPage
136 : class ResultPage : public MacroMigrationPage
137 : {
138 : public:
139 : ResultPage(vcl::Window *pParent);
140 : virtual ~ResultPage();
141 : virtual void dispose() SAL_OVERRIDE;
142 :
143 : static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
144 :
145 : void displayMigrationLog( const bool _bSuccessful, const OUString& _rLog );
146 :
147 : private:
148 : VclPtr<FixedText> m_pSuccessLabel;
149 : VclPtr<FixedText> m_pFailureLabel;
150 : VclPtr<VclMultiLineEdit> m_pChanges;
151 : };
152 :
153 : } // namespace dbmm
154 :
155 : #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MACROMIGRATIONPAGES_HXX
156 :
157 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|