From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sat, 27 Apr 2024 18:51:28 +0200
Subject: Adding upstream version 1:7.0.4.
Signed-off-by: Daniel Baumann
---
dbaccess/source/core/inc/ContainerMediator.hxx | 82 ++++
dbaccess/source/core/inc/ContentHelper.hxx | 185 +++++++
dbaccess/source/core/inc/DatabaseDataProvider.hxx | 273 +++++++++++
dbaccess/source/core/inc/FilteredContainer.hxx | 139 ++++++
dbaccess/source/core/inc/ModelImpl.hxx | 545 +++++++++++++++++++++
dbaccess/source/core/inc/PropertyForward.hxx | 72 +++
dbaccess/source/core/inc/RefreshListener.hxx | 45 ++
.../source/core/inc/SingleSelectQueryComposer.hxx | 262 ++++++++++
dbaccess/source/core/inc/TableDeco.hxx | 166 +++++++
dbaccess/source/core/inc/View.hxx | 74 +++
dbaccess/source/core/inc/bookmarkcontainer.hxx | 151 ++++++
dbaccess/source/core/inc/callablestatement.hxx | 82 ++++
dbaccess/source/core/inc/column.hxx | 219 +++++++++
dbaccess/source/core/inc/columnsettings.hxx | 91 ++++
dbaccess/source/core/inc/commandbase.hxx | 53 ++
dbaccess/source/core/inc/composertools.hxx | 124 +++++
dbaccess/source/core/inc/containerapprove.hxx | 60 +++
dbaccess/source/core/inc/databasecontext.hxx | 191 ++++++++
dbaccess/source/core/inc/datasettings.hxx | 80 +++
dbaccess/source/core/inc/definitioncolumn.hxx | 293 +++++++++++
dbaccess/source/core/inc/definitioncontainer.hxx | 325 ++++++++++++
dbaccess/source/core/inc/documentevents.hxx | 78 +++
dbaccess/source/core/inc/migrwarndlg.hxx | 27 +
dbaccess/source/core/inc/object.hxx | 33 ++
dbaccess/source/core/inc/objectnameapproval.hxx | 78 +++
dbaccess/source/core/inc/preparedstatement.hxx | 107 ++++
dbaccess/source/core/inc/querycomposer.hxx | 93 ++++
dbaccess/source/core/inc/querycontainer.hxx | 167 +++++++
.../source/core/inc/recovery/dbdocrecovery.hxx | 74 +++
dbaccess/source/core/inc/sdbcoretools.hxx | 58 +++
dbaccess/source/core/inc/statement.hxx | 182 +++++++
dbaccess/source/core/inc/table.hxx | 142 ++++++
dbaccess/source/core/inc/tablecontainer.hxx | 97 ++++
dbaccess/source/core/inc/veto.hxx | 58 +++
dbaccess/source/core/inc/viewcontainer.hxx | 96 ++++
35 files changed, 4802 insertions(+)
create mode 100644 dbaccess/source/core/inc/ContainerMediator.hxx
create mode 100644 dbaccess/source/core/inc/ContentHelper.hxx
create mode 100644 dbaccess/source/core/inc/DatabaseDataProvider.hxx
create mode 100644 dbaccess/source/core/inc/FilteredContainer.hxx
create mode 100644 dbaccess/source/core/inc/ModelImpl.hxx
create mode 100644 dbaccess/source/core/inc/PropertyForward.hxx
create mode 100644 dbaccess/source/core/inc/RefreshListener.hxx
create mode 100644 dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
create mode 100644 dbaccess/source/core/inc/TableDeco.hxx
create mode 100644 dbaccess/source/core/inc/View.hxx
create mode 100644 dbaccess/source/core/inc/bookmarkcontainer.hxx
create mode 100644 dbaccess/source/core/inc/callablestatement.hxx
create mode 100644 dbaccess/source/core/inc/column.hxx
create mode 100644 dbaccess/source/core/inc/columnsettings.hxx
create mode 100644 dbaccess/source/core/inc/commandbase.hxx
create mode 100644 dbaccess/source/core/inc/composertools.hxx
create mode 100644 dbaccess/source/core/inc/containerapprove.hxx
create mode 100644 dbaccess/source/core/inc/databasecontext.hxx
create mode 100644 dbaccess/source/core/inc/datasettings.hxx
create mode 100644 dbaccess/source/core/inc/definitioncolumn.hxx
create mode 100644 dbaccess/source/core/inc/definitioncontainer.hxx
create mode 100644 dbaccess/source/core/inc/documentevents.hxx
create mode 100644 dbaccess/source/core/inc/migrwarndlg.hxx
create mode 100644 dbaccess/source/core/inc/object.hxx
create mode 100644 dbaccess/source/core/inc/objectnameapproval.hxx
create mode 100644 dbaccess/source/core/inc/preparedstatement.hxx
create mode 100644 dbaccess/source/core/inc/querycomposer.hxx
create mode 100644 dbaccess/source/core/inc/querycontainer.hxx
create mode 100644 dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
create mode 100644 dbaccess/source/core/inc/sdbcoretools.hxx
create mode 100644 dbaccess/source/core/inc/statement.hxx
create mode 100644 dbaccess/source/core/inc/table.hxx
create mode 100644 dbaccess/source/core/inc/tablecontainer.hxx
create mode 100644 dbaccess/source/core/inc/veto.hxx
create mode 100644 dbaccess/source/core/inc/viewcontainer.hxx
(limited to 'dbaccess/source/core/inc')
diff --git a/dbaccess/source/core/inc/ContainerMediator.hxx b/dbaccess/source/core/inc/ContainerMediator.hxx
new file mode 100644
index 000000000..8d1bf9d8d
--- /dev/null
+++ b/dbaccess/source/core/inc/ContainerMediator.hxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+ The caller is responsible for ensuring the lifetime of the object pointed to by this parameter.
+ */
+ OQueryContainer(
+ const css::uno::Reference< css::container::XNameContainer >& _rxCommandDefinitions,
+ const css::uno::Reference< css::sdbc::XConnection >& _rxConn,
+ const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
+ ::dbtools::WarningsContainer* _pWarnings
+ );
+
+ void init();
+
+ public:
+ static rtl::Reference create(
+ const css::uno::Reference< css::container::XNameContainer >& _rxCommandDefinitions,
+ const css::uno::Reference< css::sdbc::XConnection >& _rxConn,
+ const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
+ ::dbtools::WarningsContainer* _pWarnings
+ );
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+ DECLARE_SERVICE_INFO();
+
+ // css::container::XContainerListener
+ virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
+
+ // XContainerApproveListener
+ virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveInsertElement( const css::container::ContainerEvent& Event ) override;
+ virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveReplaceElement( const css::container::ContainerEvent& Event ) override;
+ virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveRemoveElement( const css::container::ContainerEvent& Event ) override;
+
+ // css::lang::XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // css::sdbcx::XDataDescriptorFactory
+ virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
+
+ // css::sdbcx::XAppend
+ virtual void SAL_CALL appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
+
+ // css::sdbcx::XDrop
+ virtual void SAL_CALL dropByName( const OUString& elementName ) override;
+ virtual void SAL_CALL dropByIndex( sal_Int32 index ) override;
+
+ // css::container::XElementAccess
+ virtual sal_Bool SAL_CALL hasElements( ) override;
+ // css::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) override;
+ // css::container::XNameAccess
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
+
+ private:
+ // OContentHelper overridables
+ virtual OUString determineContentType() const override;
+
+ // helper
+ /** create a query object wrapping a CommandDefinition given by name. To retrieve the object, the CommandDescription
+ container will be asked for the given name.
+ The returned object is acquired once.
+ */
+ css::uno::Reference< css::ucb::XContent > implCreateWrapper(const OUString& _rName);
+ /// create a query object wrapping a CommandDefinition. The returned object is acquired once.
+ css::uno::Reference< css::ucb::XContent > implCreateWrapper(const css::uno::Reference< css::ucb::XContent >& _rxCommandDesc);
+
+ };
+} // namespace dbaccess
+
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_QUERYCONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
new file mode 100644
index 000000000..c5dadce45
--- /dev/null
+++ b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX
+
+#include
+#include
+#include
+
+#include
+#include
+
+namespace dbaccess
+{
+
+ // DatabaseDocumentRecovery
+ struct DatabaseDocumentRecovery_Data;
+ class DatabaseDocumentRecovery
+ {
+ public:
+ DatabaseDocumentRecovery(
+ const css::uno::Reference< css::uno::XComponentContext >& i_rContext
+ );
+ ~DatabaseDocumentRecovery();
+
+ /** saves the modified sub components of the given controller(s) to the "recovery" sub storage of the document
+ storage.
+
+ @throws css::uno::Exception
+ in case of an error.
+ */
+ void saveModifiedSubComponents(
+ const css::uno::Reference< css::embed::XStorage >& i_rTargetStorage,
+ const std::vector< css::uno::Reference< css::frame::XController > >& i_rControllers
+ );
+
+ /** recovery sub components from the given document storage, if applicable
+
+ If the given document storage does not contain a recovery folder, the method silently returns.
+
+ @throws css::uno::Exception
+ in case of an error.
+ */
+ void recoverSubDocuments(
+ const css::uno::Reference< css::embed::XStorage >& i_rDocumentStorage,
+ const css::uno::Reference< css::frame::XController >& i_rTargetController
+ );
+
+ private:
+ const std::unique_ptr< DatabaseDocumentRecovery_Data > m_pData;
+ };
+
+} // namespace dbaccess
+
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_RECOVERY_DBDOCRECOVERY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx
new file mode 100644
index 000000000..41097c676
--- /dev/null
+++ b/dbaccess/source/core/inc/sdbcoretools.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX
+
+#include
+#include
+
+namespace dbaccess
+{
+
+ void notifyDataSourceModified(const css::uno::Reference< css::uno::XInterface >& _rxObject);
+
+ css::uno::Reference< css::uno::XInterface >
+ getDataSource( const css::uno::Reference< css::uno::XInterface >& _rxDependentObject );
+
+ /** retrieves a to-be-displayed string for a given caught exception;
+ */
+ OUString extractExceptionMessage( const css::uno::Reference< css::uno::XComponentContext >& _rContext, const css::uno::Any& _rError );
+
+ namespace tools
+ {
+ namespace stor
+ {
+ bool storageIsWritable_nothrow(
+ const css::uno::Reference< css::embed::XStorage >& _rxStorage
+ );
+
+ /// commits a given storage if it's not readonly
+ bool commitStorageIfWriteable(
+ const css::uno::Reference< css::embed::XStorage >& _rxStorage
+ );
+ }
+
+ }
+
+} // namespace dbaccess
+
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_SDBCORETOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/statement.hxx b/dbaccess/source/core/inc/statement.hxx
new file mode 100644
index 000000000..2024bb0de
--- /dev/null
+++ b/dbaccess/source/core/inc/statement.hxx
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+// OStatementBase
+
+class OStatementBase : public cppu::BaseMutex,
+ public OSubComponent,
+ public ::cppu::OPropertySetHelper,
+ public ::comphelper::OPropertyArrayUsageHelper < OStatementBase >,
+ public css::util::XCancellable,
+ public css::sdbc::XWarningsSupplier,
+ public css::sdbc::XPreparedBatchExecution,
+ public css::sdbc::XMultipleResults,
+ public css::sdbc::XCloseable,
+ public css::sdbc::XGeneratedResultSet
+{
+protected:
+ ::osl::Mutex m_aCancelMutex;
+
+ css::uno::WeakReferenceHelper m_aResultSet;
+ css::uno::Reference< css::beans::XPropertySet > m_xAggregateAsSet;
+ css::uno::Reference< css::util::XCancellable > m_xAggregateAsCancellable;
+ bool m_bUseBookmarks;
+ bool m_bEscapeProcessing;
+
+ virtual ~OStatementBase() override;
+
+public:
+ OStatementBase(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ const css::uno::Reference< css::uno::XInterface > & _xStatement);
+
+
+// css::lang::XTypeProvider
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+
+// css::uno::XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
+ virtual void SAL_CALL acquire() throw() override;
+ virtual void SAL_CALL release() throw() override;
+
+// OComponentHelper
+ virtual void SAL_CALL disposing() override;
+
+// css::beans::XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+// comphelper::OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
+
+// cppu::OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ virtual sal_Bool SAL_CALL convertFastPropertyValue(
+ css::uno::Any & rConvertedValue,
+ css::uno::Any & rOldValue,
+ sal_Int32 nHandle,
+ const css::uno::Any& rValue ) override;
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 nHandle,
+ const css::uno::Any& rValue
+ ) override;
+ virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle ) const override;
+
+// css::sdbc::XWarningsSupplier
+ virtual css::uno::Any SAL_CALL getWarnings( ) override;
+ virtual void SAL_CALL clearWarnings( ) override;
+
+// css::util::XCancellable
+ virtual void SAL_CALL cancel( ) override;
+
+// css::sdbc::XCloseable
+ virtual void SAL_CALL close( ) override;
+
+// css::sdbc::XMultipleResults
+ virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
+ virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
+ virtual sal_Bool SAL_CALL getMoreResults( ) override;
+
+// css::sdbc::XPreparedBatchExecution
+ virtual void SAL_CALL addBatch( ) override;
+ virtual void SAL_CALL clearBatch( ) override;
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
+// css::sdbc::XGeneratedResultSet
+ virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getGeneratedValues( ) override;
+
+// Helper
+ void disposeResultSet();
+
+protected:
+ using ::cppu::OPropertySetHelper::getFastPropertyValue;
+};
+
+
+// OStatement
+
+typedef ::cppu::ImplHelper3 < css::sdbc::XStatement
+ , css::lang::XServiceInfo
+ , css::sdbc::XBatchExecution
+ > OStatement_IFACE;
+class OStatement :public OStatementBase
+ ,public OStatement_IFACE
+{
+private:
+ css::uno::Reference< css::sdbc::XStatement > m_xAggregateStatement;
+ css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposer;
+ bool m_bAttemptedComposerCreation;
+
+public:
+ OStatement(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ const css::uno::Reference< css::uno::XInterface > & _xStatement);
+
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+// css::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName( ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
+
+// css::sdbc::XStatement
+ virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( const OUString& sql ) override;
+ virtual sal_Int32 SAL_CALL executeUpdate( const OUString& sql ) override;
+ virtual sal_Bool SAL_CALL execute( const OUString& sql ) override;
+ virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing() override;
+
+ // XBatchExecution
+ virtual void SAL_CALL addBatch( const OUString& sql ) override;
+ virtual void SAL_CALL clearBatch( ) override;
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
+
+ using OStatementBase::addBatch;
+
+private:
+ /** does escape processing for the given SQL command, if the our EscapeProcessing
+ property allows so.
+ */
+ OUString impl_doEscapeProcessing_nothrow( const OUString& _rSQL ) const;
+ bool impl_ensureComposer_nothrow() const;
+};
+
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_STATEMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx
new file mode 100644
index 000000000..ec851f3b5
--- /dev/null
+++ b/dbaccess/source/core/inc/table.hxx
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
+
+#include
+
+#include "datasettings.hxx"
+#include "column.hxx"
+#include
+#include
+#include
+
+namespace dbaccess
+{
+
+ // OTables
+ class ODBTable;
+ class OContainerMediator;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper< ODBTable > ODBTable_PROP;
+ typedef ::connectivity::OTableHelper OTable_Base;
+
+ class ODBTable :public ODataSettings_Base
+ ,public ODBTable_PROP
+ ,public OTable_Base
+ ,public IColumnFactory
+ {
+ private:
+ ::rtl::Reference< OContainerMediator > m_pColumnMediator;
+
+ protected:
+ css::uno::Reference< css::container::XNameAccess > m_xColumnDefinitions;
+ css::uno::Reference< css::container::XNameAccess > m_xDriverColumns;
+
+ //
+ sal_Int32 m_nPrivileges;
+ //
+
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+
+ // IColumnFactory
+ virtual OColumn* createColumn(const OUString& _rName) const override;
+ virtual css::uno::Reference< css::beans::XPropertySet > createColumnDescriptor() override;
+ virtual void columnAppended( const css::uno::Reference< css::beans::XPropertySet >& _rxSourceDescriptor ) override;
+ virtual void columnDropped(const OUString& _sName) override;
+
+ /** creates the column collection for the table
+ @param _rNames
+ The column names.
+ */
+ virtual ::connectivity::sdbcx::OCollection* createColumns(const ::std::vector< OUString>& _rNames) override;
+
+ /** creates the key collection for the table
+ @param _rNames
+ The key names.
+ */
+ virtual ::connectivity::sdbcx::OCollection* createKeys(const ::std::vector< OUString>& _rNames) override;
+
+ /** creates the index collection for the table
+ @param _rNames
+ The index names.
+ */
+ virtual ::connectivity::sdbcx::OCollection* createIndexes(const ::std::vector< OUString>& _rNames) override;
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing() override;
+ public:
+ /** constructs a wrapper supporting the com.sun.star.sdb.Table service.
+ @param _rxConn the connection the table belongs to
+ @param _rxTable the table from the driver can be null
+ @param _rCatalog the name of the catalog the table belongs to. May be empty.
+ @param _rSchema the name of the schema the table belongs to. May be empty.
+ @param _rName the name of the table
+ @param _rType the type of the table, as supplied by the driver
+ @param _rDesc the description of the table, as supplied by the driver
+ @throws css::sdbc::SQLException
+ */
+ ODBTable(connectivity::sdbcx::OCollection* _pTables
+ ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn
+ ,const OUString& _rCatalog
+ , const OUString& _rSchema
+ , const OUString& _rName
+ ,const OUString& _rType
+ , const OUString& _rDesc
+ ,const css::uno::Reference< css::container::XNameAccess >& _rxColumnDefinitions);
+
+ /// @throws css::sdbc::SQLException
+ ODBTable(connectivity::sdbcx::OCollection* _pTables
+ ,const css::uno::Reference< css::sdbc::XConnection >& _rxConn);
+ virtual ~ODBTable() override;
+
+ // ODescriptor
+ virtual void construct() override;
+
+ //XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
+ //XTypeProvider
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
+
+ // css::lang::XServiceInfo
+ DECLARE_SERVICE_INFO();
+
+ // css::beans::XPropertySet
+ virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle) const override;
+
+ // css::sdbcx::XRename,
+ virtual void SAL_CALL rename( const OUString& _rNewName ) override;
+
+ // css::sdbcx::XAlterTable,
+ virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) override;
+
+ // css::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
+
+ private:
+ using OTable_Base::createArrayHelper;
+ using OTable_Base::getFastPropertyValue;
+ };
+}
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/tablecontainer.hxx b/dbaccess/source/core/inc/tablecontainer.hxx
new file mode 100644
index 000000000..d2a70af2b
--- /dev/null
+++ b/dbaccess/source/core/inc/tablecontainer.hxx
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
+
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include "FilteredContainer.hxx"
+#include "RefreshListener.hxx"
+
+namespace dbaccess
+{
+ // OTableContainer
+ class OContainerMediator;
+
+ class OTableContainer : public OFilteredContainer,
+ public ::cppu::ImplHelper1< css::container::XContainerListener>
+ {
+ css::uno::Reference< css::container::XNameContainer > m_xTableDefinitions;
+ ::rtl::Reference< OContainerMediator > m_pTableMediator;
+
+ // OFilteredContainer
+ virtual void addMasterContainerListener() override;
+ virtual void removeMasterContainerListener() override;
+ virtual OUString getTableTypeRestriction() const override;
+
+ // ::connectivity::sdbcx::OCollection
+ virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
+ virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
+ virtual connectivity::sdbcx::ObjectType appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
+ virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override;
+
+ virtual void disposing() override;
+
+ // css::lang::XServiceInfo
+ DECLARE_SERVICE_INFO();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
+
+ public:
+ virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();}
+ virtual void SAL_CALL release() throw() override { OFilteredContainer::release();}
+
+ /** ctor of the container. The parent has to support the XConnection
+ interface.
+ @param _rParent the object which acts as parent for the container.
+ all refcounting is rerouted to this object
+ @param _rMutex the access safety object of the parent
+ @param _rTableFilter restricts the visible tables by name
+ @param _rTableTypeFilter restricts the visible tables by type
+ @see construct
+ */
+ OTableContainer( ::cppu::OWeakObject& _rParent,
+ ::osl::Mutex& _rMutex,
+ const css::uno::Reference< css::sdbc::XConnection >& _xCon,
+ bool _bCase,
+ const css::uno::Reference< css::container::XNameContainer >& _xTableDefinitions,
+ IRefreshListener* _pRefreshListener,
+ std::atomic& _nInAppend
+ );
+
+ virtual ~OTableContainer() override;
+ };
+}
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/veto.hxx b/dbaccess/source/core/inc/veto.hxx
new file mode 100644
index 000000000..63a0748b2
--- /dev/null
+++ b/dbaccess/source/core/inc/veto.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX
+
+#include
+
+#include
+
+namespace dbaccess
+{
+
+ // Veto
+ typedef ::cppu::WeakImplHelper< css::util::XVeto
+ > Veto_Base;
+ /** implements css::util::XVeto
+ */
+ class Veto : public Veto_Base
+ {
+ private:
+ const css::uno::Any m_aDetails;
+
+ public:
+ Veto( const css::uno::Any& _rDetails );
+
+ virtual OUString SAL_CALL getReason() override;
+ virtual css::uno::Any SAL_CALL getDetails() override;
+
+ protected:
+ virtual ~Veto() override;
+
+ private:
+ Veto( const Veto& ) = delete;
+ Veto& operator=( const Veto& ) = delete;
+ };
+
+} // namespace dbaccess
+
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_VETO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/inc/viewcontainer.hxx b/dbaccess/source/core/inc/viewcontainer.hxx
new file mode 100644
index 000000000..12d7f7480
--- /dev/null
+++ b/dbaccess/source/core/inc/viewcontainer.hxx
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX
+#define INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX
+
+#include
+
+#include
+#include
+
+#include
+
+#include
+#include
+
+#include "FilteredContainer.hxx"
+
+namespace dbtools
+{
+ class WarningsContainer;
+}
+
+namespace dbaccess
+{
+ // OViewContainer
+ class OViewContainer : public OFilteredContainer,
+ public ::cppu::ImplHelper1< css::container::XContainerListener>
+ {
+ public:
+ /** ctor of the container. The parent has to support the XConnection
+ interface.
+ @param _rParent the object which acts as parent for the container.
+ all refcounting is rerouted to this object
+ @param _rMutex the access safety object of the parent
+ @param _rTableFilter restricts the visible tables by name
+ @param _rTableTypeFilter restricts the visible tables by type
+ @see construct
+ */
+ OViewContainer( ::cppu::OWeakObject& _rParent,
+ ::osl::Mutex& _rMutex,
+ const css::uno::Reference< css::sdbc::XConnection >& _xCon,
+ bool _bCase,
+ IRefreshListener* _pRefreshListener,
+ std::atomic& _nInAppend
+ );
+
+ virtual ~OViewContainer() override;
+
+ protected:
+ // OFilteredContainer overridables
+ virtual OUString getTableTypeRestriction() const override;
+
+ private:
+ virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();}
+ virtual void SAL_CALL release() throw() override { OFilteredContainer::release();}
+ // css::lang::XServiceInfo
+ DECLARE_SERVICE_INFO();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+ // XContainerListener
+ virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
+ virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
+
+ // ::connectivity::sdbcx::OCollection
+ virtual ::connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
+ virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
+ virtual connectivity::sdbcx::ObjectType appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
+ virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override;
+
+ using OFilteredContainer::disposing;
+
+ bool m_bInElementRemoved;
+ };
+}
+#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_VIEWCONTAINER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
cgit v1.2.3