1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _DBA_CORE_VIEWCONTAINER_HXX_ 25cdf0e10cSrcweir #define _DBA_CORE_VIEWCONTAINER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE1_HXX_ 28cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #ifndef _COMPHELPER_STLTYPES_HXX_ 31cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_ 35cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 36cdf0e10cSrcweir #endif 37cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ 38cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp> 39cdf0e10cSrcweir #endif 40cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_ 41cdf0e10cSrcweir #include <com/sun/star/util/XRefreshable.hpp> 42cdf0e10cSrcweir #endif 43cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ 44cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 45cdf0e10cSrcweir #endif 46cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ 47cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 48cdf0e10cSrcweir #endif 49cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ 50cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 51cdf0e10cSrcweir #endif 52cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_ 53cdf0e10cSrcweir #include <com/sun/star/sdbc/SQLWarning.hpp> 54cdf0e10cSrcweir #endif 55cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ 56cdf0e10cSrcweir #include <com/sun/star/sdb/SQLContext.hpp> 57cdf0e10cSrcweir #endif 58cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_ 59cdf0e10cSrcweir #include <com/sun/star/container/XContainerListener.hpp> 60cdf0e10cSrcweir #endif 61cdf0e10cSrcweir #ifndef _DBASHARED_APITOOLS_HXX_ 62cdf0e10cSrcweir #include "apitools.hxx" 63cdf0e10cSrcweir #endif 64cdf0e10cSrcweir 65cdf0e10cSrcweir #ifndef DBACCESS_CORE_FILTERED_CONTAINER_HXX 66cdf0e10cSrcweir #include "FilteredContainer.hxx" 67cdf0e10cSrcweir #endif 68cdf0e10cSrcweir 69cdf0e10cSrcweir namespace dbtools 70cdf0e10cSrcweir { 71cdf0e10cSrcweir class IWarningsContainer; 72cdf0e10cSrcweir } 73cdf0e10cSrcweir 74cdf0e10cSrcweir namespace dbaccess 75cdf0e10cSrcweir { 76cdf0e10cSrcweir typedef ::cppu::ImplHelper1< ::com::sun::star::container::XContainerListener> OViewContainer_Base; 77cdf0e10cSrcweir 78cdf0e10cSrcweir //========================================================================== 79cdf0e10cSrcweir //= OViewContainer 80cdf0e10cSrcweir //========================================================================== 81cdf0e10cSrcweir class OViewContainer : public OFilteredContainer, 82cdf0e10cSrcweir public OViewContainer_Base 83cdf0e10cSrcweir { 84cdf0e10cSrcweir public: 85cdf0e10cSrcweir /** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type> 86cdf0e10cSrcweir interface.<BR> 87cdf0e10cSrcweir @param _rParent the object which acts as parent for the container. 88cdf0e10cSrcweir all refcounting is rerouted to this object 89cdf0e10cSrcweir @param _rMutex the access safety object of the parent 90cdf0e10cSrcweir @param _rTableFilter restricts the visible tables by name 91cdf0e10cSrcweir @param _rTableTypeFilter restricts the visible tables by type 92cdf0e10cSrcweir @see construct 93cdf0e10cSrcweir */ 94cdf0e10cSrcweir OViewContainer( ::cppu::OWeakObject& _rParent, 95cdf0e10cSrcweir ::osl::Mutex& _rMutex, 96cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon, 97cdf0e10cSrcweir sal_Bool _bCase, 98cdf0e10cSrcweir IRefreshListener* _pRefreshListener, 99cdf0e10cSrcweir ::dbtools::IWarningsContainer* _pWarningsContainer, 100cdf0e10cSrcweir oslInterlockedCount& _nInAppend 101cdf0e10cSrcweir ); 102cdf0e10cSrcweir 103cdf0e10cSrcweir virtual ~OViewContainer(); 104cdf0e10cSrcweir 105cdf0e10cSrcweir protected: 106cdf0e10cSrcweir // OFilteredContainer overridables 107cdf0e10cSrcweir virtual ::rtl::OUString getTableTypeRestriction() const; 108cdf0e10cSrcweir 109cdf0e10cSrcweir private: acquire()110cdf0e10cSrcweir inline virtual void SAL_CALL acquire() throw(){ OFilteredContainer::acquire();} release()111cdf0e10cSrcweir inline virtual void SAL_CALL release() throw(){ OFilteredContainer::release();} 112cdf0e10cSrcweir // ::com::sun::star::lang::XServiceInfo 113cdf0e10cSrcweir DECLARE_SERVICE_INFO(); 114cdf0e10cSrcweir 115cdf0e10cSrcweir // XEventListener 116cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 117cdf0e10cSrcweir // XContainerListener 118cdf0e10cSrcweir virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 119cdf0e10cSrcweir virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 120cdf0e10cSrcweir virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); 121cdf0e10cSrcweir 122cdf0e10cSrcweir // ::connectivity::sdbcx::OCollection 123cdf0e10cSrcweir virtual ::connectivity::sdbcx::ObjectType createObject(const ::rtl::OUString& _rName); 124cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor(); 125cdf0e10cSrcweir virtual connectivity::sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ); 126cdf0e10cSrcweir virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName); 127cdf0e10cSrcweir 128cdf0e10cSrcweir using OFilteredContainer::disposing; 129cdf0e10cSrcweir 130cdf0e10cSrcweir bool m_bInElementRemoved; 131cdf0e10cSrcweir }; 132cdf0e10cSrcweir } 133cdf0e10cSrcweir #endif // _DBA_CORE_VIEWCONTAINER_HXX_ 134cdf0e10cSrcweir 135cdf0e10cSrcweir 136