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 .
21 #include "dbastrings.hrc"
22 #include "apitools.hxx"
23 #include "CRowSetColumn.hxx"
25 #include <com/sun/star/sdb/XColumn.hpp>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
28 #include <comphelper/types.hxx>
29 #include <cppuhelper/typeprovider.hxx>
31 using namespace ::com::sun::star::uno
;
32 using namespace ::com::sun::star::sdbc
;
33 using namespace ::com::sun::star::sdb
;
34 using namespace ::com::sun::star::beans
;
39 ORowSetColumn::ORowSetColumn( const Reference
< XResultSetMetaData
>& _xMetaData
,
40 const Reference
< XRow
>& _xRow
, sal_Int32 _nPos
,
41 const Reference
< XDatabaseMetaData
>& _rxDBMeta
,
42 const OUString
& _rDescription
,
43 const OUString
& i_sLabel
,
44 const boost::function
< const ::connectivity::ORowSetValue
& ( sal_Int32
) > &_getValue
)
45 :ORowSetDataColumn( _xMetaData
, _xRow
, NULL
, _nPos
, _rxDBMeta
, _rDescription
, i_sLabel
, _getValue
)
49 ::cppu::IPropertyArrayHelper
* ORowSetColumn::createArrayHelper( ) const
51 BEGIN_PROPERTY_SEQUENCE(21)
53 DECL_PROP1( CATALOGNAME
, OUString
, READONLY
);
54 DECL_PROP1( DISPLAYSIZE
, sal_Int32
, READONLY
);
55 DECL_PROP1_BOOL( ISAUTOINCREMENT
, READONLY
);
56 DECL_PROP1_BOOL( ISCASESENSITIVE
, READONLY
);
57 DECL_PROP1_BOOL( ISCURRENCY
, READONLY
);
58 DECL_PROP1_BOOL( ISDEFINITELYWRITABLE
, READONLY
);
59 DECL_PROP1( ISNULLABLE
, sal_Int32
, READONLY
);
60 DECL_PROP1_BOOL( ISREADONLY
, BOUND
);
61 DECL_PROP1_BOOL( ISROWVERSION
, READONLY
);
62 DECL_PROP1_BOOL( ISSEARCHABLE
, READONLY
);
63 DECL_PROP1_BOOL( ISSIGNED
, READONLY
);
64 DECL_PROP1_BOOL( ISWRITABLE
, READONLY
);
65 DECL_PROP1( LABEL
, OUString
, READONLY
);
66 DECL_PROP1( PRECISION
, sal_Int32
, READONLY
);
67 DECL_PROP1( SCALE
, sal_Int32
, READONLY
);
68 DECL_PROP1( SCHEMANAME
, OUString
, READONLY
);
69 DECL_PROP1( SERVICENAME
, OUString
, READONLY
);
70 DECL_PROP1( TABLENAME
, OUString
, READONLY
);
71 DECL_PROP1( TYPE
, sal_Int32
, READONLY
);
72 DECL_PROP1( TYPENAME
, OUString
, READONLY
);
73 DECL_PROP2( VALUE
, Any
, READONLY
, BOUND
);
75 END_PROPERTY_SEQUENCE()
77 Sequence
< Property
> aRegisteredProperties
;
78 describeProperties( aRegisteredProperties
);
80 return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDescriptor
, aRegisteredProperties
), sal_False
);
83 ::cppu::IPropertyArrayHelper
& ORowSetColumn::getInfoHelper()
85 return *static_cast< ::comphelper::OPropertyArrayUsageHelper
< ORowSetColumn
>* >(this)->getArrayHelper();
88 void SAL_CALL
ORowSetColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
,const Any
& rValue
)throw (Exception
, std::exception
)
90 OSL_ENSURE( nHandle
!= PROPERTY_ID_VALUE
, "ORowSetColumn::setFastPropertyValue_NoBroadcast: hmm? This property is marked as READONLY!" );
91 if ( nHandle
!= PROPERTY_ID_VALUE
)
92 ORowSetDataColumn::setFastPropertyValue_NoBroadcast( nHandle
, rValue
);
95 } // namespace dbaccess
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */