Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / include / connectivity / statementcomposer.hxx
blob537204dc946bc8c2820fff44b50453836bcde2b4
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 <config_options.h>
24 #include <rtl/ustring.hxx>
26 #include <memory>
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; }
34 namespace dbtools
38 //= StatementComposer
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;
47 public:
48 /** constructs an instance
50 @param _rxConnection
51 the connection to work with. Must not be <NULL/>.
53 StatementComposer(
54 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,
55 const OUString& _rCommand,
56 const sal_Int32 _nCommandType,
57 const bool _bEscapeProcessing
60 ~StatementComposer();
62 /** controls whether or not the instance disposes its XSingleSelectQueryComposer upon
63 destruction
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 &
81 getComposer();
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
91 OUString
92 getQuery();
94 private:
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: */