1*caf5cd79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*caf5cd79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*caf5cd79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*caf5cd79SAndrew Rist  * distributed with this work for additional information
6*caf5cd79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*caf5cd79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*caf5cd79SAndrew Rist  * "License"); you may not use this file except in compliance
9*caf5cd79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*caf5cd79SAndrew Rist  *
11*caf5cd79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*caf5cd79SAndrew Rist  *
13*caf5cd79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*caf5cd79SAndrew Rist  * software distributed under the License is distributed on an
15*caf5cd79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*caf5cd79SAndrew Rist  * KIND, either express or implied.  See the License for the
17*caf5cd79SAndrew Rist  * specific language governing permissions and limitations
18*caf5cd79SAndrew Rist  * under the License.
19*caf5cd79SAndrew Rist  *
20*caf5cd79SAndrew Rist  *************************************************************/
21*caf5cd79SAndrew Rist 
22*caf5cd79SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _CONNECTIVITY_SDBCX_INDEX_HXX_
25cdf0e10cSrcweir #define _CONNECTIVITY_SDBCX_INDEX_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //#ifndef _OSL_DIAGNOSE_H_
28cdf0e10cSrcweir //#include <osl/diagnose.h>
29cdf0e10cSrcweir //#endif
30cdf0e10cSrcweir #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
31cdf0e10cSrcweir #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
32cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
33cdf0e10cSrcweir #include <comphelper/IdPropArrayHelper.hxx>
34cdf0e10cSrcweir #include <cppuhelper/compbase2.hxx>
35cdf0e10cSrcweir #include "connectivity/CommonTools.hxx"
36cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
37cdf0e10cSrcweir #include "connectivity/sdbcx/VTypeDef.hxx"
38cdf0e10cSrcweir #include "connectivity/sdbcx/IRefreshable.hxx"
39cdf0e10cSrcweir #include "connectivity/sdbcx/VDescriptor.hxx"
40cdf0e10cSrcweir #include "connectivity/dbtoolsdllapi.hxx"
41cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
42cdf0e10cSrcweir #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
43cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace connectivity
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 	namespace sdbcx
48cdf0e10cSrcweir 	{
49cdf0e10cSrcweir 		class OCollection;
50cdf0e10cSrcweir 		class OIndex;
51cdf0e10cSrcweir 		typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OIndex_BASE;
52cdf0e10cSrcweir 		typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndex> OIndex_PROP;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 		class OOO_DLLPUBLIC_DBTOOLS OIndex :
55cdf0e10cSrcweir                                     public comphelper::OBaseMutex,
56cdf0e10cSrcweir 									public ODescriptor_BASE,
57cdf0e10cSrcweir 									public IRefreshableColumns,
58cdf0e10cSrcweir 									public OIndex_PROP,
59cdf0e10cSrcweir 									public ODescriptor,
60cdf0e10cSrcweir 									public OIndex_BASE
61cdf0e10cSrcweir 		{
62cdf0e10cSrcweir 		protected:
63cdf0e10cSrcweir 			::rtl::OUString	m_Catalog;
64cdf0e10cSrcweir 			sal_Bool		m_IsUnique;
65cdf0e10cSrcweir 			sal_Bool		m_IsPrimaryKeyIndex;
66cdf0e10cSrcweir 			sal_Bool		m_IsClustered;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 			OCollection*	m_pColumns;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 			using ODescriptor_BASE::rBHelper;
71cdf0e10cSrcweir 			virtual void refreshColumns();
72cdf0e10cSrcweir 			// OPropertyArrayUsageHelper
73cdf0e10cSrcweir 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
74cdf0e10cSrcweir 			virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
75cdf0e10cSrcweir 		public:
76cdf0e10cSrcweir 			OIndex(sal_Bool _bCase);
77cdf0e10cSrcweir 			OIndex(	const ::rtl::OUString& _Name,
78cdf0e10cSrcweir 					const ::rtl::OUString& _Catalog,
79cdf0e10cSrcweir 					sal_Bool _isUnique,
80cdf0e10cSrcweir 					sal_Bool _isPrimaryKeyIndex,
81cdf0e10cSrcweir 					sal_Bool _isClustered,
82cdf0e10cSrcweir 					sal_Bool _bCase);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 			virtual ~OIndex( );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 			DECLARE_SERVICE_INFO();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 			//XInterface
89cdf0e10cSrcweir 			virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 			virtual void SAL_CALL acquire() throw();
91cdf0e10cSrcweir 			virtual void SAL_CALL release() throw();
92cdf0e10cSrcweir 			//XTypeProvider
93cdf0e10cSrcweir             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir 			// ODescriptor
95cdf0e10cSrcweir 			virtual void construct();
96cdf0e10cSrcweir 			// ::cppu::OComponentHelper
97cdf0e10cSrcweir 			virtual void SAL_CALL disposing(void);
98cdf0e10cSrcweir 			// XPropertySet
99cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 			// XColumnsSupplier
101cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns(  ) throw(::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 			// XNamed
104cdf0e10cSrcweir             virtual ::rtl::OUString SAL_CALL getName(  ) throw(::com::sun::star::uno::RuntimeException);
105cdf0e10cSrcweir             virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir 			// XDataDescriptorFactory
107cdf0e10cSrcweir 			virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor(  ) throw(::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir 		};
109cdf0e10cSrcweir 	}
110cdf0e10cSrcweir }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir #endif // _CONNECTIVITY_SDBCX_INDEX_HXX_
113cdf0e10cSrcweir 
114