nss: upgrade to release 3.73
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_resultsetmetadata.hxx
blob2c1b5e5e5965ad7e5eacd5b585680cc17a7f2efb
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 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_RESULTSETMETADATA_HXX
38 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_RESULTSETMETADATA_HXX
39 #include <vector>
41 #include "pq_connection.hxx"
43 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
44 #include <com/sun/star/beans/XPropertySet.hpp>
46 #include <cppuhelper/implbase.hxx>
48 namespace pq_sdbc_driver
51 struct ColDesc
53 OUString name;
54 sal_Int32 precision;
55 sal_Int32 scale;
56 sal_Int32 displaySize;
57 Oid typeOid;
58 OUString typeName;
59 sal_Int32 type;
62 class ResultSet;
64 class ResultSetMetaData :
65 public ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData >
67 ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
68 ConnectionSettings **m_ppSettings;
69 css::uno::Reference< css::sdbc::XResultSet > m_origin;
70 css::uno::Reference< css::beans::XPropertySet > m_table;
71 OUString m_tableName;
72 OUString m_schemaName;
73 std::vector< ColDesc > m_colDesc;
74 ResultSet *m_pResultSet;
76 bool m_checkedForTable;
77 bool m_checkedForTypes;
79 sal_Int32 m_colCount;
81 /// @throws css::sdbc::SQLException
82 /// @throws css::uno::RuntimeException
83 void checkColumnIndex( sal_Int32 columnIndex );
84 void checkTable();
85 void checkForTypes();
86 css::uno::Reference< css::beans::XPropertySet > getColumnByIndex( int index );
88 sal_Int32 getIntColumnProperty( const OUString & name, int index, int def );
89 bool getBoolColumnProperty( const OUString & name, int index, bool def );
91 public:
92 ResultSetMetaData(
93 const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex,
94 const css::uno::Reference< css::sdbc::XResultSet > & origin,
95 ResultSet *pResultSet,
96 ConnectionSettings **pSettings,
97 PGresult const *pResult,
98 const OUString &schemaName,
99 const OUString &tableName );
101 public:
102 // Methods
103 virtual sal_Int32 SAL_CALL getColumnCount( ) override;
104 virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
105 virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
106 virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
107 virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
108 virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
109 virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
110 virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
111 virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
112 virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
113 virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
114 virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
115 virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
116 virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
117 virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
118 virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
119 virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
120 virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
121 virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
122 virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
123 virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */