1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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
,
60 /** encapsulates information about an error which happened during the migration
64 const MigrationErrorType eType
;
65 ::std::vector
< OUString
> aErrorDetails
;
66 const ::com::sun::star::uno::Any aCaughtException
;
69 const MigrationErrorType _eType
)
75 const MigrationErrorType _eType
,
76 const ::com::sun::star::uno::Any
& _rCaughtException
)
78 ,aCaughtException( _rCaughtException
)
83 const MigrationErrorType _eType
,
84 const OUString
& _rDetail
)
87 impl_constructDetails( _rDetail
);
91 const MigrationErrorType _eType
,
92 const OUString
& _rDetail
,
93 const ::com::sun::star::uno::Any
& _rCaughtException
)
95 ,aCaughtException( _rCaughtException
)
97 impl_constructDetails( _rDetail
);
101 const MigrationErrorType _eType
,
102 const OUString
& _rDetail1
,
103 const OUString
& _rDetail2
)
106 impl_constructDetails( _rDetail1
, _rDetail2
);
110 const MigrationErrorType _eType
,
111 const OUString
& _rDetail1
,
112 const OUString
& _rDetail2
,
113 const ::com::sun::star::uno::Any
& _rCaughtException
)
115 ,aCaughtException( _rCaughtException
)
117 impl_constructDetails( _rDetail1
, _rDetail2
);
121 const MigrationErrorType _eType
,
122 const OUString
& _rDetail1
,
123 const OUString
& _rDetail2
,
124 const OUString
& _rDetail3
,
125 const ::com::sun::star::uno::Any
& _rCaughtException
)
127 ,aCaughtException( _rCaughtException
)
129 impl_constructDetails( _rDetail1
, _rDetail2
, _rDetail3
);
133 const MigrationErrorType _eType
,
134 const OUString
& _rDetail1
,
135 const OUString
& _rDetail2
,
136 const OUString
& _rDetail3
)
139 impl_constructDetails( _rDetail1
, _rDetail2
, _rDetail3
);
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
);
157 #endif // INCLUDED_DBACCESS_SOURCE_EXT_MACROMIGRATION_MIGRATIONERROR_HXX
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */