merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ext / macromigration / migrationlog.hxx
blob3b58cd9ef86e2403c188c0ddfa636a21be648cda
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: migrationlog.hxx,v $
10 * $Revision: 1.3.2.2 $
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_MIGRATIONLOG_HXX
32 #define DBACCESS_MIGRATIONLOG_HXX
34 #include "dbmm_types.hxx"
36 /** === begin UNO includes === **/
37 /** === end UNO includes === **/
39 #include <rtl/ustring.hxx>
41 #include <memory>
43 //........................................................................
44 namespace dbmm
46 //........................................................................
48 typedef sal_Int16 DocumentID;
49 struct MigrationError;
51 //====================================================================
52 //= MigrationLog
53 //====================================================================
54 struct MigrationLog_Data;
55 class MigrationLog
57 public:
58 MigrationLog();
59 ~MigrationLog();
61 //----------------------------------------------------------------
62 //- event logging
64 /** logs an unrecoverable error during the migration process
66 void logFailure( const MigrationError& _rError );
68 /** logs a recoverable (or at least ignorable) error during the migration process
70 void logRecoverable( const MigrationError& _rError );
72 /// checks whether logFailure has been called
73 bool hadFailure() const;
75 /// logs the fact that the database document has been backed up
76 void backedUpDocument( const ::rtl::OUString& _rNewDocumentLocation );
78 /** logs that the migration for a certain sub document has been started, returns
79 a unique ID for this sub document which is to be used in later calls
81 DocumentID startedDocument( const SubDocumentType _eType, const ::rtl::OUString& _rName );
83 /** logs the event that a macro or script library has been moved from within a
84 sub document to the database document
86 void movedLibrary(
87 const DocumentID _nDocID,
88 const ScriptType _eScriptType,
89 const ::rtl::OUString& _rOriginalLibName,
90 const ::rtl::OUString& _rNewLibName
93 /** logs that the migration for a certain document has been finished
95 void finishedDocument( const DocumentID _nDocID );
97 //----------------------------------------------------------------
98 //- information retrieval
100 /** retrieves the new name of a library
102 The new library name must previously have been logger by calling
103 <member>movedLibrary</member>. If not, an assertion will be raised in
104 the non-product builds, and an empty string will be returned.
106 const ::rtl::OUString&
107 getNewLibraryName(
108 DocumentID _nDocID,
109 ScriptType _eScriptType,
110 const ::rtl::OUString& _rOriginalLibName
111 ) const;
113 /** determines whether for the given document, any library needed to be (and was) moved
115 bool movedAnyLibrary( const DocumentID );
117 /** provides a human-readable version of the log, explaining a user what happened during
118 the migration.
120 ::rtl::OUString
121 getCompleteLog() const;
123 private:
124 ::std::auto_ptr< MigrationLog_Data > m_pData;
127 //........................................................................
128 } // namespace dbmm
129 //........................................................................
131 #endif // DBACCESS_MIGRATIONLOG_HXX