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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_API_CROWSETDATACOLUMN_HXX
20 #define INCLUDED_DBACCESS_SOURCE_CORE_API_CROWSETDATACOLUMN_HXX
22 #include "datacolumn.hxx"
23 #include "RowSetRow.hxx"
24 #include "columnsettings.hxx"
26 #include <connectivity/CommonTools.hxx>
27 #include <comphelper/proparrhlp.hxx>
29 #include <boost/function.hpp>
33 class ORowSetDataColumn
;
34 typedef ::comphelper::OPropertyArrayUsageHelper
<ORowSetDataColumn
> ORowSetDataColumn_PROP
;
36 class ORowSetDataColumn
: public ODataColumn
,
37 public OColumnSettings
,
38 public ORowSetDataColumn_PROP
41 const boost::function
< const ::connectivity::ORowSetValue
& ( sal_Int32
) > m_pGetValue
;
42 ::com::sun::star::uno::Any m_aOldValue
;
45 OUString m_aDescription
; // description
47 virtual ~ORowSetDataColumn();
49 ORowSetDataColumn(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
>& _xMetaData
,
50 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRow
>& _xRow
,
51 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowUpdate
>& _xRowUpdate
,
53 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDatabaseMetaData
>& _rxDBMeta
,
54 const OUString
& _rDescription
,
55 const OUString
& i_sLabel
,
56 const boost::function
< const ::connectivity::ORowSetValue
& ( sal_Int32
) > &_getValue
);
59 // com::sun::star::lang::XTypeProvider
60 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
61 // comphelper::OPropertyArrayUsageHelper
62 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper( ) const SAL_OVERRIDE
;
64 // cppu::OPropertySetHelper
65 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
67 virtual sal_Bool SAL_CALL
convertFastPropertyValue( ::com::sun::star::uno::Any
& rConvertedValue
,
68 ::com::sun::star::uno::Any
& rOldValue
,
70 const ::com::sun::star::uno::Any
& rValue
) throw (::com::sun::star::lang::IllegalArgumentException
) SAL_OVERRIDE
;
71 virtual void SAL_CALL
getFastPropertyValue( ::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const SAL_OVERRIDE
;
72 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
,const ::com::sun::star::uno::Any
& rValue
)throw (::com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
74 virtual void fireValueChange(const ::connectivity::ORowSetValue
& _rOldValue
) SAL_OVERRIDE
;
76 using ODataColumn::getFastPropertyValue
;
79 typedef connectivity::sdbcx::OCollection ORowSetDataColumns_BASE
;
80 class ORowSetDataColumns
: public ORowSetDataColumns_BASE
82 ::rtl::Reference
< ::connectivity::OSQLColumns
> m_aColumns
;
84 virtual connectivity::sdbcx::ObjectType
createObject(const OUString
& _rName
) SAL_OVERRIDE
;
85 virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
89 const ::rtl::Reference
< ::connectivity::OSQLColumns
>& _rColumns
,
90 ::cppu::OWeakObject
& _rParent
,
91 ::osl::Mutex
& _rMutex
,
92 const ::std::vector
< OUString
> &_rVector
94 virtual ~ORowSetDataColumns();
95 // only the name is identical to ::cppu::OComponentHelper
96 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
97 void assign(const ::rtl::Reference
< ::connectivity::OSQLColumns
>& _rColumns
,const ::std::vector
< OUString
> &_rVector
);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */