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 _DBA_CORE_TABLECONTAINER_HXX_
21 #define _DBA_CORE_TABLECONTAINER_HXX_
23 #include <cppuhelper/implbase1.hxx>
24 #include <comphelper/stl_types.hxx>
25 #include <com/sun/star/container/XEnumerationAccess.hpp>
26 #include <com/sun/star/container/XNameAccess.hpp>
27 #include <com/sun/star/container/XIndexAccess.hpp>
28 #include <com/sun/star/util/XRefreshable.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/uno/Sequence.hxx>
31 #include <com/sun/star/sdbc/XConnection.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/container/XContainerListener.hpp>
34 #include <com/sun/star/container/XNameContainer.hpp>
35 #include "FilteredContainer.hxx"
36 #include <connectivity/warningscontainer.hxx>
37 #include "RefreshListener.hxx"
38 #include "apitools.hxx"
42 typedef ::cppu::ImplHelper1
< ::com::sun::star::container::XContainerListener
> OTableContainer_Base
;
44 //==========================================================================
46 //==========================================================================
47 class OContainerMediator
;
49 class OTableContainer
: public OFilteredContainer
,
50 public OTableContainer_Base
52 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> m_xTableDefinitions
;
53 ::rtl::Reference
< OContainerMediator
> m_pTableMediator
;
54 sal_Bool m_bInDrop
; // set when we are in the drop method
58 virtual void addMasterContainerListener();
59 virtual void removeMasterContainerListener();
60 virtual ::rtl::OUString
getTableTypeRestriction() const;
62 // ::connectivity::sdbcx::OCollection
63 virtual connectivity::sdbcx::ObjectType
createObject(const ::rtl::OUString
& _rName
);
64 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> createDescriptor();
65 virtual connectivity::sdbcx::ObjectType
appendObject( const ::rtl::OUString
& _rForName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& descriptor
);
66 virtual void dropObject(sal_Int32 _nPos
,const ::rtl::OUString _sElementName
);
68 virtual void SAL_CALL
disposing();
70 inline virtual void SAL_CALL
acquire() throw(){ OFilteredContainer::acquire();}
71 inline virtual void SAL_CALL
release() throw(){ OFilteredContainer::release();}
72 // ::com::sun::star::lang::XServiceInfo
73 DECLARE_SERVICE_INFO();
76 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
78 virtual void SAL_CALL
elementInserted( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
79 virtual void SAL_CALL
elementRemoved( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
elementReplaced( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
83 /** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type>
85 @param _rParent the object which acts as parent for the container.
86 all refcounting is rerouted to this object
87 @param _rMutex the access safety object of the parent
88 @param _rTableFilter restricts the visible tables by name
89 @param _rTableTypeFilter restricts the visible tables by type
92 OTableContainer( ::cppu::OWeakObject
& _rParent
,
93 ::osl::Mutex
& _rMutex
,
94 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xCon
,
96 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>& _xTableDefinitions
,
97 IRefreshListener
* _pRefreshListener
,
98 ::dbtools::IWarningsContainer
* _pWarningsContainer
,
99 oslInterlockedCount
& _nInAppend
102 virtual ~OTableContainer();
105 #endif // _DBA_CORE_TABLECONTAINER_HXX_
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */