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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
21 #define INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
23 #include <cppuhelper/implbase1.hxx>
24 #include <com/sun/star/container/XEnumerationAccess.hpp>
25 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <com/sun/star/container/XIndexAccess.hpp>
27 #include <com/sun/star/util/XRefreshable.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
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 <connectivity/warningscontainer.hxx>
35 #include "RefreshListener.hxx"
36 #include "apitools.hxx"
40 typedef ::cppu::ImplHelper1
< css::container::XContainerListener
> OTableContainer_Base
;
43 class OContainerMediator
;
45 class OTableContainer
: public OFilteredContainer
,
46 public OTableContainer_Base
48 css::uno::Reference
< css::container::XNameContainer
> m_xTableDefinitions
;
49 ::rtl::Reference
< OContainerMediator
> m_pTableMediator
;
50 bool m_bInDrop
; // set when we are in the drop method
53 virtual void addMasterContainerListener() override
;
54 virtual void removeMasterContainerListener() override
;
55 virtual OUString
getTableTypeRestriction() const override
;
57 // ::connectivity::sdbcx::OCollection
58 virtual connectivity::sdbcx::ObjectType
createObject(const OUString
& _rName
) override
;
59 virtual css::uno::Reference
< css::beans::XPropertySet
> createDescriptor() override
;
60 virtual connectivity::sdbcx::ObjectType
appendObject( const OUString
& _rForName
, const css::uno::Reference
< css::beans::XPropertySet
>& descriptor
) override
;
61 virtual void dropObject(sal_Int32 _nPos
, const OUString
& _sElementName
) override
;
63 virtual void SAL_CALL
disposing() override
;
65 virtual void SAL_CALL
acquire() throw() override
{ OFilteredContainer::acquire();}
66 virtual void SAL_CALL
release() throw() override
{ OFilteredContainer::release();}
67 // css::lang::XServiceInfo
68 DECLARE_SERVICE_INFO();
71 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) throw (css::uno::RuntimeException
, std::exception
) override
;
73 virtual void SAL_CALL
elementInserted( const css::container::ContainerEvent
& Event
) throw (css::uno::RuntimeException
, std::exception
) override
;
74 virtual void SAL_CALL
elementRemoved( const css::container::ContainerEvent
& Event
) throw (css::uno::RuntimeException
, std::exception
) override
;
75 virtual void SAL_CALL
elementReplaced( const css::container::ContainerEvent
& Event
) throw (css::uno::RuntimeException
, std::exception
) override
;
78 /** ctor of the container. The parent has to support the <type scope="css::sdbc">XConnection</type>
80 @param _rParent the object which acts as parent for the container.
81 all refcounting is rerouted to this object
82 @param _rMutex the access safety object of the parent
83 @param _rTableFilter restricts the visible tables by name
84 @param _rTableTypeFilter restricts the visible tables by type
87 OTableContainer( ::cppu::OWeakObject
& _rParent
,
88 ::osl::Mutex
& _rMutex
,
89 const css::uno::Reference
< css::sdbc::XConnection
>& _xCon
,
91 const css::uno::Reference
< css::container::XNameContainer
>& _xTableDefinitions
,
92 IRefreshListener
* _pRefreshListener
,
93 ::dbtools::WarningsContainer
* _pWarningsContainer
,
94 oslInterlockedCount
& _nInAppend
97 virtual ~OTableContainer() override
;
100 #endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_TABLECONTAINER_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */