build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / dbaccess / source / core / inc / table.hxx
blobcb8d2c106cb014fc21ddbda1de35ff1bb0f48afb
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
23 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
24 #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
25 #include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
26 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
27 #include <com/sun/star/sdbcx/XRename.hpp>
28 #include <com/sun/star/sdbcx/XAlterTable.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/sdbc/XRow.hpp>
31 #include <com/sun/star/sdbc/XConnection.hpp>
33 #include <cppuhelper/compbase7.hxx>
34 #include "apitools.hxx"
35 #include "datasettings.hxx"
36 #include <column.hxx>
37 #include <connectivity/CommonTools.hxx>
38 #include <connectivity/TTableHelper.hxx>
39 #include <comphelper/uno3.hxx>
40 #include <comphelper/IdPropArrayHelper.hxx>
42 namespace dbaccess
45 // OTables
46 class ODBTable;
47 class OContainerMediator;
48 typedef ::comphelper::OIdPropertyArrayUsageHelper< ODBTable > ODBTable_PROP;
49 typedef ::connectivity::OTableHelper OTable_Base;
51 class ODBTable :public ODataSettings_Base
52 ,public ODBTable_PROP
53 ,public OTable_Base
54 ,public IColumnFactory
56 private:
57 ::rtl::Reference< OContainerMediator > m_pColumnMediator;
59 protected:
60 css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions;
61 css::uno::Reference< css::container::XNameAccess > m_xDriverColumns;
63 // <properties>
64 sal_Int32 m_nPrivileges;
65 // </properties>
67 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
68 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
70 // IColumnFactory
71 virtual OColumn* createColumn(const OUString& _rName) const override;
72 virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override;
73 virtual void columnAppended( const css::uno::Reference< css::beans::XPropertySet >& _rxSourceDescriptor ) override;
74 virtual void columnDropped(const OUString& _sName) override;
76 /** creates the column collection for the table
77 @param _rNames
78 The column names.
80 virtual ::connectivity::sdbcx::OCollection* createColumns(const ::connectivity::TStringVector& _rNames) override;
82 /** creates the key collection for the table
83 @param _rNames
84 The key names.
86 virtual ::connectivity::sdbcx::OCollection* createKeys(const ::connectivity::TStringVector& _rNames) override;
88 /** creates the index collection for the table
89 @param _rNames
90 The index names.
92 virtual ::connectivity::sdbcx::OCollection* createIndexes(const ::connectivity::TStringVector& _rNames) override;
94 // OComponentHelper
95 virtual void SAL_CALL disposing() override;
96 public:
97 /** constructs a wrapper supporting the com.sun.star.sdb.Table service.<BR>
98 @param _rxConn the connection the table belongs to
99 @param _rxTable the table from the driver can be null
100 @param _rCatalog the name of the catalog the table belongs to. May be empty.
101 @param _rSchema the name of the schema the table belongs to. May be empty.
102 @param _rName the name of the table
103 @param _rType the type of the table, as supplied by the driver
104 @param _rDesc the description of the table, as supplied by the driver
105 @throws css::sdbc::SQLException
107 ODBTable(connectivity::sdbcx::OCollection* _pTables
108 ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn
109 ,const OUString& _rCatalog
110 , const OUString& _rSchema
111 , const OUString& _rName
112 ,const OUString& _rType
113 , const OUString& _rDesc
114 ,const css::uno::Reference< css::container::XNameAccess >& _rxColumnDefinitions)
115 throw(css::sdbc::SQLException);
117 /// @throws css::sdbc::SQLException
118 ODBTable(connectivity::sdbcx::OCollection* _pTables
119 ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn)
120 throw(css::sdbc::SQLException);
121 virtual ~ODBTable() override;
123 // ODescriptor
124 virtual void construct() override;
126 //XInterface
127 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw (css::uno::RuntimeException, std::exception) override;
128 //XTypeProvider
129 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override;
130 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override;
131 static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
133 // css::lang::XServiceInfo
134 DECLARE_SERVICE_INFO();
136 // css::beans::XPropertySet
137 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle) const override;
139 // css::sdbcx::XRename,
140 virtual void SAL_CALL rename( const OUString& _rNewName ) throw(css::sdbc::SQLException, css::container::ElementExistException, css::uno::RuntimeException, std::exception) override;
142 // css::sdbcx::XAlterTable,
143 virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) throw(css::sdbc::SQLException, css::container::NoSuchElementException, css::uno::RuntimeException, std::exception) override;
145 // css::lang::XUnoTunnel
146 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) throw(css::uno::RuntimeException, std::exception) override;
148 private:
149 using OTable_Base::createArrayHelper;
150 using OTable_Base::getFastPropertyValue;
153 #endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */