Update ooo320-m1
[ooovba.git] / dbaccess / source / ext / macromigration / migrationengine.hxx
blob1bc26a62fafd79da6ea7285b45e0a3beebd31f11
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: migrationengine.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBACCESS_MIGRATIONENGINE_HXX
32 #define DBACCESS_MIGRATIONENGINE_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
36 /** === end UNO includes === **/
38 #include <comphelper/componentcontext.hxx>
40 #include <memory>
42 namespace comphelper {
43 class ComponentContext;
46 //........................................................................
47 namespace dbmm
49 //........................................................................
51 class IMigrationProgress;
52 class MigrationLog;
54 //====================================================================
55 //= MigrationEngine
56 //====================================================================
57 class MigrationEngine_Impl;
58 class MigrationEngine
60 public:
61 /** creates the migration engine
62 @param _rxDocument
63 the document whose macros/scripts should be migrated
64 @param _rProgress
65 a callback for notifying progress. Beware of lifetimes here: The progress callback,
66 passed herein as reference, must live as long as the engine instance lives.
68 MigrationEngine(
69 const ::comphelper::ComponentContext& _rContext,
70 const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument,
71 IMigrationProgress& _rProgress,
72 MigrationLog& _rLogger
75 ~MigrationEngine();
77 sal_Int32 getFormCount() const;
78 sal_Int32 getReportCount() const;
80 /** starts migrating the scripts and macros in the forms/reports to the database
81 document.
83 This process cannot be cancelled, as it would leave the document in an inconsistent
84 state.
86 When the function returns, then the migration is finished.
88 @return
89 whether or not the migration was successful. If it wasn't, then an error has been reported
90 to the user, using the document's interaction handler. If no such interaction handler
91 was present, then the error has been silenced.
93 bool migrateAll();
95 private:
96 ::std::auto_ptr< MigrationEngine_Impl > m_pImpl;
99 //........................................................................
100 } // namespace dbmm
101 //........................................................................
103 #endif // DBACCESS_MIGRATIONENGINE_HXX