1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DBACORE_RESULTCOLUMN_HXX_
25 #define _DBACORE_RESULTCOLUMN_HXX_
26 
27 #ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HDL_
28 #include <com/sun/star/sdbc/XResultSetMetaData.hdl>
29 #endif
30 #ifndef _DBA_COREAPI_COLUMN_HXX_
31 #include <column.hxx>
32 #endif
33 #include <boost/optional.hpp>
34 namespace dbaccess
35 {
36 	//************************************************************
37 	//  OResultColumn
38 	//************************************************************
39 	class OResultColumn : public OColumn,
40 						  public ::comphelper::OPropertyArrayUsageHelper < OResultColumn >
41 	{
42 	protected:
43 		::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XResultSetMetaData >	m_xMetaData;
44         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >   m_xDBMetaData;
45 		sal_Int32				    m_nPos;
46         ::com::sun::star::uno::Any  m_aIsRowVersion;
47         mutable ::boost::optional< sal_Bool > m_isSigned;
48         mutable ::boost::optional< sal_Bool > m_isCurrency;
49         mutable ::boost::optional< sal_Bool > m_bSearchable;
50         mutable ::boost::optional< sal_Bool > m_isCaseSensitive;
51         mutable ::boost::optional< sal_Bool > m_isReadOnly;
52         mutable ::boost::optional< sal_Bool > m_isWritable;
53         mutable ::boost::optional< sal_Bool > m_isDefinitelyWritable;
54         mutable ::boost::optional< sal_Bool > m_isAutoIncrement;
55         mutable ::boost::optional< sal_Int32 > m_isNullable;
56         mutable ::boost::optional< ::rtl::OUString > m_sColumnLabel;
57         mutable ::boost::optional< sal_Int32 > m_nColumnDisplaySize;
58         mutable ::boost::optional< sal_Int32 > m_nColumnType;
59         mutable ::boost::optional< sal_Int32 > m_nPrecision;
60         mutable ::boost::optional< sal_Int32 > m_nScale;
61 
62 		virtual ~OResultColumn();
63 	public:
64 		OResultColumn(
65             const ::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XResultSetMetaData >& _xMetaData,
66 			sal_Int32 _nPos,
67             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxDBMeta );
68 
69 	// com::sun::star::lang::XTypeProvider
70 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
71 
72 	// com::sun::star::lang::XServiceInfo
73 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
74 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
75 
76 	// cppu::OComponentHelper
77 		virtual void SAL_CALL disposing(void);
78 
79 	// comphelper::OPropertyArrayUsageHelper
80 		virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
81 
82 	// cppu::OPropertySetHelper
83 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
84 		virtual void SAL_CALL getFastPropertyValue(
85 									::com::sun::star::uno::Any& rValue,
86 									sal_Int32 nHandle
87 										 ) const;
88 
89     private:
90         void    impl_determineIsRowVersion_nothrow();
91 
92     protected:
93         using ::cppu::OPropertySetHelper::getFastPropertyValue;
94 	};
95 }
96 #endif // _DBACORE_RESULTCOLUMN_HXX_
97 
98