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 <config_options.h>
24 #include <rtl/ustring.hxx>
27 #include <connectivity/dbtoolsdllapi.hxx>
29 namespace com::sun::star::sdbc
{ class XConnection
; }
30 namespace com::sun::star::sdb
{ class XSingleSelectQueryComposer
; }
31 namespace com::sun::star::uno
{ template <typename
> class Reference
; }
40 struct StatementComposer_Data
;
41 /** a class which is able to compose queries (SELECT statements) from a command and a command type
43 class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBTOOLS
) StatementComposer
45 ::std::unique_ptr
< StatementComposer_Data
> m_pData
;
48 /** constructs an instance
51 the connection to work with. Must not be <NULL/>.
54 const css::uno::Reference
< css::sdbc::XConnection
>& _rxConnection
,
55 const OUString
& _rCommand
,
56 const sal_Int32 _nCommandType
,
57 const bool _bEscapeProcessing
62 /** controls whether or not the instance disposes its XSingleSelectQueryComposer upon
65 Unless you explicitly call this method with the parameter being <TRUE/>,
66 the XSingleSelectQueryComposer will be disposed when the StatementComposer
67 instance is destroyed.
69 void setDisposeComposer( bool _bDoDispose
);
71 void setFilter( const OUString
& _rFilter
);
72 void setHavingClause( const OUString
& _rHavingClause
);
73 void setOrder( const OUString
& _rOrder
);
75 /** returns the composer which has been fed with the current settings
77 @throws css::sdbc::SQLException
78 if such an exception occurs while creating the composer
80 css::uno::Reference
< css::sdb::XSingleSelectQueryComposer
> const &
83 /** returns the composer statement
85 Effectively, this is equivalent to calling getComposer, and asking the composer
86 for its Query attribute.
88 @throws css::sdbc::SQLException
89 if such an exception occurs while creating the composer
95 StatementComposer(const StatementComposer
&) = delete;
96 StatementComposer
& operator=(const StatementComposer
&) = delete;
97 StatementComposer() = delete;
101 } // namespace dbtools
104 #endif // INCLUDED_CONNECTIVITY_STATEMENTCOMPOSER_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */