1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DBACORE_SDBCORETOOLS_HXX
25 #define DBACORE_SDBCORETOOLS_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
29 #include <com/sun/star/sdbc/XConnection.hpp>
30 #include <com/sun/star/embed/XStorage.hpp>
31 #include <com/sun/star/io/IOException.hpp>
32 #include <com/sun/star/lang/WrappedTargetException.hpp>
33 #include <com/sun/star/uno/RuntimeException.hpp>
34 /** === end UNO includes === **/
35 
36 namespace comphelper
37 {
38     class ComponentContext;
39 }
40 
41 //.........................................................................
42 namespace dbaccess
43 {
44 //.........................................................................
45 
46 	// -----------------------------------------------------------------------------
47 	void notifyDataSourceModified(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxObject,sal_Bool _bModified);
48 
49 	// -----------------------------------------------------------------------------
50     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
51         getDataSource( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDependentObject );
52 
53 	// -----------------------------------------------------------------------------
54 
55 	// -----------------------------------------------------------------------------
56     /** retrieves a to-be-displayed string for a given caught exception;
57     */
58     ::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Any& _rError );
59 
60     namespace tools
61     {
62         namespace stor
63         {
64             bool    storageIsWritable_nothrow(
65                         const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
66                     );
67 
68             /// commits a given storage if it's not readonly
69             bool    commitStorageIfWriteable(
70                         const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
71                     )
72                     SAL_THROW((
73                         ::com::sun::star::io::IOException,
74                         ::com::sun::star::lang::WrappedTargetException
75                 ));
76         }
77 
78     }
79 
80 }	// namespace dbaccess
81 //.........................................................................
82 
83 #endif // DBACORE_SDBCORETOOLS_HXX
84 
85