Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _DBA_CORE_TABLECONTAINER_HXX_
21 : #define _DBA_CORE_TABLECONTAINER_HXX_
22 :
23 : #include <cppuhelper/implbase1.hxx>
24 : #include <comphelper/stl_types.hxx>
25 : #include <com/sun/star/container/XEnumerationAccess.hpp>
26 : #include <com/sun/star/container/XNameAccess.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/sdbc/XConnection.hpp>
32 : #include <com/sun/star/beans/XPropertySet.hpp>
33 : #include <com/sun/star/container/XContainerListener.hpp>
34 : #include <com/sun/star/container/XNameContainer.hpp>
35 : #include "FilteredContainer.hxx"
36 : #include <connectivity/warningscontainer.hxx>
37 : #include "RefreshListener.hxx"
38 : #include "apitools.hxx"
39 :
40 : namespace dbaccess
41 : {
42 : typedef ::cppu::ImplHelper1< ::com::sun::star::container::XContainerListener> OTableContainer_Base;
43 :
44 : //==========================================================================
45 : //= OTableContainer
46 : //==========================================================================
47 : class OContainerMediator;
48 :
49 : class OTableContainer : public OFilteredContainer,
50 : public OTableContainer_Base
51 : {
52 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xTableDefinitions;
53 : ::rtl::Reference< OContainerMediator > m_pTableMediator;
54 : sal_Bool m_bInDrop; // set when we are in the drop method
55 :
56 :
57 : // OFilteredContainer
58 : virtual void addMasterContainerListener();
59 : virtual void removeMasterContainerListener();
60 : virtual OUString getTableTypeRestriction() const;
61 :
62 : // ::connectivity::sdbcx::OCollection
63 : virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName);
64 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
65 : virtual connectivity::sdbcx::ObjectType appendObject( const OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
66 : virtual void dropObject(sal_Int32 _nPos,const OUString _sElementName);
67 :
68 : virtual void SAL_CALL disposing();
69 :
70 2723 : inline virtual void SAL_CALL acquire() throw(){ OFilteredContainer::acquire();}
71 2723 : inline virtual void SAL_CALL release() throw(){ OFilteredContainer::release();}
72 : // ::com::sun::star::lang::XServiceInfo
73 : DECLARE_SERVICE_INFO();
74 :
75 : // XEventListener
76 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
77 : // XContainerListener
78 : virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
79 : virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
80 : virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
81 :
82 : public:
83 : /** ctor of the container. The parent has to support the <type scope="com::sun::star::sdbc">XConnection</type>
84 : interface.<BR>
85 : @param _rParent the object which acts as parent for the container.
86 : all refcounting is rerouted to this object
87 : @param _rMutex the access safety object of the parent
88 : @param _rTableFilter restricts the visible tables by name
89 : @param _rTableTypeFilter restricts the visible tables by type
90 : @see construct
91 : */
92 : OTableContainer( ::cppu::OWeakObject& _rParent,
93 : ::osl::Mutex& _rMutex,
94 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon,
95 : sal_Bool _bCase,
96 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _xTableDefinitions,
97 : IRefreshListener* _pRefreshListener,
98 : ::dbtools::IWarningsContainer* _pWarningsContainer,
99 : oslInterlockedCount& _nInAppend
100 : );
101 :
102 : virtual ~OTableContainer();
103 : };
104 : }
105 : #endif // _DBA_CORE_TABLECONTAINER_HXX_
106 :
107 :
108 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|