1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SOURCE_INC_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX
23 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
24 #include <cppuhelper/implbase1.hxx>
26 #include "ado/Awrapado.hxx"
27 #include "ado/ADatabaseMetaDataResultSet.hxx"
28 #include "OColumn.hxx"
30 namespace connectivity
35 //************ Class: ResultSetMetaData
37 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::sdbc::XResultSetMetaData
> ODatabaseMetaResultSetMetaData_BASE
;
39 class ODatabaseMetaDataResultSetMetaData
: public ODatabaseMetaResultSetMetaData_BASE
41 friend class ODatabaseMetaDataResultSet
;
43 const ::std::vector
<sal_Int32
> &m_vMapping
; // when not every column is needed
44 ::std::map
<sal_Int32
,connectivity::OColumn
> m_mColumns
;
45 ::std::map
<sal_Int32
,connectivity::OColumn
>::const_iterator m_mColumnsIter
;
47 ADORecordset
* m_pRecordSet
;
48 sal_Int32 m_nColCount
;
51 ODatabaseMetaDataResultSetMetaData( const ODatabaseMetaDataResultSetMetaData
& ); // never implemented
52 ODatabaseMetaDataResultSetMetaData
& operator=( const ODatabaseMetaDataResultSetMetaData
& ); // never implemented
55 void setColumnPrivilegesMap();
58 void setProcedureColumnsMap();
59 void setPrimaryKeysMap();
60 void setIndexInfoMap();
61 void setTablePrivilegesMap();
62 void setCrossReferenceMap();
63 void setTypeInfoMap();
64 void setProceduresMap();
66 // a Constructor, that is needed for when Returning the Object is needed:
67 ODatabaseMetaDataResultSetMetaData( ADORecordset
* _pRecordSet
,ODatabaseMetaDataResultSet
* _pRes
)
68 : m_vMapping(_pRes
->getColumnMapping()),
69 m_pRecordSet(_pRecordSet
),
70 m_nColCount(m_vMapping
.size()-1)
73 m_pRecordSet
->AddRef();
75 ~ODatabaseMetaDataResultSetMetaData();
77 /// Avoid ambigous cast error from the compiler.
78 inline operator ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
> () throw()
81 virtual sal_Int32 SAL_CALL
getColumnCount( ) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
82 virtual sal_Bool SAL_CALL
isAutoIncrement( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
83 virtual sal_Bool SAL_CALL
isCaseSensitive( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
84 virtual sal_Bool SAL_CALL
isSearchable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
85 virtual sal_Bool SAL_CALL
isCurrency( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
86 virtual sal_Int32 SAL_CALL
isNullable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
87 virtual sal_Bool SAL_CALL
isSigned( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
88 virtual sal_Int32 SAL_CALL
getColumnDisplaySize( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
89 virtual OUString SAL_CALL
getColumnLabel( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
90 virtual OUString SAL_CALL
getColumnName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
91 virtual OUString SAL_CALL
getSchemaName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
92 virtual sal_Int32 SAL_CALL
getPrecision( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
93 virtual sal_Int32 SAL_CALL
getScale( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
94 virtual OUString SAL_CALL
getTableName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
95 virtual OUString SAL_CALL
getCatalogName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
96 virtual sal_Int32 SAL_CALL
getColumnType( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
97 virtual OUString SAL_CALL
getColumnTypeName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
98 virtual sal_Bool SAL_CALL
isReadOnly( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
99 virtual sal_Bool SAL_CALL
isWritable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
100 virtual sal_Bool SAL_CALL
isDefinitelyWritable( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
101 virtual OUString SAL_CALL
getColumnServiceName( sal_Int32 column
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
105 #endif // _CONNECTIVITY_ADO_ADATABASEMETARESULTSETMETADATA_HXX_
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */