Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dbaccess / source / core / inc / viewcontainer.hxx
blob4d53b542faa6d450fee09996e6338fef4884bdc0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_VIEWCONTAINER_HXX_
21 #define _DBA_CORE_VIEWCONTAINER_HXX_
23 #include <cppuhelper/implbase1.hxx>
24 #include <comphelper/stl_types.hxx>
26 #include <com/sun/star/container/XEnumerationAccess.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/beans/XPropertySet.hpp>
32 #include <com/sun/star/sdbc/SQLWarning.hpp>
33 #include <com/sun/star/sdb/SQLContext.hpp>
34 #include <com/sun/star/container/XContainerListener.hpp>
35 #include "apitools.hxx"
37 #include "FilteredContainer.hxx"
39 namespace dbtools
41 class IWarningsContainer;
44 namespace dbaccess
46 typedef ::cppu::ImplHelper1< ::com::sun::star::container::XContainerListener> OViewContainer_Base;
48 //==========================================================================
49 //= OViewContainer
50 //==========================================================================
51 class OViewContainer : public OFilteredContainer,
52 public OViewContainer_Base
54 public:
55 /** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type>
56 interface.<BR>
57 @param _rParent the object which acts as parent for the container.
58 all refcounting is rerouted to this object
59 @param _rMutex the access safety object of the parent
60 @param _rTableFilter restricts the visible tables by name
61 @param _rTableTypeFilter restricts the visible tables by type
62 @see construct
64 OViewContainer( ::cppu::OWeakObject& _rParent,
65 ::osl::Mutex& _rMutex,
66 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon,
67 sal_Bool _bCase,
68 IRefreshListener* _pRefreshListener,
69 ::dbtools::IWarningsContainer* _pWarningsContainer,
70 oslInterlockedCount& _nInAppend
73 virtual ~OViewContainer();
75 protected:
76 // OFilteredContainer overridables
77 virtual ::rtl::OUString getTableTypeRestriction() const;
79 private:
80 inline virtual void SAL_CALL acquire() throw(){ OFilteredContainer::acquire();}
81 inline virtual void SAL_CALL release() throw(){ OFilteredContainer::release();}
82 // ::com::sun::star::lang::XServiceInfo
83 DECLARE_SERVICE_INFO();
85 // XEventListener
86 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
87 // XContainerListener
88 virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
89 virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
90 virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
92 // ::connectivity::sdbcx::OCollection
93 virtual ::connectivity::sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
94 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
95 virtual connectivity::sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
96 virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
98 using OFilteredContainer::disposing;
100 bool m_bInElementRemoved;
103 #endif // _DBA_CORE_VIEWCONTAINER_HXX_
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */