LibreOffice Module dbaccess (master) 1
CRowSetColumn.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#include <stringconstants.hxx>
22#include <strings.hxx>
23#include "CRowSetColumn.hxx"
24
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26
27using namespace ::com::sun::star::uno;
28using namespace ::com::sun::star::sdbc;
29using namespace ::com::sun::star::sdb;
30using namespace ::com::sun::star::beans;
31
32namespace dbaccess
33{
34
35ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData,
36 const Reference < XRow >& _xRow, sal_Int32 _nPos,
37 const Reference< XDatabaseMetaData >& _rxDBMeta,
38 const OUString& _rDescription,
39 const OUString& i_sLabel,
40 const std::function<const ::connectivity::ORowSetValue& (sal_Int32)> &_getValue )
41 :ORowSetDataColumn( _xMetaData, _xRow, nullptr, _nPos, _rxDBMeta, _rDescription, i_sLabel, _getValue )
42{
43}
44
46{
47 css::uno::Sequence< css::beans::Property> aDescriptor
48 {
49 { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
50 { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
51 { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
52 { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
53 { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
55 { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
56 { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND },
57 { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
58 { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
59 { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
60 { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY },
61 { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
62 { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
63 { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
64 { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
65 { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
66 { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
67 { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY },
68 { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY },
69 { PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::BOUND}
70 };
71
72 Sequence< Property > aRegisteredProperties;
73 describeProperties( aRegisteredProperties );
74
75 return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDescriptor, aRegisteredProperties ), false );
76}
77
79{
81}
82
83void SAL_CALL ORowSetColumn::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue )
84{
85 OSL_ENSURE( nHandle != PROPERTY_ID_VALUE, "ORowSetColumn::setFastPropertyValue_NoBroadcast: hmm? This property is marked as READONLY!" );
88}
89
90} // namespace dbaccess
91
92/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::cppu::IPropertyArrayHelper * getArrayHelper()
css::uno::Type const & get()
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
ORowSetColumn(const css::uno::Reference< css::sdbc::XResultSetMetaData > &_xMetaData, const css::uno::Reference< css::sdbc::XRow > &_xRow, sal_Int32 _nPos, const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxDBMeta, const OUString &_rDescription, const OUString &i_sLabel, const std::function< const ::connectivity::ORowSetValue &(sal_Int32)> &_getValue)
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
sal_Int32 nHandle
#define PROPERTY_ID_ISSIGNED
#define PROPERTY_ID_DISPLAYSIZE
#define PROPERTY_ID_ISCASESENSITIVE
#define PROPERTY_ID_TYPE
#define PROPERTY_ID_ISREADONLY
#define PROPERTY_ID_TABLENAME
#define PROPERTY_ID_SERVICENAME
#define PROPERTY_ID_CATALOGNAME
#define PROPERTY_ID_ISWRITABLE
#define PROPERTY_ID_ISROWVERSION
#define PROPERTY_ID_ISSEARCHABLE
#define PROPERTY_ID_ISNULLABLE
#define PROPERTY_ID_PRECISION
#define PROPERTY_ID_LABEL
#define PROPERTY_ID_SCHEMANAME
#define PROPERTY_ID_ISAUTOINCREMENT
#define PROPERTY_ID_ISCURRENCY
#define PROPERTY_ID_TYPENAME
#define PROPERTY_ID_VALUE
#define PROPERTY_ID_ISDEFINITELYWRITABLE
#define PROPERTY_ID_SCALE
constexpr OUStringLiteral PROPERTY_ISAUTOINCREMENT(u"IsAutoIncrement")
constexpr OUStringLiteral PROPERTY_ISCURRENCY(u"IsCurrency")
constexpr OUStringLiteral PROPERTY_ISWRITABLE(u"IsWritable")
constexpr OUStringLiteral PROPERTY_PRECISION(u"Precision")
constexpr OUStringLiteral PROPERTY_SERVICENAME(u"ServiceName")
constexpr OUStringLiteral PROPERTY_ISREADONLY(u"IsReadOnly")
constexpr OUStringLiteral PROPERTY_TYPENAME(u"TypeName")
constexpr OUStringLiteral PROPERTY_LABEL(u"Label")
constexpr OUStringLiteral PROPERTY_ISROWVERSION(u"IsRowVersion")
constexpr OUStringLiteral PROPERTY_ISNULLABLE(u"IsNullable")
constexpr OUStringLiteral PROPERTY_SCHEMANAME(u"SchemaName")
constexpr OUStringLiteral PROPERTY_ISDEFINITELYWRITABLE(u"IsDefinitelyWritable")
constexpr OUStringLiteral PROPERTY_SCALE(u"Scale")
constexpr OUStringLiteral PROPERTY_ISSEARCHABLE(u"IsSearchable")
constexpr OUStringLiteral PROPERTY_TABLENAME(u"TableName")
constexpr OUStringLiteral PROPERTY_DISPLAYSIZE(u"DisplaySize")
constexpr OUStringLiteral PROPERTY_CATALOGNAME(u"CatalogName")
constexpr OUStringLiteral PROPERTY_TYPE(u"Type")
constexpr OUStringLiteral PROPERTY_ISSIGNED(u"IsSigned")
constexpr OUStringLiteral PROPERTY_ISCASESENSITIVE(u"IsCaseSensitive")
constexpr OUStringLiteral PROPERTY_VALUE(u"Value")
sal_Int32 _nPos