Use correct object
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_xtable.hxx
blobd1239fff696e4a01544cfff56e01db8142f2410f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #pragma once
39 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
40 #include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
41 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
42 #include <com/sun/star/sdbcx/XRename.hpp>
43 #include <com/sun/star/sdbcx/XAlterTable.hpp>
45 #include "pq_xbase.hxx"
46 #include "pq_xcolumns.hxx"
48 namespace pq_sdbc_driver
51 class Columns;
53 class Table : public ReflectionBase,
54 public css::sdbcx::XColumnsSupplier,
55 public css::sdbcx::XIndexesSupplier,
56 public css::sdbcx::XKeysSupplier,
57 public css::sdbcx::XRename,
58 public css::sdbcx::XAlterTable
60 css::uno::Reference< css::container::XNameAccess > m_columns;
61 css::uno::Reference< css::container::XIndexAccess > m_keys;
62 css::uno::Reference< css::container::XNameAccess > m_indexes;
63 rtl::Reference<Columns> m_pColumns;
65 public:
66 Table( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
67 const css::uno::Reference< css::sdbc::XConnection > & connection,
68 ConnectionSettings *pSettings);
70 // XInterface
71 virtual void SAL_CALL acquire() noexcept override { ReflectionBase::acquire(); }
72 virtual void SAL_CALL release() noexcept override { ReflectionBase::release(); }
73 virtual css::uno::Any SAL_CALL queryInterface(
74 const css::uno::Type & reqType ) override;
76 // XTypeProvider, first implemented by OPropertySetHelper
77 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
78 virtual css::uno::Sequence< sal_Int8> SAL_CALL getImplementationId() override;
80 // XDataDescriptorFactory
81 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL
82 createDataDescriptor( ) override;
84 // XColumnsSupplier
85 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
86 getColumns( ) override;
88 // XIndexesSupplier
89 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
90 getIndexes( ) override;
92 // XKeysSupplier
93 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
94 getKeys( ) override;
96 // XRename
97 virtual void SAL_CALL rename( const OUString& newName ) override;
99 // XAlterTable
100 virtual void SAL_CALL alterColumnByName(
101 const OUString& colName,
102 const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
104 virtual void SAL_CALL alterColumnByIndex(
105 sal_Int32 index,
106 const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
108 // XNamed
109 virtual OUString SAL_CALL getName( ) override;
110 virtual void SAL_CALL setName( const OUString& aName ) override;
114 class TableDescriptor
115 : public ReflectionBase,
116 public css::sdbcx::XColumnsSupplier,
117 public css::sdbcx::XIndexesSupplier,
118 public css::sdbcx::XKeysSupplier
120 rtl::Reference<ColumnDescriptors> m_columns;
121 css::uno::Reference< css::container::XIndexAccess > m_keys;
122 css::uno::Reference< css::container::XNameAccess > m_indexes;
124 public:
125 TableDescriptor(
126 const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
127 const css::uno::Reference< css::sdbc::XConnection > & connection,
128 ConnectionSettings *pSettings);
130 public: // XInterface
131 virtual void SAL_CALL acquire() noexcept override { ReflectionBase::acquire(); }
132 virtual void SAL_CALL release() noexcept override { ReflectionBase::release(); }
133 virtual css::uno::Any SAL_CALL queryInterface(
134 const css::uno::Type & reqType ) override;
136 public: // XTypeProvider, first implemented by OPropertySetHelper
137 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
138 virtual css::uno::Sequence< sal_Int8> SAL_CALL getImplementationId() override;
140 public: // XColumnsSupplier
141 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
142 getColumns( ) override;
144 public: // XIndexesSupplier
145 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
146 getIndexes( ) override;
148 public: // XKeysSupplier
149 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
150 getKeys( ) override;
152 public: // XDataDescriptorFactory
153 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL
154 createDataDescriptor( ) override;
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */