Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ext / macromigration / migrationengine.hxx
blobb8e3e2ec2fc2785aded7877b80497f97b4a998cb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_MIGRATIONENGINE_HXX
21 #define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONENGINE_HXX
23 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
25 #include <memory>
27 namespace dbmm
30 class IMigrationProgress;
31 class MigrationLog;
33 // MigrationEngine
34 class MigrationEngine_Impl;
35 class MigrationEngine
37 public:
38 /** creates the migration engine
39 @param _rxDocument
40 the document whose macros/scripts should be migrated
41 @param _rProgress
42 a callback for notifying progress. Beware of lifetimes here: The progress callback,
43 passed herein as reference, must live as long as the engine instance lives.
45 MigrationEngine(
46 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext,
47 const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument,
48 IMigrationProgress& _rProgress,
49 MigrationLog& _rLogger
52 ~MigrationEngine();
54 sal_Int32 getFormCount() const;
55 sal_Int32 getReportCount() const;
57 /** starts migrating the scripts and macros in the forms/reports to the database
58 document.
60 This process cannot be cancelled, as it would leave the document in an inconsistent
61 state.
63 When the function returns, then the migration is finished.
65 @return
66 whether or not the migration was successful. If it wasn't, then an error has been reported
67 to the user, using the document's interaction handler. If no such interaction handler
68 was present, then the error has been silenced.
70 bool migrateAll();
72 private:
73 ::std::unique_ptr< MigrationEngine_Impl > m_pImpl;
76 } // namespace dbmm
78 #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONENGINE_HXX
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */