LibreOffice Module connectivity (master) 1
pq_xtable.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * Effective License of whole file:
5 *
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.
9 *
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.
14 *
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
19 *
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
21 *
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
24 *
25 * Copyright: 2000 by Sun Microsystems, Inc.
26 *
27 * Contributor(s): Joerg Budischewski
28 *
29 * All parts contributed on or after August 2011:
30 *
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/.
34 *
35 ************************************************************************/
36
37#pragma once
38
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>
44
45#include "pq_xbase.hxx"
46#include "pq_xcolumns.hxx"
47
48namespace pq_sdbc_driver
49{
50
51class Columns;
52
53class 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
59{
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;
64
65public:
66 Table( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
67 const css::uno::Reference< css::sdbc::XConnection > & connection,
68 ConnectionSettings *pSettings);
69
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;
75
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;
79
80 // XDataDescriptorFactory
81 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL
82 createDataDescriptor( ) override;
83
84 // XColumnsSupplier
85 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
86 getColumns( ) override;
87
88 // XIndexesSupplier
89 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
90 getIndexes( ) override;
91
92 // XKeysSupplier
93 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
94 getKeys( ) override;
95
96 // XRename
97 virtual void SAL_CALL rename( const OUString& newName ) override;
98
99 // XAlterTable
100 virtual void SAL_CALL alterColumnByName(
101 const OUString& colName,
102 const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
103
104 virtual void SAL_CALL alterColumnByIndex(
105 sal_Int32 index,
106 const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
107
108 // XNamed
109 virtual OUString SAL_CALL getName( ) override;
110 virtual void SAL_CALL setName( const OUString& aName ) override;
111};
112
113
115 : public ReflectionBase,
116 public css::sdbcx::XColumnsSupplier,
117 public css::sdbcx::XIndexesSupplier,
118 public css::sdbcx::XKeysSupplier
119{
120 css::uno::Reference< css::container::XNameAccess > m_columns;
121 css::uno::Reference< css::container::XIndexAccess > m_keys;
122 css::uno::Reference< css::container::XNameAccess > m_indexes;
123
124public:
126 const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
127 const css::uno::Reference< css::sdbc::XConnection > & connection,
128 ConnectionSettings *pSettings);
129
130public: // 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;
135
136public: // 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;
139
140public: // XColumnsSupplier
141 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
142 getColumns( ) override;
143
144public: // XIndexesSupplier
145 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL
146 getIndexes( ) override;
147
148public: // XKeysSupplier
149 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL
150 getKeys( ) override;
151
152public: // XDataDescriptorFactory
153 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL
154 createDataDescriptor( ) override;
155};
156
157
158}
159
160
161/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL release() noexcept override
Definition: pq_xbase.hxx:84
virtual void SAL_CALL acquire() noexcept override
Definition: pq_xbase.hxx:83
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getKeys() override
Definition: pq_xtable.cxx:339
TableDescriptor(const ::rtl::Reference< comphelper::RefCountedMutex > &refMutex, const css::uno::Reference< css::sdbc::XConnection > &connection, ConnectionSettings *pSettings)
Definition: pq_xtable.cxx:304
css::uno::Reference< css::container::XNameAccess > m_columns
Definition: pq_xtable.hxx:120
css::uno::Reference< css::container::XNameAccess > m_indexes
Definition: pq_xtable.hxx:122
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getIndexes() override
Definition: pq_xtable.cxx:327
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override
Definition: pq_xtable.cxx:381
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: pq_xtable.cxx:352
css::uno::Reference< css::container::XIndexAccess > m_keys
Definition: pq_xtable.hxx:121
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: pq_xtable.cxx:363
virtual void SAL_CALL acquire() noexcept override
Definition: pq_xtable.hxx:131
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns() override
Definition: pq_xtable.cxx:318
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &reqType) override
Definition: pq_xtable.cxx:368
virtual void SAL_CALL release() noexcept override
Definition: pq_xtable.hxx:132
virtual void SAL_CALL setName(const OUString &aName) override
Definition: pq_xtable.cxx:298
virtual void SAL_CALL alterColumnByName(const OUString &colName, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
css::uno::Reference< css::container::XNameAccess > m_columns
Definition: pq_xtable.hxx:60
virtual OUString SAL_CALL getName() override
Definition: pq_xtable.cxx:290
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override
Definition: pq_xtable.cxx:84
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &reqType) override
virtual void SAL_CALL alterColumnByIndex(sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
Definition: pq_xtable.cxx:241
css::uno::Reference< css::container::XNameAccess > m_indexes
Definition: pq_xtable.hxx:62
css::uno::Reference< css::container::XIndexAccess > m_keys
Definition: pq_xtable.hxx:61
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns() override
Definition: pq_xtable.cxx:93
Table(const ::rtl::Reference< comphelper::RefCountedMutex > &refMutex, const css::uno::Reference< css::sdbc::XConnection > &connection, ConnectionSettings *pSettings)
virtual void SAL_CALL release() noexcept override
Definition: pq_xtable.hxx:72
virtual void SAL_CALL acquire() noexcept override
Definition: pq_xtable.hxx:71
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: pq_xtable.cxx:270
virtual void SAL_CALL rename(const OUString &newName) override
Definition: pq_xtable.cxx:136
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getKeys() override
Definition: pq_xtable.cxx:122
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getIndexes() override
Definition: pq_xtable.cxx:108
rtl::Reference< Columns > m_pColumns
Definition: pq_xtable.hxx:63
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: pq_xtable.cxx:257