fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / core / inc / definitioncolumn.hxx
blob0fad23fb64fa9928612ac96e804ef13c10026ae7
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_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX
20 #define INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX
22 #include "apitools.hxx"
23 #include "column.hxx"
24 #include "columnsettings.hxx"
26 #include <com/sun/star/sdbc/DataType.hpp>
27 #include <com/sun/star/sdbc/ColumnValue.hpp>
28 #include <com/sun/star/container/XChild.hpp>
30 #include <comphelper/IdPropArrayHelper.hxx>
31 #include <comphelper/uno3.hxx>
32 #include <cppuhelper/implbase1.hxx>
34 namespace dbaccess
37 typedef ::cppu::ImplHelper1< ::com::sun::star::container::XChild > TXChild;
38 // OTableColumnDescriptor
39 /**
40 * provides the properties for description. A descriptor could be used to create a new table column.
42 class OTableColumnDescriptor : public OColumn
43 ,public OColumnSettings
44 ,public ::comphelper::OPropertyArrayUsageHelper < OTableColumnDescriptor >
45 ,public TXChild
47 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
48 const bool m_bActAsDescriptor;
50 protected:
51 // <properties>
52 OUString m_aTypeName;
53 OUString m_aDescription;
54 OUString m_aDefaultValue;
55 OUString m_aAutoIncrementValue;
56 sal_Int32 m_nType;
57 sal_Int32 m_nPrecision;
58 sal_Int32 m_nScale;
59 sal_Int32 m_nIsNullable;
60 bool m_bAutoIncrement;
61 bool m_bRowVersion;
62 bool m_bCurrency;
63 // </properties>
65 public:
66 OTableColumnDescriptor( const bool _bActAsDescriptor )
67 :OColumn( !_bActAsDescriptor )
68 ,m_bActAsDescriptor( _bActAsDescriptor )
69 ,m_nType( ::com::sun::star::sdbc::DataType::SQLNULL )
70 ,m_nPrecision( 0 )
71 ,m_nScale( 0 )
72 ,m_nIsNullable( ::com::sun::star::sdbc::ColumnValue::NULLABLE_UNKNOWN )
73 ,m_bAutoIncrement( false )
74 ,m_bRowVersion( false )
75 ,m_bCurrency( false )
77 impl_registerProperties();
80 DECLARE_XINTERFACE( )
82 // com::sun::star::lang::XTypeProvider
83 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 // ::com::sun::star::lang::XServiceInfo
86 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 // ::com::sun::star::container::XChild
90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
93 // ::comphelper::OPropertyArrayUsageHelper
94 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE;
96 // ::cppu::OPropertySetHelper
97 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
98 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;
100 private:
101 void impl_registerProperties();
104 // OTableColumn
105 class OTableColumn;
106 typedef ::comphelper::OPropertyArrayUsageHelper < OTableColumn > OTableColumn_PBase;
107 /** describes a column of a table
109 class OTableColumn :public OTableColumnDescriptor
110 ,public OTableColumn_PBase
112 protected:
113 virtual ~OTableColumn();
115 public:
116 OTableColumn(const OUString& _rName);
118 // XTypeProvider
119 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 // XServiceInfo
122 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 // OPropertyArrayUsageHelper
125 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
126 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE;
129 // OQueryColumn
130 class OQueryColumn;
131 typedef ::comphelper::OPropertyArrayUsageHelper< OQueryColumn > OQueryColumn_PBase;
132 /** a column of a Query, with additional information obtained from parsing the query statement
134 class OQueryColumn :public OTableColumnDescriptor
135 ,public OQueryColumn_PBase
137 // <properties>
138 OUString m_sCatalogName;
139 OUString m_sSchemaName;
140 OUString m_sTableName;
141 OUString m_sRealName;
142 OUString m_sLabel;
143 // </properties>
145 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xOriginalTableColumn;
147 protected:
148 virtual ~OQueryColumn();
150 public:
151 OQueryColumn(
152 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxParserColumn,
153 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
154 const OUString &i_sLabel
157 // XTypeProvider
158 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
160 // XServiceInfo
161 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 // *Property*
164 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
165 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const SAL_OVERRIDE;
166 virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const SAL_OVERRIDE;
168 private:
169 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
170 impl_determineOriginalTableColumn(
171 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
174 using ::cppu::OPropertySetHelper::getFastPropertyValue;
177 // OColumnWrapper
179 * describes all properties for a columns of a table. Only the view parts are provided
180 * directly, all the other parts are derived from a driver implementation
182 class OColumnWrapper :public OColumn
184 protected:
185 // definition which is provided by a driver!
186 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
187 m_xAggregate;
189 sal_Int32 m_nColTypeID;
191 protected:
192 OColumnWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rCol, const bool _bNameIsReadOnly );
193 virtual ~OColumnWrapper();
195 public:
196 virtual void SAL_CALL getFastPropertyValue(
197 ::com::sun::star::uno::Any& rValue,
198 sal_Int32 nHandle
199 ) const SAL_OVERRIDE;
200 virtual sal_Bool SAL_CALL convertFastPropertyValue(
201 ::com::sun::star::uno::Any & rConvertedValue,
202 ::com::sun::star::uno::Any & rOldValue,
203 sal_Int32 nHandle,
204 const ::com::sun::star::uno::Any& rValue )
205 throw (::com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE;
206 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
207 sal_Int32 nHandle,
208 const ::com::sun::star::uno::Any& rValue
210 throw (::com::sun::star::uno::Exception, std::exception) SAL_OVERRIDE;
212 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
214 protected:
215 OUString impl_getPropertyNameFromHandle( const sal_Int32 _nHandle ) const;
217 protected:
218 using OColumn::getFastPropertyValue;
221 // OTableColumnDescriptorWrapper
223 * provides the properties for description. A descriptor could be used to create a new table column.
225 class OTableColumnDescriptorWrapper :public OColumnWrapper
226 ,public OColumnSettings
227 ,public ::comphelper::OIdPropertyArrayUsageHelper < OTableColumnDescriptorWrapper >
229 const bool m_bPureWrap;
230 const bool m_bIsDescriptor;
232 public:
233 OTableColumnDescriptorWrapper(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rCol,
234 const bool _bPureWrap, const bool _bIsDescriptor );
236 // com::sun::star::lang::XTypeProvider
237 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
239 // ::com::sun::star::lang::XServiceInfo
240 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
241 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
243 // OIdPropertyArrayUsageHelper
244 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const SAL_OVERRIDE;
246 // cppu::OPropertySetHelper
247 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
248 virtual void SAL_CALL getFastPropertyValue(
249 ::com::sun::star::uno::Any& rValue,
250 sal_Int32 nHandle
251 ) const SAL_OVERRIDE;
252 virtual sal_Bool SAL_CALL convertFastPropertyValue(
253 ::com::sun::star::uno::Any & rConvertedValue,
254 ::com::sun::star::uno::Any & rOldValue,
255 sal_Int32 nHandle,
256 const ::com::sun::star::uno::Any& rValue )
257 throw (::com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE;
258 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
259 sal_Int32 nHandle,
260 const ::com::sun::star::uno::Any& rValue
262 throw (::com::sun::star::uno::Exception, std::exception) SAL_OVERRIDE;
264 protected:
265 using OColumnWrapper::getFastPropertyValue;
268 // OTableColumnWrapper
270 * describes all properties for a columns of a table. Only the view parts are provided
271 * directly, all the other parts are derived from a driver implementation
273 class OTableColumnWrapper :public OTableColumnDescriptorWrapper
274 ,public ::comphelper::OIdPropertyArrayUsageHelper < OTableColumnWrapper >
276 protected:
277 virtual ~OTableColumnWrapper();
279 public:
280 OTableColumnWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rCol,
281 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rColDefintion,
282 const bool _bPureWrap );
284 // ::com::sun::star::lang::XTypeProvider
285 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
287 // ::com::sun::star::lang::XServiceInfo
288 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
289 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
291 // OIdPropertyArrayUsageHelper
292 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
293 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const SAL_OVERRIDE;
296 #endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_DEFINITIONCOLUMN_HXX
298 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */