xref: /AOO41X/main/dbaccess/source/core/inc/viewcontainer.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _DBA_CORE_VIEWCONTAINER_HXX_
29 #define _DBA_CORE_VIEWCONTAINER_HXX_
30 
31 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
32 #include <cppuhelper/implbase1.hxx>
33 #endif
34 #ifndef _COMPHELPER_STLTYPES_HXX_
35 #include <comphelper/stl_types.hxx>
36 #endif
37 
38 #ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_
39 #include <com/sun/star/container/XEnumerationAccess.hpp>
40 #endif
41 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
42 #include <com/sun/star/container/XIndexAccess.hpp>
43 #endif
44 #ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_
45 #include <com/sun/star/util/XRefreshable.hpp>
46 #endif
47 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
48 #include <com/sun/star/lang/XServiceInfo.hpp>
49 #endif
50 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
51 #include <com/sun/star/uno/Sequence.hxx>
52 #endif
53 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
54 #include <com/sun/star/beans/XPropertySet.hpp>
55 #endif
56 #ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
57 #include <com/sun/star/sdbc/SQLWarning.hpp>
58 #endif
59 #ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
60 #include <com/sun/star/sdb/SQLContext.hpp>
61 #endif
62 #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
63 #include <com/sun/star/container/XContainerListener.hpp>
64 #endif
65 #ifndef _DBASHARED_APITOOLS_HXX_
66 #include "apitools.hxx"
67 #endif
68 
69 #ifndef DBACCESS_CORE_FILTERED_CONTAINER_HXX
70 #include "FilteredContainer.hxx"
71 #endif
72 
73 namespace dbtools
74 {
75 	class IWarningsContainer;
76 }
77 
78 namespace dbaccess
79 {
80 	typedef ::cppu::ImplHelper1< ::com::sun::star::container::XContainerListener> OViewContainer_Base;
81 
82 	//==========================================================================
83 	//= OViewContainer
84 	//==========================================================================
85 	class OViewContainer :  public OFilteredContainer,
86 							public OViewContainer_Base
87 	{
88 	public:
89 		/** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type>
90 			interface.<BR>
91 			@param			_rParent			the object which acts as parent for the container.
92 												all refcounting is rerouted to this object
93 			@param			_rMutex				the access safety object of the parent
94 			@param			_rTableFilter		restricts the visible tables by name
95 			@param			_rTableTypeFilter	restricts the visible tables by type
96 			@see			construct
97 		*/
98 		OViewContainer( ::cppu::OWeakObject& _rParent,
99 						::osl::Mutex& _rMutex,
100 						const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon,
101 						sal_Bool _bCase,
102 						IRefreshListener*	_pRefreshListener,
103 						::dbtools::IWarningsContainer* _pWarningsContainer,
104                         oslInterlockedCount& _nInAppend
105 						);
106 
107         virtual ~OViewContainer();
108 
109     protected:
110         // OFilteredContainer overridables
111         virtual ::rtl::OUString getTableTypeRestriction() const;
112 
113     private:
114 		inline virtual void SAL_CALL acquire() throw(){ OFilteredContainer::acquire();}
115 		inline virtual void SAL_CALL release() throw(){ OFilteredContainer::release();}
116 	// ::com::sun::star::lang::XServiceInfo
117 		DECLARE_SERVICE_INFO();
118 
119 		// XEventListener
120 		virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
121 		// XContainerListener
122 		virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
123 		virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
124 		virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
125 
126 		// ::connectivity::sdbcx::OCollection
127 		virtual ::connectivity::sdbcx::ObjectType		createObject(const ::rtl::OUString& _rName);
128 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >	createDescriptor();
129         virtual connectivity::sdbcx::ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
130 		virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
131 
132         using OFilteredContainer::disposing;
133 
134         bool m_bInElementRemoved;
135 	};
136 }
137 #endif // _DBA_CORE_VIEWCONTAINER_HXX_
138 
139 
140