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 _CONNECTIVITY_PCOLUMN_HXX_
20 #define _CONNECTIVITY_PCOLUMN_HXX_
22 #include "connectivity/dbtoolsdllapi.hxx"
23 #include "connectivity/sdbcx/VColumn.hxx"
24 #include "connectivity/CommonTools.hxx"
25 #include <rtl/ref.hxx>
26 #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
27 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
28 #include <com/sun/star/container/XNameAccess.hpp>
29 #include <comphelper/proparrhlp.hxx>
31 namespace connectivity
37 typedef sdbcx::OColumn OParseColumn_BASE
;
38 typedef ::comphelper::OPropertyArrayUsageHelper
<OParseColumn
> OParseColumn_PROP
;
40 class OOO_DLLPUBLIC_DBTOOLS OParseColumn
:
41 public OParseColumn_BASE
, public OParseColumn_PROP
46 sal_Bool m_bDbasePrecisionChanged
;
47 sal_Bool m_bAggregateFunction
;
48 sal_Bool m_bIsSearchable
;
51 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const;
52 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
54 virtual ~OParseColumn();
56 OParseColumn(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _xColumn
,sal_Bool _bCase
);
57 OParseColumn(const OUString
& _Name
,
58 const OUString
& _TypeName
,
59 const OUString
& _DefaultValue
,
60 const OUString
& _Description
,
61 sal_Int32 _IsNullable
,
65 sal_Bool _IsAutoIncrement
,
68 const OUString
& _CatalogName
,
69 const OUString
& _SchemaName
,
70 const OUString
& _TableName
);
72 virtual void construct();
74 void setRealName(const OUString
& _rName
) { m_aRealName
= _rName
; }
75 void setLabel(const OUString
& i_sLabel
) { m_sLabel
= i_sLabel
; }
76 void setTableName(const OUString
& _rName
) { m_TableName
= _rName
; }
77 void setFunction(sal_Bool _bFunction
) { m_bFunction
= _bFunction
; }
78 void setAggregateFunction(sal_Bool _bFunction
) { m_bAggregateFunction
= _bFunction
; }
79 void setIsSearchable( sal_Bool _bIsSearchable
) { m_bIsSearchable
= _bIsSearchable
; }
80 void setDbasePrecisionChanged(sal_Bool _bDbasePrecisionChanged
) { m_bDbasePrecisionChanged
= _bDbasePrecisionChanged
; }
82 const OUString
& getRealName() const { return m_aRealName
; }
83 const OUString
& getLabel() const { return m_sLabel
; }
84 const OUString
& getTableName() const { return m_TableName
; }
85 sal_Bool
getFunction() const { return m_bFunction
; }
86 sal_Bool
getDbasePrecisionChanged() const { return m_bDbasePrecisionChanged
; }
89 /** creates a collection of OParseColumn, as described by a result set meta data instance.
91 static ::rtl::Reference
< OSQLColumns
>
92 createColumnsForResultSet(
93 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
>& _rxResMetaData
,
94 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDatabaseMetaData
>& _rxDBMetaData
,
95 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
>& i_xQueryColumns
98 DECLARE_STL_USTRINGACCESS_MAP(int,StringMap
);
99 /** creates a single OParseColumn, as described by a result set meta data instance.
100 The column names are unique.
103 createColumnForResultSet(
104 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSetMetaData
>& _rxResMetaData
,
105 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDatabaseMetaData
>& _rxDBMetaData
,
106 sal_Int32 _nColumnPos
,
111 using OParseColumn_BASE::createArrayHelper
;
116 typedef sdbcx::OColumn OOrderColumn_BASE
;
117 typedef ::comphelper::OPropertyArrayUsageHelper
<OOrderColumn
> OOrderColumn_PROP
;
119 class OOO_DLLPUBLIC_DBTOOLS OOrderColumn
:
120 public OOrderColumn_BASE
, public OOrderColumn_PROP
122 const sal_Bool m_bAscending
;
125 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const;
126 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
128 virtual ~OOrderColumn();
131 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _xColumn
,
132 const OUString
& i_rOriginatingTableName
,
138 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _xColumn
,
143 virtual void construct();
145 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
147 using OOrderColumn_BASE::createArrayHelper
;
152 #endif //_CONNECTIVITY_PCOLUMN_HXX_
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */