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_STATEMENTCOMPOSER_HXX
21 #define INCLUDED_CONNECTIVITY_STATEMENTCOMPOSER_HXX
23 #include <rtl/ustring.hxx>
26 #include <connectivity/dbtoolsdllapi.hxx>
28 namespace com::sun::star::sdbc
{ class XConnection
; }
29 namespace com::sun::star::sdb
{ class XSingleSelectQueryComposer
; }
30 namespace com::sun::star::uno
{ template <typename
> class Reference
; }
39 struct StatementComposer_Data
;
40 /** a class which is able to compose queries (SELECT statements) from a command and a command type
42 class OOO_DLLPUBLIC_DBTOOLS StatementComposer
44 ::std::unique_ptr
< StatementComposer_Data
> m_pData
;
47 /** constructs an instance
50 the connection to work with. Must not be <NULL/>.
53 const css::uno::Reference
< css::sdbc::XConnection
>& _rxConnection
,
54 const OUString
& _rCommand
,
55 const sal_Int32 _nCommandType
,
56 const bool _bEscapeProcessing
61 /** controls whether or not the instance disposes its XSingleSelectQueryComposer upon
64 Unless you explicitly call this method with the parameter being <TRUE/>,
65 the XSingleSelectQueryComposer will be disposed when the StatementComposer
66 instance is destroyed.
68 void setDisposeComposer( bool _bDoDispose
);
70 void setFilter( const OUString
& _rFilter
);
71 void setOrder( const OUString
& _rOrder
);
73 /** returns the composer which has been fed with the current settings
75 @throws css::sdbc::SQLException
76 if such an exception occurs while creating the composer
78 css::uno::Reference
< css::sdb::XSingleSelectQueryComposer
> const &
81 /** returns the composer statement
83 Effectively, this is equivalent to calling getComposer, and asking the composer
84 for its Query attribute.
86 @throws css::sdbc::SQLException
87 if such an exception occurs while creating the composer
93 StatementComposer(const StatementComposer
&) = delete;
94 StatementComposer
& operator=(const StatementComposer
&) = delete;
95 StatementComposer() = delete;
99 } // namespace dbtools
102 #endif // INCLUDED_CONNECTIVITY_STATEMENTCOMPOSER_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */