1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*96de5490SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*96de5490SAndrew Rist * distributed with this work for additional information
6*96de5490SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*96de5490SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist * with the License. You may obtain a copy of the License at
10*96de5490SAndrew Rist *
11*96de5490SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*96de5490SAndrew Rist *
13*96de5490SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist * software distributed under the License is distributed on an
15*96de5490SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist * KIND, either express or implied. See the License for the
17*96de5490SAndrew Rist * specific language governing permissions and limitations
18*96de5490SAndrew Rist * under the License.
19*96de5490SAndrew Rist *
20*96de5490SAndrew Rist *************************************************************/
21*96de5490SAndrew Rist
22*96de5490SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "dbastrings.hrc"
28cdf0e10cSrcweir #include "apitools.hxx"
29cdf0e10cSrcweir #include "CRowSetColumn.hxx"
30cdf0e10cSrcweir
31cdf0e10cSrcweir #include <com/sun/star/sdb/XColumn.hpp>
32cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
33cdf0e10cSrcweir
34cdf0e10cSrcweir #include <comphelper/types.hxx>
35cdf0e10cSrcweir #include <cppuhelper/typeprovider.hxx>
36cdf0e10cSrcweir
37cdf0e10cSrcweir using namespace ::com::sun::star::uno;
38cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
39cdf0e10cSrcweir using namespace ::com::sun::star::sdb;
40cdf0e10cSrcweir using namespace ::com::sun::star::beans;
41cdf0e10cSrcweir
42cdf0e10cSrcweir //..............................................................................
43cdf0e10cSrcweir namespace dbaccess
44cdf0e10cSrcweir {
45cdf0e10cSrcweir //..............................................................................
46cdf0e10cSrcweir
47cdf0e10cSrcweir //------------------------------------------------------------------------------
ORowSetColumn(const Reference<XResultSetMetaData> & _xMetaData,const Reference<XRow> & _xRow,sal_Int32 _nPos,const Reference<XDatabaseMetaData> & _rxDBMeta,const::rtl::OUString & _rDescription,const::rtl::OUString & i_sLabel,ORowSetCacheIterator & _rColumnValue)48cdf0e10cSrcweir ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData, const Reference < XRow >& _xRow, sal_Int32 _nPos,
49cdf0e10cSrcweir const Reference< XDatabaseMetaData >& _rxDBMeta, const ::rtl::OUString& _rDescription, const ::rtl::OUString& i_sLabel,ORowSetCacheIterator& _rColumnValue )
50cdf0e10cSrcweir :ORowSetDataColumn( _xMetaData, _xRow, NULL, _nPos, _rxDBMeta, _rDescription, i_sLabel,_rColumnValue )
51cdf0e10cSrcweir {
52cdf0e10cSrcweir }
53cdf0e10cSrcweir
54cdf0e10cSrcweir //------------------------------------------------------------------------------
createArrayHelper() const55cdf0e10cSrcweir ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const
56cdf0e10cSrcweir {
57cdf0e10cSrcweir const sal_Int32 nDerivedProperties = 21;
58cdf0e10cSrcweir Sequence< Property> aDerivedProperties( nDerivedProperties );
59cdf0e10cSrcweir Property* pDesc = aDerivedProperties.getArray();
60cdf0e10cSrcweir sal_Int32 nPos = 0;
61cdf0e10cSrcweir
62cdf0e10cSrcweir DECL_PROP1( CATALOGNAME, ::rtl::OUString, READONLY );
63cdf0e10cSrcweir DECL_PROP1( DISPLAYSIZE, sal_Int32, READONLY );
64cdf0e10cSrcweir DECL_PROP1_BOOL( ISAUTOINCREMENT, READONLY );
65cdf0e10cSrcweir DECL_PROP1_BOOL( ISCASESENSITIVE, READONLY );
66cdf0e10cSrcweir DECL_PROP1_BOOL( ISCURRENCY, READONLY );
67cdf0e10cSrcweir DECL_PROP1_BOOL( ISDEFINITELYWRITABLE, READONLY );
68cdf0e10cSrcweir DECL_PROP1( ISNULLABLE, sal_Int32, READONLY );
69cdf0e10cSrcweir DECL_PROP1_BOOL( ISREADONLY, BOUND );
70cdf0e10cSrcweir DECL_PROP1_BOOL( ISROWVERSION, READONLY );
71cdf0e10cSrcweir DECL_PROP1_BOOL( ISSEARCHABLE, READONLY );
72cdf0e10cSrcweir DECL_PROP1_BOOL( ISSIGNED, READONLY );
73cdf0e10cSrcweir DECL_PROP1_BOOL( ISWRITABLE, READONLY );
74cdf0e10cSrcweir DECL_PROP1( LABEL, ::rtl::OUString, READONLY );
75cdf0e10cSrcweir DECL_PROP1( PRECISION, sal_Int32, READONLY );
76cdf0e10cSrcweir DECL_PROP1( SCALE, sal_Int32, READONLY );
77cdf0e10cSrcweir DECL_PROP1( SCHEMANAME, ::rtl::OUString, READONLY );
78cdf0e10cSrcweir DECL_PROP1( SERVICENAME, ::rtl::OUString, READONLY );
79cdf0e10cSrcweir DECL_PROP1( TABLENAME, ::rtl::OUString, READONLY );
80cdf0e10cSrcweir DECL_PROP1( TYPE, sal_Int32, READONLY );
81cdf0e10cSrcweir DECL_PROP1( TYPENAME, ::rtl::OUString, READONLY );
82cdf0e10cSrcweir DECL_PROP2( VALUE, Any, READONLY, BOUND );
83cdf0e10cSrcweir OSL_ENSURE( nPos == nDerivedProperties, "ORowSetColumn::createArrayHelper: inconsistency!" );
84cdf0e10cSrcweir
85cdf0e10cSrcweir Sequence< Property > aRegisteredProperties;
86cdf0e10cSrcweir describeProperties( aRegisteredProperties );
87cdf0e10cSrcweir
88cdf0e10cSrcweir return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDerivedProperties, aRegisteredProperties ), sal_False );
89cdf0e10cSrcweir }
90cdf0e10cSrcweir
91cdf0e10cSrcweir //------------------------------------------------------------------------------
getInfoHelper()92cdf0e10cSrcweir ::cppu::IPropertyArrayHelper& ORowSetColumn::getInfoHelper()
93cdf0e10cSrcweir {
94cdf0e10cSrcweir return *static_cast< ::comphelper::OPropertyArrayUsageHelper< ORowSetColumn >* >(this)->getArrayHelper();
95cdf0e10cSrcweir }
96cdf0e10cSrcweir
97cdf0e10cSrcweir //------------------------------------------------------------------------------
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any & rValue)98cdf0e10cSrcweir void SAL_CALL ORowSetColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )throw (Exception)
99cdf0e10cSrcweir {
100cdf0e10cSrcweir OSL_ENSURE( nHandle != PROPERTY_ID_VALUE, "ORowSetColumn::setFastPropertyValue_NoBroadcast: hmm? This property is marked as READONLY!" );
101cdf0e10cSrcweir if ( nHandle != PROPERTY_ID_VALUE )
102cdf0e10cSrcweir ORowSetDataColumn::setFastPropertyValue_NoBroadcast( nHandle, rValue );
103cdf0e10cSrcweir }
104cdf0e10cSrcweir
105cdf0e10cSrcweir //..............................................................................
106cdf0e10cSrcweir } // namespace dbaccess
107cdf0e10cSrcweir //..............................................................................
108