Update ooo320-m1
[ooovba.git] / connectivity / source / inc / FDatabaseMetaDataResultSetMetaData.hxx
blobc640b19c082d0b7015adb4a2f68c0a18fa35da45
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FDatabaseMetaDataResultSetMetaData.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CONNECTIVITY_DATABASEMETADATARESULTSETMETADATA_HXX_
32 #define _CONNECTIVITY_DATABASEMETADATARESULTSETMETADATA_HXX_
34 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 #ifndef _VECTOR_
37 #include <vector>
38 #endif
39 #include "FDatabaseMetaDataResultSet.hxx"
40 #include "OColumn.hxx"
41 #include "connectivity/StdTypeDefs.hxx"
42 #include "connectivity/dbtoolsdllapi.hxx"
44 namespace connectivity
46 //**************************************************************
47 //************ Class: ODatabaseMetaDataResultSetMetaData
48 //**************************************************************
49 typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
51 class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
53 TIntVector m_vMapping; // when not every column is needed
54 ::std::map<sal_Int32,connectivity::OColumn> m_mColumns;
55 ::std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
57 sal_Int32 m_nColCount;
58 protected:
59 virtual ~ODatabaseMetaDataResultSetMetaData();
60 public:
61 // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
62 ODatabaseMetaDataResultSetMetaData( )
63 : m_nColCount(0)
66 /// Avoid ambigous cast error from the compiler.
67 inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
68 { return this; }
70 virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
71 virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
72 virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
73 virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
74 virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
75 virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
76 virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
77 virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
78 virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
79 virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
80 virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
81 virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
82 virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
83 virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
84 virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
85 virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
86 virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
87 virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
88 virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
89 virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
90 virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
92 // methods to set the right column mapping
93 void setColumnPrivilegesMap();
94 void setColumnMap();
95 void setColumnsMap();
96 void setTableNameMap();
97 void setTablesMap();
98 void setProcedureColumnsMap();
99 void setPrimaryKeysMap();
100 void setIndexInfoMap();
101 void setTablePrivilegesMap();
102 void setCrossReferenceMap();
103 void setTypeInfoMap();
104 void setProcedureNameMap();
105 void setProceduresMap();
106 void setTableTypes();
107 void setBestRowIdentifierMap() { setVersionColumnsMap();}
108 void setVersionColumnsMap();
109 void setExportedKeysMap() { setCrossReferenceMap(); }
110 void setImportedKeysMap() { setCrossReferenceMap(); }
111 void setCatalogsMap();
112 void setSchemasMap();
115 #endif // _CONNECTIVITY_FILE_ADATABASEMETARESULTSETMETADATA_HXX_