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_CONNECTIVITY_PCOLUMN_HXX
20 #define INCLUDED_CONNECTIVITY_PCOLUMN_HXX
22 #include <sal/config.h>
26 #include <connectivity/dbtoolsdllapi.hxx>
27 #include <connectivity/sdbcx/VColumn.hxx>
28 #include <connectivity/CommonTools.hxx>
29 #include <rtl/ref.hxx>
30 #include <comphelper/proparrhlp.hxx>
32 namespace com::sun::star::container
{ class XNameAccess
; }
33 namespace com::sun::star::sdbc
{ class XDatabaseMetaData
; }
34 namespace com::sun::star::sdbc
{ class XResultSetMetaData
; }
36 namespace connectivity
42 typedef sdbcx::OColumn OParseColumn_BASE
;
43 typedef ::comphelper::OPropertyArrayUsageHelper
<OParseColumn
> OParseColumn_PROP
;
45 class OOO_DLLPUBLIC_DBTOOLS OParseColumn
:
46 public OParseColumn_BASE
, public OParseColumn_PROP
51 bool m_bDbasePrecisionChanged
;
52 bool m_bAggregateFunction
;
56 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const override
;
57 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
59 virtual ~OParseColumn() override
;
61 OParseColumn(const css::uno::Reference
< css::beans::XPropertySet
>& _xColumn
, bool _bCase
);
62 OParseColumn(const OUString
& Name
,
63 const OUString
& TypeName
,
64 const OUString
& DefaultValue
,
65 const OUString
& Description
,
73 const OUString
& CatalogName
,
74 const OUString
& SchemaName
,
75 const OUString
& TableName
);
77 virtual void construct() override
;
79 void setRealName(const OUString
& _rName
) { m_aRealName
= _rName
; }
80 void setLabel(const OUString
& i_sLabel
) { m_sLabel
= i_sLabel
; }
81 void setTableName(const OUString
& _rName
) { m_TableName
= _rName
; }
82 void setFunction(bool _bFunction
) { m_bFunction
= _bFunction
; }
83 void setAggregateFunction(bool _bFunction
) { m_bAggregateFunction
= _bFunction
; }
84 void setIsSearchable( bool _bIsSearchable
) { m_bIsSearchable
= _bIsSearchable
; }
85 const OUString
& getRealName() const { return m_aRealName
; }
87 /** creates a collection of OParseColumn, as described by a result set meta data instance.
89 static ::rtl::Reference
< OSQLColumns
>
90 createColumnsForResultSet(
91 const css::uno::Reference
< css::sdbc::XResultSetMetaData
>& _rxResMetaData
,
92 const css::uno::Reference
< css::sdbc::XDatabaseMetaData
>& _rxDBMetaData
,
93 const css::uno::Reference
< css::container::XNameAccess
>& i_xQueryColumns
96 typedef std::map
<OUString
, int> StringMap
;
97 /** creates a single OParseColumn, as described by a result set meta data instance.
98 The column names are unique.
101 createColumnForResultSet(
102 const css::uno::Reference
< css::sdbc::XResultSetMetaData
>& _rxResMetaData
,
103 const css::uno::Reference
< css::sdbc::XDatabaseMetaData
>& _rxDBMetaData
,
104 sal_Int32 _nColumnPos
,
109 using OParseColumn_BASE::createArrayHelper
;
114 typedef sdbcx::OColumn OOrderColumn_BASE
;
115 typedef ::comphelper::OPropertyArrayUsageHelper
<OOrderColumn
> OOrderColumn_PROP
;
117 class OOO_DLLPUBLIC_DBTOOLS OOrderColumn
:
118 public OOrderColumn_BASE
, public OOrderColumn_PROP
120 const bool m_bAscending
;
123 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const override
;
124 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
126 virtual ~OOrderColumn() override
;
129 const css::uno::Reference
< css::beans::XPropertySet
>& _xColumn
,
130 const OUString
& i_rOriginatingTableName
,
136 const css::uno::Reference
< css::beans::XPropertySet
>& _xColumn
,
141 virtual void construct() override
;
143 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
145 using OOrderColumn_BASE::createArrayHelper
;
150 #endif // INCLUDED_CONNECTIVITY_PCOLUMN_HXX
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */