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 
10 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_TABLE_HXX
11 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_TABLE_HXX
12 
13 #include "Tables.hxx"
14 
15 #include <connectivity/TTableHelper.hxx>
16 
17 namespace connectivity
18 {
19     namespace firebird
20     {
21 
22         /**
23          * Implements sdbcx.Table. We don't support table renaming (XRename)
24          * hence the appropriate methods are overridden.
25          */
26         class Table: public OTableHelper
27         {
28         private:
29             ::osl::Mutex& m_rMutex;
30             sal_Int32 m_nPrivileges;
31 
32             /**
33              * Get the ALTER TABLE [TABLE] ALTER [COLUMN] String.
34              * Includes a trailing space.
35              */
36             OUString getAlterTableColumn(const OUString& rColumn);
37 
38         protected:
39             void construct() override;
40 
41         public:
42             Table(Tables* pTables,
43                   ::osl::Mutex& rMutex,
44                   const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
45             Table(Tables* pTables,
46                   ::osl::Mutex& rMutex,
47                   const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
48                   const OUString& rName,
49                   const OUString& rType,
50                   const OUString& rDescription);
51 
52             // OTableHelper
53             virtual ::connectivity::sdbcx::OCollection* createColumns(
54                 const ::std::vector< OUString>& rNames) override;
55             virtual ::connectivity::sdbcx::OCollection* createKeys(
56                 const ::std::vector< OUString>& rNames) override;
57             virtual ::connectivity::sdbcx::OCollection* createIndexes(
58                 const ::std::vector< OUString>& rNames) override;
59 
60             // XAlterTable
61             /**
62              * See css::sdbcx::ColumnDescriptor for details of
63              * rDescriptor.
64              */
65             virtual void SAL_CALL alterColumnByName(
66                     const OUString& rColName,
67                     const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
68 
69             // XRename -- UNSUPPORTED
70             virtual void SAL_CALL rename(const OUString& sName) override;
71 
72             //XInterface
73             virtual css::uno::Any
74                     SAL_CALL queryInterface(const css::uno::Type & rType) override;
75 
76             //XTypeProvider
77             virtual css::uno::Sequence< css::uno::Type >
78                     SAL_CALL getTypes() override;
79 
80         };
81 
82     } // namespace firebird
83 } // namespace connectivity
84 
85 #endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_TABLE_HXX
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
88