bump product version to 4.1.6.2
[LibreOffice.git] / include / connectivity / statementcomposer.hxx
blob56b10ebd0d11f5fab952f226d64dc144f313c48b
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 CONNECTIVITY_STATEMENTCOMPOSER_HXX
21 #define CONNECTIVITY_STATEMENTCOMPOSER_HXX
23 #include <com/sun/star/sdbc/XConnection.hpp>
24 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
26 #include <boost/noncopyable.hpp>
28 #include <memory>
29 #include "connectivity/dbtoolsdllapi.hxx"
31 //........................................................................
32 namespace dbtools
34 //........................................................................
36 //====================================================================
37 //= StatementComposer
38 //====================================================================
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 : public ::boost::noncopyable
44 ::std::auto_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 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
54 const OUString& _rCommand,
55 const sal_Int32 _nCommandType,
56 const sal_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 ::com::sun::star::sdbc::SQLException
76 if such an exception occurs while creating the composer
78 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
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 ::com::sun::star::sdbc::SQLException
87 if such an exception occurs while creating the composer
89 OUString
90 getQuery();
92 private:
93 StatementComposer(); // not implemented
96 //........................................................................
97 } // namespace dbtools
98 //........................................................................
100 #endif // CONNECTIVITY_STATEMENTCOMPOSER_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */