bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / connectivity / sdbcx / VTable.hxx
blob706700f878e9a70bd93d1bbe68e89ac382770247
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_CONNECTIVITY_SDBCX_VTABLE_HXX
21 #define INCLUDED_CONNECTIVITY_SDBCX_VTABLE_HXX
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>
30 #include <comphelper/IdPropArrayHelper.hxx>
31 #include <cppuhelper/compbase.hxx>
32 #include <cppuhelper/implbase4.hxx>
33 #include <cppuhelper/basemutex.hxx>
34 #include <com/sun/star/container/XNamed.hpp>
35 #include <connectivity/sdbcx/IRefreshable.hxx>
36 #include <connectivity/sdbcx/VDescriptor.hxx>
37 #include <connectivity/CommonTools.hxx>
38 #include <connectivity/dbtoolsdllapi.hxx>
40 namespace com::sun::star::sdbc { class XDatabaseMetaData; }
42 namespace connectivity
44 namespace sdbcx
47 class OTable;
48 class OCollection;
50 typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier,
51 css::sdbcx::XKeysSupplier,
52 css::container::XNamed,
53 css::lang::XServiceInfo> OTableDescriptor_BASE;
55 typedef ::cppu::ImplHelper4< css::sdbcx::XDataDescriptorFactory,
56 css::sdbcx::XIndexesSupplier,
57 css::sdbcx::XRename,
58 css::sdbcx::XAlterTable > OTable_BASE;
60 typedef ::comphelper::OIdPropertyArrayUsageHelper<OTable> OTable_PROP;
63 class OOO_DLLPUBLIC_DBTOOLS OTable :
64 public cppu::BaseMutex,
65 public OTable_BASE,
66 public OTableDescriptor_BASE,
67 public IRefreshableColumns,
68 public OTable_PROP,
69 public ODescriptor
71 protected:
72 OUString m_CatalogName;
73 OUString m_SchemaName;
74 OUString m_Description;
75 OUString m_Type;
77 rtl::Reference<OCollection> m_xKeys;
78 rtl::Reference<OCollection> m_xColumns;
79 rtl::Reference<OCollection> m_xIndexes;
80 OCollection* m_pTables; // must hold his own container to notify him when renaming
82 using OTableDescriptor_BASE::rBHelper;
84 // OPropertyArrayUsageHelper
85 virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 _nId ) const override;
86 // OPropertySetHelper
87 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
88 public:
89 OTable( OCollection* _pTables,
90 bool _bCase);
91 OTable( OCollection* _pTables,
92 bool _bCase,
93 const OUString& Name,
94 const OUString& Type,
95 const OUString& Description = OUString(),
96 const OUString& SchemaName = OUString(),
97 const OUString& CatalogName = OUString());
99 virtual ~OTable() override;
101 DECLARE_SERVICE_INFO();
102 //XInterface
103 virtual void SAL_CALL acquire() throw() override;
104 virtual void SAL_CALL release() throw() override;
105 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
106 //XTypeProvider
107 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
109 // ODescriptor
110 virtual void construct() override;
111 virtual void refreshColumns() override;
112 virtual void refreshKeys();
113 virtual void refreshIndexes();
114 // ::cppu::OComponentHelper
115 virtual void SAL_CALL disposing() override;
116 // XPropertySet
117 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
118 // XColumnsSupplier
119 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
120 // XKeysSupplier
121 virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getKeys( ) override;
122 // XNamed
123 virtual OUString SAL_CALL getName() override;
124 virtual void SAL_CALL setName( const OUString& aName ) override;
125 // XDataDescriptorFactory
126 virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor() override;
127 // XIndexesSupplier
128 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getIndexes( ) override;
129 // XRename
130 virtual void SAL_CALL rename( const OUString& newName ) override;
131 // XAlterTable
132 virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
133 virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
135 // helper method
136 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const;
141 #endif // INCLUDED_CONNECTIVITY_SDBCX_VTABLE_HXX
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */