1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _DBACORE_RESULTCOLUMN_HXX_
29 #define _DBACORE_RESULTCOLUMN_HXX_
30 
31 #ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HDL_
32 #include <com/sun/star/sdbc/XResultSetMetaData.hdl>
33 #endif
34 #ifndef _DBA_COREAPI_COLUMN_HXX_
35 #include <column.hxx>
36 #endif
37 #include <boost/optional.hpp>
38 namespace dbaccess
39 {
40 	//************************************************************
41 	//  OResultColumn
42 	//************************************************************
43 	class OResultColumn : public OColumn,
44 						  public ::comphelper::OPropertyArrayUsageHelper < OResultColumn >
45 	{
46 	protected:
47 		::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XResultSetMetaData >	m_xMetaData;
48         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >   m_xDBMetaData;
49 		sal_Int32				    m_nPos;
50         ::com::sun::star::uno::Any  m_aIsRowVersion;
51         mutable ::boost::optional< sal_Bool > m_isSigned;
52         mutable ::boost::optional< sal_Bool > m_isCurrency;
53         mutable ::boost::optional< sal_Bool > m_bSearchable;
54         mutable ::boost::optional< sal_Bool > m_isCaseSensitive;
55         mutable ::boost::optional< sal_Bool > m_isReadOnly;
56         mutable ::boost::optional< sal_Bool > m_isWritable;
57         mutable ::boost::optional< sal_Bool > m_isDefinitelyWritable;
58         mutable ::boost::optional< sal_Bool > m_isAutoIncrement;
59         mutable ::boost::optional< sal_Int32 > m_isNullable;
60         mutable ::boost::optional< ::rtl::OUString > m_sColumnLabel;
61         mutable ::boost::optional< sal_Int32 > m_nColumnDisplaySize;
62         mutable ::boost::optional< sal_Int32 > m_nColumnType;
63         mutable ::boost::optional< sal_Int32 > m_nPrecision;
64         mutable ::boost::optional< sal_Int32 > m_nScale;
65 
66 		virtual ~OResultColumn();
67 	public:
68 		OResultColumn(
69             const ::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XResultSetMetaData >& _xMetaData,
70 			sal_Int32 _nPos,
71             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMeta );
72 
73 	// com::sun::star::lang::XTypeProvider
74 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
75 
76 	// com::sun::star::lang::XServiceInfo
77 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
78 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
79 
80 	// cppu::OComponentHelper
81 		virtual void SAL_CALL disposing(void);
82 
83 	// comphelper::OPropertyArrayUsageHelper
84 		virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
85 
86 	// cppu::OPropertySetHelper
87 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
88 		virtual void SAL_CALL getFastPropertyValue(
89 									::com::sun::star::uno::Any& rValue,
90 									sal_Int32 nHandle
91 										 ) const;
92 
93     private:
94         void    impl_determineIsRowVersion_nothrow();
95 
96     protected:
97         using ::cppu::OPropertySetHelper::getFastPropertyValue;
98 	};
99 }
100 #endif // _DBACORE_RESULTCOLUMN_HXX_
101 
102