LibreOffice Module connectivity (master) 1
VTable.hxx
Go to the documentation of this file.
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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_CONNECTIVITY_SDBCX_VTABLE_HXX
21#define INCLUDED_CONNECTIVITY_SDBCX_VTABLE_HXX
22
23#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
24#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
25#include <com/sun/star/sdbcx/XRename.hpp>
26#include <com/sun/star/sdbcx/XAlterTable.hpp>
27#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
28#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
34#include <com/sun/star/container/XNamed.hpp>
39
40namespace com::sun::star::sdbc { class XDatabaseMetaData; }
41
42namespace connectivity::sdbcx
43 {
44
45 class OTable;
46 class OCollection;
47
48 typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier,
49 css::sdbcx::XKeysSupplier,
50 css::container::XNamed,
51 css::lang::XServiceInfo> OTableDescriptor_BASE;
52
53 typedef ::cppu::ImplHelper4< css::sdbcx::XDataDescriptorFactory,
54 css::sdbcx::XIndexesSupplier,
55 css::sdbcx::XRename,
56 css::sdbcx::XAlterTable > OTable_BASE;
57
58 typedef ::comphelper::OIdPropertyArrayUsageHelper<OTable> OTable_PROP;
59
60
62 public cppu::BaseMutex,
63 public OTable_BASE,
66 public OTable_PROP,
67 public ODescriptor
68 {
69 protected:
70 OUString m_CatalogName;
71 OUString m_SchemaName;
72 OUString m_Description;
73 OUString m_Type;
74
75 // no Reference! see OCollection::acquire
76 std::unique_ptr<OCollection> m_xKeys;
77 std::unique_ptr<OCollection> m_xColumns;
78 std::unique_ptr<OCollection> m_xIndexes;
79 OCollection* m_pTables; // must hold his own container to notify him when renaming
80
81 using OTableDescriptor_BASE::rBHelper;
82
83 // OPropertyArrayUsageHelper
84 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 _nId ) const override;
85 // OPropertySetHelper
86 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
87 public:
88 OTable( OCollection* _pTables,
89 bool _bCase);
90 OTable( OCollection* _pTables,
91 bool _bCase,
92 const OUString& Name,
93 OUString Type,
94 OUString Description = OUString(),
95 OUString SchemaName = OUString(),
96 OUString CatalogName = OUString());
97
98 virtual ~OTable() override;
99
101 //XInterface
102 virtual void SAL_CALL acquire() noexcept override;
103 virtual void SAL_CALL release() noexcept override;
104 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
105 //XTypeProvider
106 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
107
108 // ODescriptor
109 virtual void construct() override;
110 virtual void refreshColumns() override;
111 virtual void refreshKeys();
112 virtual void refreshIndexes();
113 // ::cppu::OComponentHelper
114 virtual void SAL_CALL disposing() override;
115 // XPropertySet
116 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
117 // XColumnsSupplier
118 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
119 // XKeysSupplier
120 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getKeys( ) override;
121 // XNamed
122 virtual OUString SAL_CALL getName() override;
123 virtual void SAL_CALL setName( const OUString& aName ) override;
124 // XDataDescriptorFactory
125 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override;
126 // XIndexesSupplier
127 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getIndexes( ) override;
128 // XRename
129 virtual void SAL_CALL rename( const OUString& newName ) override;
130 // XAlterTable
131 virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
132 virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
133
134 // helper method
135 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const;
136 };
137
138}
139
140#endif // INCLUDED_CONNECTIVITY_SDBCX_VTABLE_HXX
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< OCollection > m_xIndexes
Definition: VTable.hxx:78
std::unique_ptr< OCollection > m_xKeys
Definition: VTable.hxx:76
std::unique_ptr< OCollection > m_xColumns
Definition: VTable.hxx:77
OCollection * m_pTables
Definition: VTable.hxx:79
OTable(OCollection *_pTables, bool _bCase, const OUString &Name, OUString Type, OUString Description=OUString(), OUString SchemaName=OUString(), OUString CatalogName=OUString())
#define OOO_DLLPUBLIC_DBTOOLS
Type
::comphelper::OIdPropertyArrayUsageHelper< OTable > OTable_PROP
Definition: VTable.hxx:58
::cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier, css::sdbcx::XKeysSupplier, css::container::XNamed, css::lang::XServiceInfo > OTableDescriptor_BASE
Definition: VTable.hxx:46
::cppu::ImplHelper4< css::sdbcx::XDataDescriptorFactory, css::sdbcx::XIndexesSupplier, css::sdbcx::XRename, css::sdbcx::XAlterTable > OTable_BASE
Definition: VTable.hxx:56