1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DBACCESS_MACROMIGRATIONDIALOG_HXX
25 #define DBACCESS_MACROMIGRATIONDIALOG_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
29 /** === end UNO includes === **/
30 
31 #include <comphelper/componentcontext.hxx>
32 #include <svtools/roadmapwizard.hxx>
33 
34 #include <memory>
35 
36 //........................................................................
37 namespace dbmm
38 {
39 //........................................................................
40 
41     //====================================================================
42     //= MacroMigrationDialog
43     //====================================================================
44     struct MacroMigrationDialog_Data;
45     typedef ::svt::RoadmapWizard    MacroMigrationDialog_Base;
46     class MacroMigrationDialog : public MacroMigrationDialog_Base
47     {
48     public:
49         MacroMigrationDialog(
50             Window* _pParent,
51             const ::comphelper::ComponentContext& _rContext,
52             const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument
53         );
54         virtual ~MacroMigrationDialog();
55 
56         const ::comphelper::ComponentContext&
57                 getComponentContext() const;
58         const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >&
59                 getDocument() const;
60 
61     protected:
62         // OWizardMachine overridables
63         virtual void            enterState( WizardState _nState );
64         virtual sal_Bool        prepareLeaveCurrentState( CommitPageReason _eReason );
65         virtual sal_Bool        leaveState( WizardState _nState );
66         virtual WizardState     determineNextState( WizardState _nCurrentState ) const;
67         virtual sal_Bool        onFinish();
68 
69         // Dialog overridables
70         virtual sal_Bool    Close();
71 	    virtual short	Execute();
72 
73     private:
74         void    impl_showCloseDocsError( bool _bShow );
75         bool    impl_closeSubDocs_nothrow();
76         bool    impl_backupDocument_nothrow() const;
77         void    impl_reloadDocument_nothrow( bool _bMigrationSuccess );
78 
79     private:
80         DECL_LINK( OnStartMigration, void* );
81 
82     private:
83         ::std::auto_ptr< MacroMigrationDialog_Data >    m_pData;
84     };
85 
86 //........................................................................
87 } // namespace dbmm
88 //........................................................................
89 
90 #endif // DBACCESS_MACROMIGRATIONDIALOG_HXX
91