1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CONNECTIVITY_MYSQL_CATALOG_HXX
24 #define CONNECTIVITY_MYSQL_CATALOG_HXX
25 
26 #include "connectivity/sdbcx/VCatalog.hxx"
27 #include "connectivity/StdTypeDefs.hxx"
28 
29 namespace connectivity
30 {
31 	namespace mysql
32 	{
33 		// please don't name the class the same name as in an other namespaces
34 		// some compilers have problems with this task as I noticed on windows
35         class OAdabasConnection;
36 		class OMySQLCatalog : public connectivity::sdbcx::OCatalog
37 		{
38 			::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
39 
40 			/** calls XDatabaseMetaData::getTables.
41 				@param	_sKindOfObject
42 					The type of tables to be fetched.
43 				@param	_rNames
44 					The container for the names to be filled. <OUT/>
45 			*/
46 			void refreshObjects(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _sKindOfObject,TStringVector& _rNames);
47 
48 		public:
49 			// implementation of the pure virtual methods
50 			virtual void refreshTables();
51 			virtual void refreshViews()	;
52 			virtual void refreshGroups();
53 			virtual void refreshUsers()	;
54 
55 		public:
56 			OMySQLCatalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
57 
getPrivateTables() const58 			inline sdbcx::OCollection*		getPrivateTables()	const { return m_pTables;}
getPrivateViews() const59 			inline sdbcx::OCollection*		getPrivateViews()	const { return m_pViews; }
getConnection() const60 			inline ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() const { return m_xConnection; }
61 
62 			virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
63 			// ::cppu::OComponentHelper
64 			virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
65 		};
66 	}
67 }
68 #endif // CONNECTIVITY_MYSQL_CATALOG_HXX
69 
70