1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewcontainer.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DBA_CORE_VIEWCONTAINER_HXX_
32 #define _DBA_CORE_VIEWCONTAINER_HXX_
34 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
35 #include <cppuhelper/implbase1.hxx>
37 #ifndef _COMPHELPER_STLTYPES_HXX_
38 #include <comphelper/stl_types.hxx>
41 #ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_
42 #include <com/sun/star/container/XEnumerationAccess.hpp>
44 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
45 #include <com/sun/star/container/XIndexAccess.hpp>
47 #ifndef _COM_SUN_STAR_UTIL_XREFRESHABLE_HPP_
48 #include <com/sun/star/util/XRefreshable.hpp>
50 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
51 #include <com/sun/star/lang/XServiceInfo.hpp>
53 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
54 #include <com/sun/star/uno/Sequence.hxx>
56 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
57 #include <com/sun/star/beans/XPropertySet.hpp>
59 #ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
60 #include <com/sun/star/sdbc/SQLWarning.hpp>
62 #ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
63 #include <com/sun/star/sdb/SQLContext.hpp>
65 #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
66 #include <com/sun/star/container/XContainerListener.hpp>
68 #ifndef _DBASHARED_APITOOLS_HXX_
69 #include "apitools.hxx"
72 #ifndef DBACCESS_CORE_FILTERED_CONTAINER_HXX
73 #include "FilteredContainer.hxx"
78 class IWarningsContainer
;
83 typedef ::cppu::ImplHelper1
< ::com::sun::star::container::XContainerListener
> OViewContainer_Base
;
85 //==========================================================================
87 //==========================================================================
88 class OViewContainer
: public OFilteredContainer
,
89 public OViewContainer_Base
92 /** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type>
94 @param _rParent the object which acts as parent for the container.
95 all refcounting is rerouted to this object
96 @param _rMutex the access safety object of the parent
97 @param _rTableFilter restricts the visible tables by name
98 @param _rTableTypeFilter restricts the visible tables by type
101 OViewContainer( ::cppu::OWeakObject
& _rParent
,
102 ::osl::Mutex
& _rMutex
,
103 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xCon
,
105 IRefreshListener
* _pRefreshListener
,
106 ::dbtools::IWarningsContainer
* _pWarningsContainer
,
107 oslInterlockedCount
& _nInAppend
110 virtual ~OViewContainer();
113 // OFilteredContainer overridables
114 virtual ::rtl::OUString
getTableTypeRestriction() const;
117 inline virtual void SAL_CALL
acquire() throw(){ OFilteredContainer::acquire();}
118 inline virtual void SAL_CALL
release() throw(){ OFilteredContainer::release();}
119 // ::com::sun::star::lang::XServiceInfo
120 DECLARE_SERVICE_INFO();
123 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
124 // XContainerListener
125 virtual void SAL_CALL
elementInserted( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
126 virtual void SAL_CALL
elementRemoved( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
127 virtual void SAL_CALL
elementReplaced( const ::com::sun::star::container::ContainerEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
129 // ::connectivity::sdbcx::OCollection
130 virtual ::connectivity::sdbcx::ObjectType
createObject(const ::rtl::OUString
& _rName
);
131 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> createDescriptor();
132 virtual connectivity::sdbcx::ObjectType
appendObject( const ::rtl::OUString
& _rForName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& descriptor
);
133 virtual void dropObject(sal_Int32 _nPos
,const ::rtl::OUString _sElementName
);
135 using OFilteredContainer::disposing
;
137 bool m_bInElementRemoved
;
140 #endif // _DBA_CORE_VIEWCONTAINER_HXX_