LibreOffice Module connectivity (master) 1
warningscontainer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
21#define INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
22
24
25#include <com/sun/star/uno/Reference.hxx>
26#include <utility>
27
28namespace com::sun::star::sdbc { class SQLException; }
29namespace com::sun::star::sdbc { class SQLWarning; }
30namespace com::sun::star::sdbc { class XWarningsSupplier; }
31namespace com::sun::star::sdb { class SQLContext; }
32namespace com::sun::star::uno { class XInterface; }
33
34namespace dbtools
35{
36
41 {
42 private:
43 css::uno::Reference< css::sdbc::XWarningsSupplier > m_xExternalWarnings;
44 css::uno::Any m_aOwnWarnings;
45
46 public:
48 WarningsContainer( css::uno::Reference< css::sdbc::XWarningsSupplier > _xExternalWarnings )
49 :m_xExternalWarnings(std::move( _xExternalWarnings )) {}
50
51 void setExternalWarnings( const css::uno::Reference< css::sdbc::XWarningsSupplier >& _rxExternalWarnings )
52 {
53 m_xExternalWarnings = _rxExternalWarnings;
54 }
55
56 // convenience
66 const OUString& _rWarning,
67 const char* _pAsciiSQLState,
68 const css::uno::Reference< css::uno::XInterface >& _rxContext );
69
70 void appendWarning(const css::sdbc::SQLException& _rWarning);
71 void appendWarning(const css::sdbc::SQLWarning& _rWarning);
72 void appendWarning(const css::sdb::SQLContext& _rContext);
73
74 // XWarningsSupplier equivalents
75 css::uno::Any getWarnings( ) const;
76 void clearWarnings( );
77 };
78
79
80} // namespace dbtools
81
82
83#endif // INCLUDED_CONNECTIVITY_WARNINGSCONTAINER_HXX
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
helper class for implementing XWarningsSupplier, which mixes own warnings with warnings obtained from...
void appendWarning(const css::sdb::SQLContext &_rContext)
css::uno::Reference< css::sdbc::XWarningsSupplier > m_xExternalWarnings
WarningsContainer(css::uno::Reference< css::sdbc::XWarningsSupplier > _xExternalWarnings)
void setExternalWarnings(const css::uno::Reference< css::sdbc::XWarningsSupplier > &_rxExternalWarnings)
void appendWarning(const OUString &_rWarning, const char *_pAsciiSQLState, const css::uno::Reference< css::uno::XInterface > &_rxContext)
appends an SQLWarning instance to the chain
void appendWarning(const css::sdbc::SQLWarning &_rWarning)
#define OOO_DLLPUBLIC_DBTOOLS