merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / core / inc / table.hxx
blobf5c3e38ab72334353b90bf69899d26b0e466d25b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: table.hxx,v $
10 * $Revision: 1.30 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DBA_CORE_TABLE_HXX_
32 #define _DBA_CORE_TABLE_HXX_
34 #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
35 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_
38 #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_SDBCX_XINDEXESSUPPLIER_HPP_
41 #include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
44 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_
47 #include <com/sun/star/sdbcx/XRename.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_SDBCX_XALTERTABLE_HPP_
50 #include <com/sun/star/sdbcx/XAlterTable.hpp>
51 #endif
52 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
53 #include <com/sun/star/lang/XServiceInfo.hpp>
54 #endif
55 #ifndef _COM_SUN_STAR_SDBC_XROW_HPP_
56 #include <com/sun/star/sdbc/XRow.hpp>
57 #endif
58 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
59 #include <com/sun/star/sdbc/XConnection.hpp>
60 #endif
62 #ifndef _CPPUHELPER_COMPBASE2_HXX_
63 #include <cppuhelper/compbase7.hxx>
64 #endif
65 #ifndef _DBASHARED_APITOOLS_HXX_
66 #include "apitools.hxx"
67 #endif
68 #ifndef _DBA_CORE_DATASETTINGS_HXX_
69 #include "datasettings.hxx"
70 #endif
71 #ifndef _DBA_COREAPI_COLUMN_HXX_
72 #include <column.hxx>
73 #endif
74 #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
75 #include <connectivity/CommonTools.hxx>
76 #endif
77 #ifndef CONNECTIVITY_TABLEHELPER_HXX
78 #include <connectivity/TTableHelper.hxx>
79 #endif
80 #ifndef _COMPHELPER_UNO3_HXX_
81 #include <comphelper/uno3.hxx>
82 #endif
83 #ifndef COMPHELPER_IDPROPERTYARRAYUSAGEHELPER_HXX
84 #include <comphelper/IdPropArrayHelper.hxx>
85 #endif
87 namespace dbaccess
90 //==========================================================================
91 //= OTables
92 //==========================================================================
93 class ODBTable;
94 class OContainerMediator;
95 typedef ::comphelper::OIdPropertyArrayUsageHelper< ODBTable > ODBTable_PROP;
96 typedef ::connectivity::OTableHelper OTable_Base;
98 class ODBTable :public ODataSettings_Base
99 ,public ODBTable_PROP
100 ,public OTable_Base
101 ,public IColumnFactory
103 private:
104 ::rtl::Reference< OContainerMediator > m_pColumnMediator;
106 protected:
107 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumnDefinitions;
108 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xDriverColumns;
110 // <properties>
111 sal_Int32 m_nPrivileges;
112 // </properties>
114 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
115 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
117 // IColumnFactory
118 virtual OColumn* createColumn(const ::rtl::OUString& _rName) const;
119 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createColumnDescriptor();
120 virtual void columnAppended( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxSourceDescriptor );
121 virtual void columnDropped(const ::rtl::OUString& _sName);
123 /** creates the column collection for the table
124 @param _rNames
125 The column names.
127 virtual ::connectivity::sdbcx::OCollection* createColumns(const ::connectivity::TStringVector& _rNames);
129 /** creates the key collection for the table
130 @param _rNames
131 The key names.
133 virtual ::connectivity::sdbcx::OCollection* createKeys(const ::connectivity::TStringVector& _rNames);
135 /** creates the index collection for the table
136 @param _rNames
137 The index names.
139 virtual ::connectivity::sdbcx::OCollection* createIndexes(const ::connectivity::TStringVector& _rNames);
141 // OComponentHelper
142 virtual void SAL_CALL disposing(void);
143 public:
144 /** constructs a wrapper supporting the com.sun.star.sdb.Table service.<BR>
145 @param _rxConn the connection the table belongs to
146 @param _rxTable the table from the driver can be null
147 @param _rCatalog the name of the catalog the table belongs to. May be empty.
148 @param _rSchema the name of the schema the table belongs to. May be empty.
149 @param _rName the name of the table
150 @param _rType the type of the table, as supplied by the driver
151 @param _rDesc the description of the table, as supplied by the driver
153 ODBTable(connectivity::sdbcx::OCollection* _pTables
154 ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn
155 ,const ::rtl::OUString& _rCatalog
156 , const ::rtl::OUString& _rSchema
157 , const ::rtl::OUString& _rName
158 ,const ::rtl::OUString& _rType
159 , const ::rtl::OUString& _rDesc
160 ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumnDefinitions)
161 throw(::com::sun::star::sdbc::SQLException);
163 ODBTable(connectivity::sdbcx::OCollection* _pTables
164 ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn)
165 throw(::com::sun::star::sdbc::SQLException);
166 virtual ~ODBTable();
168 // ODescriptor
169 virtual void construct();
171 //XInterface
172 DECLARE_XINTERFACE()
173 //XTypeProvider
174 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
175 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
176 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
178 // ::com::sun::star::lang::XServiceInfo
179 DECLARE_SERVICE_INFO();
181 // com::sun::star::beans::XPropertySet
182 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
183 virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const;
185 // ::com::sun::star::sdbcx::XRename,
186 virtual void SAL_CALL rename( const ::rtl::OUString& _rNewName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
188 // ::com::sun::star::sdbcx::XAlterTable,
189 virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& _rName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDescriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
191 // com::sun::star::lang::XUnoTunnel
192 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
194 private:
195 using OTable_Base::createArrayHelper;
196 using OTable_Base::getFastPropertyValue;
199 #endif // _DBA_CORE_TABLE_HXX_