bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / connectivity / statementcomposer.hxx
blob944a4321b12afd242a328d372a31c01d46169c8f
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_STATEMENTCOMPOSER_HXX
21 #define INCLUDED_CONNECTIVITY_STATEMENTCOMPOSER_HXX
23 #include <rtl/ustring.hxx>
25 #include <memory>
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; }
33 namespace dbtools
37 //= StatementComposer
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;
46 public:
47 /** constructs an instance
49 @param _rxConnection
50 the connection to work with. Must not be <NULL/>.
52 StatementComposer(
53 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
54 const OUString& _rCommand,
55 const sal_Int32 _nCommandType,
56 const bool _bEscapeProcessing
59 ~StatementComposer();
61 /** controls whether or not the instance disposes its XSingleSelectQueryComposer upon
62 destruction
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 &
79 getComposer();
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
89 OUString
90 getQuery();
92 private:
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: */