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