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_CONNECTIVITY_WARNINGSCONTAINER_HXX
21 #define INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
23 #include <connectivity/dbtoolsdllapi.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
28 namespace com::sun::star::sdbc
{ class SQLException
; }
29 namespace com::sun::star::sdbc
{ class SQLWarning
; }
30 namespace com::sun::star::sdbc
{ class XWarningsSupplier
; }
31 namespace com::sun::star::sdb
{ class SQLContext
; }
32 namespace com::sun::star::uno
{ class XInterface
; }
37 /** helper class for implementing XWarningsSupplier, which mixes own warnings with
38 warnings obtained from an external instance
40 class OOO_DLLPUBLIC_DBTOOLS WarningsContainer
43 css::uno::Reference
< css::sdbc::XWarningsSupplier
> m_xExternalWarnings
;
44 css::uno::Any m_aOwnWarnings
;
47 WarningsContainer() {}
48 WarningsContainer( css::uno::Reference
< css::sdbc::XWarningsSupplier
> _xExternalWarnings
)
49 :m_xExternalWarnings(std::move( _xExternalWarnings
)) {}
51 void setExternalWarnings( const css::uno::Reference
< css::sdbc::XWarningsSupplier
>& _rxExternalWarnings
)
53 m_xExternalWarnings
= _rxExternalWarnings
;
57 /** appends an SQLWarning instance to the chain
60 @param _pAsciiSQLState
61 the SQLState of the warning
63 the context of the warning
66 const OUString
& _rWarning
,
67 const char* _pAsciiSQLState
,
68 const css::uno::Reference
< css::uno::XInterface
>& _rxContext
);
70 void appendWarning(const css::sdbc::SQLException
& _rWarning
);
71 void appendWarning(const css::sdbc::SQLWarning
& _rWarning
);
72 void appendWarning(const css::sdb::SQLContext
& _rContext
);
74 // XWarningsSupplier equivalents
75 css::uno::Any
getWarnings( ) const;
76 void clearWarnings( );
80 } // namespace dbtools
83 #endif // INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */