update dev300-m58
[ooovba.git] / dbaccess / source / ext / macromigration / migrationerror.hxx
blobfa4f23ac7c57714ac4153b70dea9b57598c56941
1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * Copyright 2008 by Sun Microsystems, Inc.
6 * OpenOffice.org - a multi-platform office productivity suite
8 * $RCSfile: migrationerror.hxx,v $
10 * $Revision: 1.1.2.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.
28 ************************************************************************/
30 #ifndef DBACCESS_MIGRATIONERROR_HXX
31 #define DBACCESS_MIGRATIONERROR_HXX
33 /** === begin UNO includes === **/
34 #include <com/sun/star/uno/Any.hxx>
35 /** === end UNO includes === **/
37 #include <vector>
39 //........................................................................
40 namespace dbmm
42 //........................................................................
44 enum MigrationErrorType
46 ERR_OPENING_SUB_DOCUMENT_FAILED = 1,
47 ERR_CLOSING_SUB_DOCUMENT_FAILED,
48 ERR_STORAGE_COMMIT_FAILED,
49 ERR_STORING_DATABASEDOC_FAILED,
50 ERR_COLLECTING_DOCUMENTS_FAILED,
51 ERR_UNEXPECTED_LIBSTORAGE_ELEMENT,
52 ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED,
53 ERR_COMMITTING_SCRIPT_STORAGES_FAILED,
54 ERR_GENERAL_SCRIPT_MIGRATION_FAILURE,
55 ERR_GENERAL_MACRO_MIGRATION_FAILURE,
56 ERR_UNKNOWN_SCRIPT_TYPE,
57 ERR_UNKNOWN_SCRIPT_LANGUAGE,
58 ERR_UNKNOWN_SCRIPT_NAME_FORMAT,
59 ERR_SCRIPT_TRANSLATION_FAILURE,
60 ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT,
61 ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED,
62 ERR_ADJUSTING_DIALOG_EVENTS_FAILED,
63 ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED,
64 ERR_BIND_SCRIPT_STORAGE_FAILED,
65 ERR_REMOVE_SCRIPTS_STORAGE_FAILED,
66 ERR_DOCUMENT_BACKUP_FAILED,
67 ERR_UNKNOWN_SCRIPT_FOLDER,
68 ERR_EXAMINING_SCRIPTS_FOLDER_FAILED,
69 ERR_PASSWORD_VERIFICATION_FAILED,
70 ERR_NEW_STYLE_REPORT
73 //====================================================================
74 //= MigrationError
75 //====================================================================
76 /** encapsulates information about an error which happened during the migration
78 struct MigrationError
80 const MigrationErrorType eType;
81 ::std::vector< ::rtl::OUString > aErrorDetails;
82 const ::com::sun::star::uno::Any aCaughtException;
84 MigrationError(
85 const MigrationErrorType _eType )
86 :eType( _eType )
90 MigrationError(
91 const MigrationErrorType _eType,
92 const ::com::sun::star::uno::Any& _rCaughtException )
93 :eType( _eType )
94 ,aCaughtException( _rCaughtException )
98 MigrationError(
99 const MigrationErrorType _eType,
100 const ::rtl::OUString& _rDetail )
101 :eType( _eType )
103 impl_constructDetails( _rDetail );
106 MigrationError(
107 const MigrationErrorType _eType,
108 const ::rtl::OUString& _rDetail,
109 const ::com::sun::star::uno::Any& _rCaughtException )
110 :eType( _eType )
111 ,aCaughtException( _rCaughtException )
113 impl_constructDetails( _rDetail );
116 MigrationError(
117 const MigrationErrorType _eType,
118 const ::rtl::OUString& _rDetail1,
119 const ::rtl::OUString& _rDetail2 )
120 :eType( _eType )
122 impl_constructDetails( _rDetail1, _rDetail2 );
125 MigrationError(
126 const MigrationErrorType _eType,
127 const ::rtl::OUString& _rDetail1,
128 const ::rtl::OUString& _rDetail2,
129 const ::com::sun::star::uno::Any& _rCaughtException )
130 :eType( _eType )
131 ,aCaughtException( _rCaughtException )
133 impl_constructDetails( _rDetail1, _rDetail2 );
136 MigrationError(
137 const MigrationErrorType _eType,
138 const ::rtl::OUString& _rDetail1,
139 const ::rtl::OUString& _rDetail2,
140 const ::rtl::OUString& _rDetail3,
141 const ::com::sun::star::uno::Any& _rCaughtException )
142 :eType( _eType )
143 ,aCaughtException( _rCaughtException )
145 impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
148 MigrationError(
149 const MigrationErrorType _eType,
150 const ::rtl::OUString& _rDetail1,
151 const ::rtl::OUString& _rDetail2,
152 const ::rtl::OUString& _rDetail3 )
153 :eType( _eType )
155 impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 );
158 private:
159 void impl_constructDetails(
160 const ::rtl::OUString& _rDetail1,
161 const ::rtl::OUString& _rDetail2 = ::rtl::OUString(),
162 const ::rtl::OUString& _rDetail3 = ::rtl::OUString()
165 if ( _rDetail1.getLength() ) aErrorDetails.push_back( _rDetail1 );
166 if ( _rDetail2.getLength() ) aErrorDetails.push_back( _rDetail2 );
167 if ( _rDetail3.getLength() ) aErrorDetails.push_back( _rDetail3 );
171 //........................................................................
172 } // namespace dbmm
173 //........................................................................
175 #endif // DBACCESS_MIGRATIONERROR_HXX