1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/config.h>
27 #include <cppuhelper/implbase1.hxx>
28 #include <rtl/ref.hxx>
29 #include <com/sun/star/sdbc/XConnection.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/container/XContainerListener.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include "FilteredContainer.hxx"
34 #include "RefreshListener.hxx"
39 class OContainerMediator
;
41 class OTableContainer
: public OFilteredContainer
,
42 public ::cppu::ImplHelper1
< css::container::XContainerListener
>
44 css::uno::Reference
< css::container::XNameContainer
> m_xTableDefinitions
;
45 ::rtl::Reference
< OContainerMediator
> m_pTableMediator
;
48 virtual void addMasterContainerListener() override
;
49 virtual void removeMasterContainerListener() override
;
50 virtual OUString
getTableTypeRestriction() const override
;
52 // ::connectivity::sdbcx::OCollection
53 virtual connectivity::sdbcx::ObjectType
createObject(const OUString
& _rName
) override
;
54 virtual css::uno::Reference
< css::beans::XPropertySet
> createDescriptor() override
;
55 virtual connectivity::sdbcx::ObjectType
appendObject( const OUString
& _rForName
, const css::uno::Reference
< css::beans::XPropertySet
>& descriptor
) override
;
56 virtual void dropObject(sal_Int32 _nPos
, const OUString
& _sElementName
) override
;
58 virtual void disposing() override
;
60 // css::lang::XServiceInfo
61 DECLARE_SERVICE_INFO();
64 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
66 virtual void SAL_CALL
elementInserted( const css::container::ContainerEvent
& Event
) override
;
67 virtual void SAL_CALL
elementRemoved( const css::container::ContainerEvent
& Event
) override
;
68 virtual void SAL_CALL
elementReplaced( const css::container::ContainerEvent
& Event
) override
;
71 virtual void SAL_CALL
acquire() noexcept override
{ OFilteredContainer::acquire();}
72 virtual void SAL_CALL
release() noexcept override
{ OFilteredContainer::release();}
74 /** ctor of the container. The parent has to support the <type scope="css::sdbc">XConnection</type>
76 @param _rParent the object which acts as parent for the container.
77 all refcounting is rerouted to this object
78 @param _rMutex the access safety object of the parent
79 @param _rTableFilter restricts the visible tables by name
80 @param _rTableTypeFilter restricts the visible tables by type
83 OTableContainer( ::cppu::OWeakObject
& _rParent
,
84 ::osl::Mutex
& _rMutex
,
85 const css::uno::Reference
< css::sdbc::XConnection
>& _xCon
,
87 const css::uno::Reference
< css::container::XNameContainer
>& _xTableDefinitions
,
88 IRefreshListener
* _pRefreshListener
,
89 std::atomic
<std::size_t>& _nInAppend
92 virtual ~OTableContainer() override
;
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */