Cosmetics.
[LibreOffice.git] / include / connectivity / warningscontainer.hxx
blobc5238ecaf53310983e53b80b7b757f2cb03c3b17
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_CONNECTIVITY_WARNINGSCONTAINER_HXX
21 #define INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
23 #include <connectivity/dbtoolsdllapi.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
27 namespace com::sun::star::sdbc { class SQLException; }
28 namespace com::sun::star::sdbc { class SQLWarning; }
29 namespace com::sun::star::sdbc { class XWarningsSupplier; }
30 namespace com::sun::star::sdb { class SQLContext; }
31 namespace com::sun::star::uno { class XInterface; }
33 namespace dbtools
36 /** helper class for implementing XWarningsSupplier, which mixes own warnings with
37 warnings obtained from an external instance
39 class OOO_DLLPUBLIC_DBTOOLS WarningsContainer
41 private:
42 css::uno::Reference< css::sdbc::XWarningsSupplier > m_xExternalWarnings;
43 css::uno::Any m_aOwnWarnings;
45 public:
46 WarningsContainer() {}
47 WarningsContainer( const css::uno::Reference< css::sdbc::XWarningsSupplier >& _rxExternalWarnings )
48 :m_xExternalWarnings( _rxExternalWarnings ) {}
50 void setExternalWarnings( const css::uno::Reference< css::sdbc::XWarningsSupplier >& _rxExternalWarnings )
52 m_xExternalWarnings = _rxExternalWarnings;
55 // convenience
56 /** appends an SQLWarning instance to the chain
57 @param _rWarning
58 the warning message
59 @param _pAsciiSQLState
60 the SQLState of the warning
61 @param _rxContext
62 the context of the warning
64 void appendWarning(
65 const OUString& _rWarning,
66 const sal_Char* _pAsciiSQLState,
67 const css::uno::Reference< css::uno::XInterface >& _rxContext );
69 void appendWarning(const css::sdbc::SQLException& _rWarning);
70 void appendWarning(const css::sdbc::SQLWarning& _rWarning);
71 void appendWarning(const css::sdb::SQLContext& _rContext);
73 // XWarningsSupplier equivalents
74 css::uno::Any getWarnings( ) const;
75 void clearWarnings( );
79 } // namespace dbtools
82 #endif // INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */