1caf5cd79SAndrew Rist /**************************************************************
2*e62cf9b4Smseidel  *
3caf5cd79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4caf5cd79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5caf5cd79SAndrew Rist  * distributed with this work for additional information
6caf5cd79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7caf5cd79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8caf5cd79SAndrew Rist  * "License"); you may not use this file except in compliance
9caf5cd79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e62cf9b4Smseidel  *
11caf5cd79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e62cf9b4Smseidel  *
13caf5cd79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14caf5cd79SAndrew Rist  * software distributed under the License is distributed on an
15caf5cd79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16caf5cd79SAndrew Rist  * KIND, either express or implied.  See the License for the
17caf5cd79SAndrew Rist  * specific language governing permissions and limitations
18caf5cd79SAndrew Rist  * under the License.
19*e62cf9b4Smseidel  *
20caf5cd79SAndrew Rist  *************************************************************/
21caf5cd79SAndrew Rist 
22caf5cd79SAndrew Rist 
23*e62cf9b4Smseidel 
24cdf0e10cSrcweir #ifndef _CONNECTIVITY_ADABAS_CATALOG_HXX_
25cdf0e10cSrcweir #define _CONNECTIVITY_ADABAS_CATALOG_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "connectivity/sdbcx/VCatalog.hxx"
28cdf0e10cSrcweir #include "odbc/OFunctiondefs.hxx"
29cdf0e10cSrcweir #include "connectivity/StdTypeDefs.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace connectivity
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 	namespace adabas
34cdf0e10cSrcweir 	{
35cdf0e10cSrcweir 		// please don't name the class the same name as in an other namespaces
36*e62cf9b4Smseidel 		// some compilers have problems with this task as I noticed on Windows
37*e62cf9b4Smseidel 		class OAdabasConnection;
38cdf0e10cSrcweir 		class OAdabasCatalog : public connectivity::sdbcx::OCatalog
39cdf0e10cSrcweir 		{
40cdf0e10cSrcweir 			OAdabasConnection*	m_pConnection;		// used to get the metadata
41cdf0e10cSrcweir 			SQLHANDLE			m_aConnectionHdl;	// used for odbc specific stuff
42cdf0e10cSrcweir 
43*e62cf9b4Smseidel 			void fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector);
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 		protected:
46cdf0e10cSrcweir 			/** builds the name which should be used to access the object later on in the collection.
47cdf0e10cSrcweir 				Will only be called in fillNames.
48cdf0e10cSrcweir 				@param	_xRow
49*e62cf9b4Smseidel 					The current row from a call of XDatabaseMetaData::getTables.
50cdf0e10cSrcweir 			*/
51cdf0e10cSrcweir 			virtual ::rtl::OUString buildName(	const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
52cdf0e10cSrcweir 		public:
53cdf0e10cSrcweir 			// implementation of the pure virtual methods
54cdf0e10cSrcweir 			virtual void refreshTables();
55cdf0e10cSrcweir 			virtual void refreshViews()	;
56cdf0e10cSrcweir 			virtual void refreshGroups();
57cdf0e10cSrcweir 			virtual void refreshUsers()	;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 		public:
60cdf0e10cSrcweir 			OAdabasCatalog(SQLHANDLE _aConnectionHdl,OAdabasConnection* _pCon);
61cdf0e10cSrcweir 
getConnection() const62cdf0e10cSrcweir 			OAdabasConnection*		getConnection()		const { return m_pConnection; }
getPrivateTables() const63cdf0e10cSrcweir 			sdbcx::OCollection*		getPrivateTables()	const { return m_pTables;}
getPrivateViews() const64cdf0e10cSrcweir 			sdbcx::OCollection*		getPrivateViews()	const { return m_pViews; }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 			static const ::rtl::OUString& getDot();
67fb0b81f5Smseidel 			// correct the column properties of float/real/double values
68cdf0e10cSrcweir 			// all & parameters are IN and OUT
69cdf0e10cSrcweir 			static void correctColumnProperties(sal_Int32 _nPrec, sal_Int32& _rnType,::rtl::OUString& _rsTypeName);
70cdf0e10cSrcweir 		};
71cdf0e10cSrcweir 	}
72cdf0e10cSrcweir }
73cdf0e10cSrcweir #endif // _CONNECTIVITY_ADABAS_CATALOG_HXX_
74cdf0e10cSrcweir 
75