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_ADO_ADOIMP_HXX_
24 #define _CONNECTIVITY_ADO_ADOIMP_HXX_
25 
26 #include <com/sun/star/sdbc/SQLException.hpp>
27 
28 #include "ado_pre_sys_include.h"
29 #include <adoctint.h>
30 #include "ado_post_sys_include.h"
31 
32 struct ADOConnection;
33 enum DataTypeEnum;
34 namespace connectivity
35 {
36 	namespace ado
37 	{
38 
39 		class WpADOField;
40 		class OLEString;
41 		class ADOS
42 		{
43 		public:
44 			// Auch hier: BSTR mit SysFreeString() freigeben!
45 			static OLEString& GetKeyStr();
46 
47 			static const CLSID	CLSID_ADOCATALOG_25;
48 			static const IID	IID_ADOCATALOG_25;
49 
50 			static const CLSID	CLSID_ADOCONNECTION_21;
51 			static const IID	IID_ADOCONNECTION_21;
52 
53 			static const CLSID	CLSID_ADOCOMMAND_21;
54 			static const IID	IID_ADOCOMMAND_21;
55 
56 			static const CLSID	CLSID_ADORECORDSET_21;
57 			static const IID	IID_ADORECORDSET_21;
58 
59 			static const CLSID	CLSID_ADOINDEX_25;
60 			static const IID	IID_ADOINDEX_25;
61 
62 			static const CLSID	CLSID_ADOCOLUMN_25;
63 			static const IID	IID_ADOCOLUMN_25;
64 
65 			static const CLSID	CLSID_ADOKEY_25;
66 			static const IID	IID_ADOKEY_25;
67 
68 			static const CLSID	CLSID_ADOTABLE_25;
69 			static const IID	IID_ADOTABLE_25;
70 
71 			static const CLSID	CLSID_ADOGROUP_25;
72 			static const IID	IID_ADOGROUP_25;
73 
74 			static const CLSID	CLSID_ADOUSER_25;
75 			static const IID	IID_ADOUSER_25;
76 
77 			static const CLSID	CLSID_ADOVIEW_25;
78 			static const IID	IID_ADOVIEW_25;
79 
80             static void ThrowException(ADOConnection* _pAdoCon,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
81 			static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
82 			static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine);
83 			static sal_Bool isJetEngine(sal_Int32 _nEngineType);
84 
85 			static ObjectTypeEnum	mapObjectType2Ado(sal_Int32 objType);
86 			static sal_Int32		mapAdoType2Object(ObjectTypeEnum objType);
87 			static sal_Int32		mapAdoRights2Sdbc(RightsEnum eRights);
88 			static sal_Int32		mapRights2Ado(sal_Int32 nRights);
89 
90 			static WpADOField		getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
91 		};
92 
93 
94 	}
95 }
96 
97 #define ADO_PROP(ItemName)											\
98 		WpADOProperty aProp(aProps.GetItem(ItemName));				\
99 		OLEVariant aVar;											\
100 		if(aProp.IsValid())											\
101 			aVar = aProp.GetValue();								\
102 		else														\
103 			ADOS::ThrowException(*m_pADOConnection,*this);
104 
105 
106 #endif //_CONNECTIVITY_ADO_ADOIMP_HXX_
107 
108 
109