nss: upgrade to release 3.73
[LibreOffice.git] / include / connectivity / PColumn.hxx
blobf2319ad2a56e745f89df4aef845ffed0f6126f34
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
24 #include <map>
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::parse
38 class OParseColumn;
40 typedef sdbcx::OColumn OParseColumn_BASE;
41 typedef ::comphelper::OPropertyArrayUsageHelper<OParseColumn> OParseColumn_PROP;
43 class OOO_DLLPUBLIC_DBTOOLS OParseColumn :
44 public OParseColumn_BASE, public OParseColumn_PROP
46 OUString m_aRealName;
47 OUString m_sLabel;
48 bool m_bFunction;
49 bool m_bDbasePrecisionChanged;
50 bool m_bAggregateFunction;
51 bool m_bIsSearchable;
53 protected:
54 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
55 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
57 virtual ~OParseColumn() override;
58 public:
59 OParseColumn(const css::uno::Reference< css::beans::XPropertySet>& _xColumn, bool _bCase);
60 OParseColumn(const OUString& Name,
61 const OUString& TypeName,
62 const OUString& DefaultValue,
63 const OUString& Description,
64 sal_Int32 IsNullable,
65 sal_Int32 Precision,
66 sal_Int32 Scale,
67 sal_Int32 Type,
68 bool IsAutoIncrement,
69 bool IsCurrency,
70 bool _bCase,
71 const OUString& CatalogName,
72 const OUString& SchemaName,
73 const OUString& TableName);
75 virtual void construct() override;
77 void setRealName(const OUString& _rName) { m_aRealName = _rName; }
78 void setLabel(const OUString& i_sLabel) { m_sLabel = i_sLabel; }
79 void setTableName(const OUString& _rName) { m_TableName = _rName; }
80 void setFunction(bool _bFunction) { m_bFunction = _bFunction; }
81 void setAggregateFunction(bool _bFunction) { m_bAggregateFunction = _bFunction; }
82 void setIsSearchable( bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; }
83 const OUString& getRealName() const { return m_aRealName; }
85 /** creates a collection of OParseColumn, as described by a result set meta data instance.
87 static ::rtl::Reference< OSQLColumns >
88 createColumnsForResultSet(
89 const css::uno::Reference< css::sdbc::XResultSetMetaData >& _rxResMetaData,
90 const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMetaData,
91 const css::uno::Reference< css::container::XNameAccess>& i_xQueryColumns
94 typedef std::map<OUString, int> StringMap;
95 /** creates a single OParseColumn, as described by a result set meta data instance.
96 The column names are unique.
98 static OParseColumn*
99 createColumnForResultSet(
100 const css::uno::Reference< css::sdbc::XResultSetMetaData >& _rxResMetaData,
101 const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMetaData,
102 sal_Int32 _nColumnPos,
103 StringMap& _rColumns
106 private:
107 using OParseColumn_BASE::createArrayHelper;
110 class OOrderColumn;
112 typedef sdbcx::OColumn OOrderColumn_BASE;
113 typedef ::comphelper::OPropertyArrayUsageHelper<OOrderColumn> OOrderColumn_PROP;
115 class OOrderColumn :
116 public OOrderColumn_BASE, public OOrderColumn_PROP
118 const bool m_bAscending;
120 protected:
121 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
122 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
124 virtual ~OOrderColumn() override;
125 public:
126 OOrderColumn(
127 const css::uno::Reference< css::beans::XPropertySet>& _xColumn,
128 const OUString& i_rOriginatingTableName,
129 bool _bCase,
130 bool _bAscending
133 OOrderColumn(
134 const css::uno::Reference< css::beans::XPropertySet>& _xColumn,
135 bool _bCase,
136 bool _bAscending
139 virtual void construct() override;
141 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
142 private:
143 using OOrderColumn_BASE::createArrayHelper;
148 #endif // INCLUDED_CONNECTIVITY_PCOLUMN_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */