Bump for 3.6-28
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_sequenceresultset.hxx
blobf906aac585c972eb5c89e9302534f062c0bdc856
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * Version: MPL 1.1 / GPLv3+ / LGPLv2.1+
33 * The contents of this file are subject to the Mozilla Public License Version
34 * 1.1 (the "License"); you may not use this file except in compliance with
35 * the License or as specified alternatively below. You may obtain a copy of
36 * the License at http://www.mozilla.org/MPL/
38 * Software distributed under the License is distributed on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
40 * for the specific language governing rights and limitations under the
41 * License.
43 * Major Contributor(s):
44 * [ Copyright (C) 2011 Lionel Elie Mamane <lionel@mamane.lu> ]
46 * All Rights Reserved.
48 * For minor contributions see the git repository.
50 * Alternatively, the contents of this file may be used under the terms of
51 * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
52 * the GNU Lesser General Public License Version 2.1 or later (the "LGPLv2.1+"),
53 * in which case the provisions of the GPLv3+ or the LGPLv2.1+ are applicable
54 * instead of those above.
56 ************************************************************************/
58 #ifndef _PG_SEQUENCERESULTSET_HXX_
59 #define _PG_SEQUENCERESULTSET_HXX_
61 #include <cppuhelper/propshlp.hxx>
62 #include <cppuhelper/component.hxx>
64 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
65 #include <com/sun/star/sdbc/XRow.hpp>
66 #include <com/sun/star/sdbc/XCloseable.hpp>
67 #include <com/sun/star/sdbc/XColumnLocate.hpp>
68 #include "pq_connection.hxx"
69 #include "pq_baseresultset.hxx"
70 #include "pq_statics.hxx"
72 namespace pq_sdbc_driver
75 // static const sal_Int32 RESULTSET_CURSOR_NAME = 0;
76 // static const sal_Int32 RESULTSET_ESCAPE_PROCESSING = 1;
77 // static const sal_Int32 RESULTSET_FETCH_DIRECTION = 2;
78 // static const sal_Int32 RESULTSET_FETCH_SIZE = 3;
79 // static const sal_Int32 RESULTSET_RESULT_SET_CONCURRENCY = 4;
80 // static const sal_Int32 RESULTSET_RESULT_SET_TYPE = 5;
82 //#define RESULTSET_SIZE 6
83 class ResultSetGuard;
85 class SequenceResultSet : public BaseResultSet
87 protected:
88 ::com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > m_data;
90 ::com::sun::star::uno::Sequence< ::rtl::OUString > m_columnNames;
91 ::com::sun::star::uno::Reference< com::sun::star::sdbc::XResultSetMetaData > m_meta;
93 protected:
94 /** mutex should be locked before called
96 virtual void checkClosed()
97 throw ( com::sun::star::sdbc::SQLException, com::sun::star::uno::RuntimeException );
99 /** unchecked, acquire mutex before calling
101 virtual ::com::sun::star::uno::Any getValue( sal_Int32 columnIndex );
103 public:
104 SequenceResultSet(
105 const ::rtl::Reference< RefCountedMutex > & mutex,
106 const com::sun::star::uno::Reference< com::sun::star::uno::XInterface > &owner,
107 const com::sun::star::uno::Sequence< rtl::OUString > &colNames,
108 const com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< com::sun::star::uno::Any > > &data,
109 const com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > &tc,
110 const ColumnMetaDataVector *pVec = 0);
111 ~SequenceResultSet();
113 public: // XCloseable
114 virtual void SAL_CALL close( )
115 throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
117 public: // XResultSetMetaDataSupplier
118 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData( )
119 throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
121 public: // XColumnLocate
122 virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName )
123 throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
127 #endif