Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ext / macromigration / migrationerror.hxx
blobe5067ec82599d2402681664eaae969cc61907b71
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_MIGRATIONERROR_HXX
21 #define INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
23 #include <com/sun/star/uno/Any.hxx>
25 #include <vector>
27 namespace dbmm
30 enum MigrationErrorType
32 ERR_OPENING_SUB_DOCUMENT_FAILED = 1,
33 ERR_CLOSING_SUB_DOCUMENT_FAILED,
34 ERR_STORAGE_COMMIT_FAILED,
35 ERR_STORING_DATABASEDOC_FAILED,
36 ERR_COLLECTING_DOCUMENTS_FAILED,
37 ERR_UNEXPECTED_LIBSTORAGE_ELEMENT,
38 ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED,
39 ERR_COMMITTING_SCRIPT_STORAGES_FAILED,
40 ERR_GENERAL_SCRIPT_MIGRATION_FAILURE,
41 ERR_GENERAL_MACRO_MIGRATION_FAILURE,
42 ERR_UNKNOWN_SCRIPT_TYPE,
43 ERR_UNKNOWN_SCRIPT_LANGUAGE,
44 ERR_UNKNOWN_SCRIPT_NAME_FORMAT,
45 ERR_SCRIPT_TRANSLATION_FAILURE,
46 ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT,
47 ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED,
48 ERR_ADJUSTING_DIALOG_EVENTS_FAILED,
49 ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED,
50 ERR_BIND_SCRIPT_STORAGE_FAILED,
51 ERR_REMOVE_SCRIPTS_STORAGE_FAILED,
52 ERR_DOCUMENT_BACKUP_FAILED,
53 ERR_UNKNOWN_SCRIPT_FOLDER,
54 ERR_EXAMINING_SCRIPTS_FOLDER_FAILED,
55 ERR_PASSWORD_VERIFICATION_FAILED,
56 ERR_NEW_STYLE_REPORT
59 // MigrationError
60 /** encapsulates information about an error which happened during the migration
62 struct MigrationError
64 const MigrationErrorType eType;
65 ::std::vector< OUString > aErrorDetails;
66 const ::com::sun::star::uno::Any aCaughtException;
68 MigrationError(
69 const MigrationErrorType _eType )
70 :eType( _eType )
74 MigrationError(
75 const MigrationErrorType _eType,
76 const ::com::sun::star::uno::Any& _rCaughtException )
77 :eType( _eType )
78 ,aCaughtException( _rCaughtException )
82 MigrationError(
83 const MigrationErrorType _eType,
84 const OUString& _rDetail )
85 :eType( _eType )
87 impl_constructDetails( _rDetail );
90 MigrationError(
91 const MigrationErrorType _eType,
92 const OUString& _rDetail,
93 const ::com::sun::star::uno::Any& _rCaughtException )
94 :eType( _eType )
95 ,aCaughtException( _rCaughtException )
97 impl_constructDetails( _rDetail );
100 MigrationError(
101 const MigrationErrorType _eType,
102 const OUString& _rDetail1,
103 const OUString& _rDetail2 )
104 :eType( _eType )
106 impl_constructDetails( _rDetail1, _rDetail2 );
109 MigrationError(
110 const MigrationErrorType _eType,
111 const OUString& _rDetail1,
112 const OUString& _rDetail2,
113 const ::com::sun::star::uno::Any& _rCaughtException )
114 :eType( _eType )
115 ,aCaughtException( _rCaughtException )
117 impl_constructDetails( _rDetail1, _rDetail2 );
120 MigrationError(
121 const MigrationErrorType _eType,
122 const OUString& _rDetail1,
123 const OUString& _rDetail2,
124 const OUString& _rDetail3,
125 const ::com::sun::star::uno::Any& _rCaughtException )
126 :eType( _eType )
127 ,aCaughtException( _rCaughtException )
129 impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
132 MigrationError(
133 const MigrationErrorType _eType,
134 const OUString& _rDetail1,
135 const OUString& _rDetail2,
136 const OUString& _rDetail3 )
137 :eType( _eType )
139 impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
142 private:
143 void impl_constructDetails(
144 const OUString& _rDetail1,
145 const OUString& _rDetail2 = OUString(),
146 const OUString& _rDetail3 = OUString()
149 if ( !_rDetail1.isEmpty() ) aErrorDetails.push_back( _rDetail1 );
150 if ( !_rDetail2.isEmpty() ) aErrorDetails.push_back( _rDetail2 );
151 if ( !_rDetail3.isEmpty() ) aErrorDetails.push_back( _rDetail3 );
155 } // namespace dbmm
157 #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */