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 #ifndef _CONNECTIVITY_ADABAS_CATALOG_HXX_
24cdf0e10cSrcweir #define _CONNECTIVITY_ADABAS_CATALOG_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "connectivity/sdbcx/VCatalog.hxx"
27cdf0e10cSrcweir #include "odbc/OFunctiondefs.hxx"
28cdf0e10cSrcweir #include "connectivity/StdTypeDefs.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace connectivity
31cdf0e10cSrcweir {
32cdf0e10cSrcweir 	namespace adabas
33cdf0e10cSrcweir 	{
34cdf0e10cSrcweir 		// please don't name the class the same name as in an other namespaces
35cdf0e10cSrcweir 		// some compilers have problems with this task as I noticed on windows
36cdf0e10cSrcweir         class OAdabasConnection;
37cdf0e10cSrcweir 		class OAdabasCatalog : public connectivity::sdbcx::OCatalog
38cdf0e10cSrcweir 		{
39cdf0e10cSrcweir 			OAdabasConnection*	m_pConnection;		// used to get the metadata
40cdf0e10cSrcweir 			SQLHANDLE			m_aConnectionHdl;	// used for odbc specific stuff
41cdf0e10cSrcweir 
42cdf0e10cSrcweir             void fillVector(const ::rtl::OUString& _sQuery,TStringVector& _rVector);
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 		protected:
45cdf0e10cSrcweir 			/** builds the name which should be used to access the object later on in the collection.
46cdf0e10cSrcweir 				Will only be called in fillNames.
47cdf0e10cSrcweir 				@param	_xRow
48cdf0e10cSrcweir 					The cuurent row from a call of XDatabaseMetaData::getTables.
49cdf0e10cSrcweir 			*/
50cdf0e10cSrcweir 			virtual ::rtl::OUString buildName(	const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
51cdf0e10cSrcweir 		public:
52cdf0e10cSrcweir 			// implementation of the pure virtual methods
53cdf0e10cSrcweir 			virtual void refreshTables();
54cdf0e10cSrcweir 			virtual void refreshViews()	;
55cdf0e10cSrcweir 			virtual void refreshGroups();
56cdf0e10cSrcweir 			virtual void refreshUsers()	;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 		public:
59cdf0e10cSrcweir 			OAdabasCatalog(SQLHANDLE _aConnectionHdl,OAdabasConnection* _pCon);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 			OAdabasConnection*		getConnection()		const { return m_pConnection; }
62cdf0e10cSrcweir 			sdbcx::OCollection*		getPrivateTables()	const { return m_pTables;}
63cdf0e10cSrcweir 			sdbcx::OCollection*		getPrivateViews()	const { return m_pViews; }
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 			static const ::rtl::OUString& getDot();
66cdf0e10cSrcweir 			// correct the the column properties of float/real/double values
67cdf0e10cSrcweir 			// all & parameters are IN and OUT
68cdf0e10cSrcweir 			static void correctColumnProperties(sal_Int32 _nPrec, sal_Int32& _rnType,::rtl::OUString& _rsTypeName);
69cdf0e10cSrcweir 		};
70cdf0e10cSrcweir 	}
71cdf0e10cSrcweir }
72cdf0e10cSrcweir #endif // _CONNECTIVITY_ADABAS_CATALOG_HXX_
73cdf0e10cSrcweir 
74