LibreOffice Module connectivity (master) 1
PColumn.hxx
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#ifndef INCLUDED_CONNECTIVITY_PCOLUMN_HXX
20#define INCLUDED_CONNECTIVITY_PCOLUMN_HXX
21
22#include <sal/config.h>
23
24#include <map>
25
29#include <rtl/ref.hxx>
31
32namespace com::sun::star::container { class XNameAccess; }
33namespace com::sun::star::sdbc { class XDatabaseMetaData; }
34namespace com::sun::star::sdbc { class XResultSetMetaData; }
35
37 {
38 class OParseColumn;
39
41 typedef ::comphelper::OPropertyArrayUsageHelper<OParseColumn> OParseColumn_PROP;
42
45 {
46 OUString m_aRealName;
47 OUString m_sLabel;
52
53 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
54 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
55
56 virtual ~OParseColumn() override;
57 public:
58 OParseColumn(const css::uno::Reference< css::beans::XPropertySet>& _xColumn, bool _bCase);
59 OParseColumn(const OUString& Name,
60 const OUString& TypeName,
61 const OUString& DefaultValue,
62 const OUString& Description,
63 sal_Int32 IsNullable,
64 sal_Int32 Precision,
65 sal_Int32 Scale,
66 sal_Int32 Type,
67 bool IsAutoIncrement,
68 bool IsCurrency,
69 bool _bCase,
70 const OUString& CatalogName,
71 const OUString& SchemaName,
72 const OUString& TableName);
73
74 virtual void construct() override;
75
76 void setRealName(const OUString& _rName) { m_aRealName = _rName; }
77 void setLabel(const OUString& i_sLabel) { m_sLabel = i_sLabel; }
78 void setTableName(const OUString& _rName) { m_TableName = _rName; }
79 void setFunction(bool _bFunction) { m_bFunction = _bFunction; }
80 void setAggregateFunction(bool _bFunction) { m_bAggregateFunction = _bFunction; }
81 void setIsSearchable( bool _bIsSearchable ) { m_bIsSearchable = _bIsSearchable; }
82 const OUString& getRealName() const { return m_aRealName; }
83
86 static ::rtl::Reference< OSQLColumns >
87 createColumnsForResultSet(
88 const css::uno::Reference< css::sdbc::XResultSetMetaData >& _rxResMetaData,
89 const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMetaData,
90 const css::uno::Reference< css::container::XNameAccess>& i_xQueryColumns
91 );
92
93 typedef std::map<OUString, int> StringMap;
98 createColumnForResultSet(
99 const css::uno::Reference< css::sdbc::XResultSetMetaData >& _rxResMetaData,
100 const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMetaData,
101 sal_Int32 _nColumnPos,
102 StringMap& _rColumns
103 );
104
105 private:
107 };
108
109 class OOrderColumn;
110
112 typedef ::comphelper::OPropertyArrayUsageHelper<OOrderColumn> OOrderColumn_PROP;
113
114 class OOrderColumn final :
116 {
117 const bool m_bAscending;
118
119 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
120 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
121
122 virtual ~OOrderColumn() override;
123 public:
125 const css::uno::Reference< css::beans::XPropertySet>& _xColumn,
126 const OUString& i_rOriginatingTableName,
127 bool _bCase,
128 bool _bAscending
129 );
130
132 const css::uno::Reference< css::beans::XPropertySet>& _xColumn,
133 bool _bCase,
134 bool _bAscending
135 );
136
137 virtual void construct() override;
138
139 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
140 private:
142 };
143
144}
145
146#endif // INCLUDED_CONNECTIVITY_PCOLUMN_HXX
147
148/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OOrderColumn(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, const OUString &i_rOriginatingTableName, bool _bCase, bool _bAscending)
virtual void construct() override
Definition: PColumn.cxx:248
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: PColumn.cxx:259
OOrderColumn(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, bool _bCase, bool _bAscending)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: PColumn.cxx:265
virtual ~OOrderColumn() override
Definition: PColumn.cxx:243
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Definition: PColumn.cxx:254
void setIsSearchable(bool _bIsSearchable)
Definition: PColumn.hxx:81
OParseColumn(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, bool _bCase)
void setLabel(const OUString &i_sLabel)
Definition: PColumn.hxx:77
void setFunction(bool _bFunction)
Definition: PColumn.hxx:79
void setRealName(const OUString &_rName)
Definition: PColumn.hxx:76
std::map< OUString, int > StringMap
Definition: PColumn.hxx:93
void setAggregateFunction(bool _bFunction)
Definition: PColumn.hxx:80
void setTableName(const OUString &_rName)
Definition: PColumn.hxx:78
const OUString & getRealName() const
Definition: PColumn.hxx:82
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 _nId) const override
Definition: VColumn.cxx:108
#define OOO_DLLPUBLIC_DBTOOLS
Type
sdbcx::OColumn OOrderColumn_BASE
Definition: PColumn.hxx:109
::comphelper::OPropertyArrayUsageHelper< OOrderColumn > OOrderColumn_PROP
Definition: PColumn.hxx:112
sdbcx::OColumn OParseColumn_BASE
Definition: PColumn.hxx:38
::comphelper::OPropertyArrayUsageHelper< OParseColumn > OParseColumn_PROP
Definition: PColumn.hxx:41