1*079eb577SAndrew Rist /************************************************************** 2*079eb577SAndrew Rist * 3*079eb577SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*079eb577SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*079eb577SAndrew Rist * distributed with this work for additional information 6*079eb577SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*079eb577SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*079eb577SAndrew Rist * "License"); you may not use this file except in compliance 9*079eb577SAndrew Rist * with the License. You may obtain a copy of the License at 10*079eb577SAndrew Rist * 11*079eb577SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*079eb577SAndrew Rist * 13*079eb577SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*079eb577SAndrew Rist * software distributed under the License is distributed on an 15*079eb577SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*079eb577SAndrew Rist * KIND, either express or implied. See the License for the 17*079eb577SAndrew Rist * specific language governing permissions and limitations 18*079eb577SAndrew Rist * under the License. 19*079eb577SAndrew Rist * 20*079eb577SAndrew Rist *************************************************************/ 21cdf0e10cSrcweir 22cdf0e10cSrcweir #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ 23cdf0e10cSrcweir #define _CONNECTIVITY_PROPERTYIDS_HXX_ 24cdf0e10cSrcweir 25cdf0e10cSrcweir // this define has to be set to split the names into different dll's or so's 26cdf0e10cSrcweir // every dll has his own set of property names 27cdf0e10cSrcweir #ifndef _RTL_USTRING_ 28cdf0e10cSrcweir #include <rtl/ustring.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #ifndef _MAP_ 31cdf0e10cSrcweir #include <map> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace connectivity 35cdf0e10cSrcweir { 36cdf0e10cSrcweir namespace mysqlc 37cdf0e10cSrcweir { 38cdf0e10cSrcweir class OPropertyMap 39cdf0e10cSrcweir { 40cdf0e10cSrcweir ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap; 41cdf0e10cSrcweir 42cdf0e10cSrcweir ::rtl::OUString fillValue(sal_Int32 _nIndex); 43cdf0e10cSrcweir public: OPropertyMap()44cdf0e10cSrcweir OPropertyMap() 45cdf0e10cSrcweir { 46cdf0e10cSrcweir } 47cdf0e10cSrcweir ~OPropertyMap(); 48cdf0e10cSrcweir ::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const; 49cdf0e10cSrcweir getPropMap()50cdf0e10cSrcweir static OPropertyMap& getPropMap() 51cdf0e10cSrcweir { 52cdf0e10cSrcweir static OPropertyMap s_aPropMap; 53cdf0e10cSrcweir return s_aPropMap; 54cdf0e10cSrcweir } 55cdf0e10cSrcweir }; 56cdf0e10cSrcweir 57cdf0e10cSrcweir 58cdf0e10cSrcweir typedef const sal_Char* (*PVFN)(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir struct UStringDescription 61cdf0e10cSrcweir { 62cdf0e10cSrcweir const sal_Char* pZeroTerminatedName; 63cdf0e10cSrcweir sal_Int32 nLength; 64cdf0e10cSrcweir 65cdf0e10cSrcweir UStringDescription(PVFN _fCharFkt); operator ::rtl::OUStringconnectivity::mysqlc::UStringDescription66cdf0e10cSrcweir operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); } 67cdf0e10cSrcweir ~UStringDescription(); 68cdf0e10cSrcweir private: 69cdf0e10cSrcweir UStringDescription(); 70cdf0e10cSrcweir }; 71cdf0e10cSrcweir 72cdf0e10cSrcweir 73cdf0e10cSrcweir enum 74cdf0e10cSrcweir { 75cdf0e10cSrcweir PROPERTY_ID_FIRST = 0, 76cdf0e10cSrcweir PROPERTY_ID_QUERYTIMEOUT, 77cdf0e10cSrcweir PROPERTY_ID_MAXFIELDSIZE, 78cdf0e10cSrcweir PROPERTY_ID_MAXROWS, 79cdf0e10cSrcweir PROPERTY_ID_CURSORNAME, 80cdf0e10cSrcweir PROPERTY_ID_RESULTSETCONCURRENCY, 81cdf0e10cSrcweir PROPERTY_ID_RESULTSETTYPE, 82cdf0e10cSrcweir PROPERTY_ID_FETCHDIRECTION, 83cdf0e10cSrcweir PROPERTY_ID_FETCHSIZE, 84cdf0e10cSrcweir PROPERTY_ID_ESCAPEPROCESSING, 85cdf0e10cSrcweir PROPERTY_ID_USEBOOKMARKS, 86cdf0e10cSrcweir // Column 87cdf0e10cSrcweir PROPERTY_ID_NAME, 88cdf0e10cSrcweir PROPERTY_ID_TYPE, 89cdf0e10cSrcweir PROPERTY_ID_TYPENAME, 90cdf0e10cSrcweir PROPERTY_ID_PRECISION, 91cdf0e10cSrcweir PROPERTY_ID_SCALE, 92cdf0e10cSrcweir PROPERTY_ID_ISNULLABLE, 93cdf0e10cSrcweir PROPERTY_ID_ISAUTOINCREMENT, 94cdf0e10cSrcweir PROPERTY_ID_ISROWVERSION, 95cdf0e10cSrcweir PROPERTY_ID_DESCRIPTION, 96cdf0e10cSrcweir PROPERTY_ID_DEFAULTVALUE, 97cdf0e10cSrcweir 98cdf0e10cSrcweir PROPERTY_ID_REFERENCEDTABLE, 99cdf0e10cSrcweir PROPERTY_ID_UPDATERULE, 100cdf0e10cSrcweir PROPERTY_ID_DELETERULE, 101cdf0e10cSrcweir PROPERTY_ID_CATALOG, 102cdf0e10cSrcweir PROPERTY_ID_ISUNIQUE, 103cdf0e10cSrcweir PROPERTY_ID_ISPRIMARYKEYINDEX, 104cdf0e10cSrcweir PROPERTY_ID_ISCLUSTERED, 105cdf0e10cSrcweir PROPERTY_ID_ISASCENDING, 106cdf0e10cSrcweir PROPERTY_ID_SCHEMANAME, 107cdf0e10cSrcweir PROPERTY_ID_CATALOGNAME, 108cdf0e10cSrcweir 109cdf0e10cSrcweir PROPERTY_ID_COMMAND, 110cdf0e10cSrcweir PROPERTY_ID_CHECKOPTION, 111cdf0e10cSrcweir PROPERTY_ID_PASSWORD, 112cdf0e10cSrcweir PROPERTY_ID_RELATEDCOLUMN, 113cdf0e10cSrcweir 114cdf0e10cSrcweir PROPERTY_ID_FUNCTION, 115cdf0e10cSrcweir PROPERTY_ID_TABLENAME, 116cdf0e10cSrcweir PROPERTY_ID_REALNAME, 117cdf0e10cSrcweir PROPERTY_ID_DBASEPRECISIONCHANGED, 118cdf0e10cSrcweir PROPERTY_ID_ISCURRENCY, 119cdf0e10cSrcweir PROPERTY_ID_ISBOOKMARKABLE, 120cdf0e10cSrcweir 121cdf0e10cSrcweir PROPERTY_ID_INVALID_INDEX, 122cdf0e10cSrcweir PROPERTY_ID_ERRORMSG_SEQUENCE, 123cdf0e10cSrcweir PROPERTY_ID_HY010, 124cdf0e10cSrcweir PROPERTY_ID_HY0000, 125cdf0e10cSrcweir PROPERTY_ID_DELIMITER, 126cdf0e10cSrcweir PROPERTY_ID_FORMATKEY, 127cdf0e10cSrcweir PROPERTY_ID_LOCALE, 128cdf0e10cSrcweir PROPERTY_ID_IM001, 129cdf0e10cSrcweir 130cdf0e10cSrcweir PROPERTY_ID_AUTOINCREMENTCREATION, 131cdf0e10cSrcweir 132cdf0e10cSrcweir PROPERTY_ID_PRIVILEGES, 133cdf0e10cSrcweir 134cdf0e10cSrcweir PROPERTY_ID_LAST 135cdf0e10cSrcweir }; 136cdf0e10cSrcweir }/* mysqlc */ 137cdf0e10cSrcweir }/* connectivity */ 138cdf0e10cSrcweir 139cdf0e10cSrcweir //------------------------------------------------------------------------------ 140cdf0e10cSrcweir #define DECL_PROP1IMPL(varname, type) \ 141cdf0e10cSrcweir pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type*>(NULL)), 142cdf0e10cSrcweir //------------------------------------------------------------------------------ 143cdf0e10cSrcweir #define DECL_PROP0(varname, type) \ 144cdf0e10cSrcweir DECL_PROP1IMPL(varname, type) 0) 145cdf0e10cSrcweir //------------------------------------------------------------------------------ 146cdf0e10cSrcweir #define DECL_BOOL_PROP1IMPL(varname) \ 147cdf0e10cSrcweir pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(), 148cdf0e10cSrcweir //------------------------------------------------------------------------------ 149cdf0e10cSrcweir #define DECL_BOOL_PROP0(varname) \ 150cdf0e10cSrcweir DECL_BOOL_PROP1IMPL(varname) 0) 151cdf0e10cSrcweir 152cdf0e10cSrcweir 153cdf0e10cSrcweir 154cdf0e10cSrcweir #endif // _CONNECTIVITY_PROPERTYIDS_HXX_ 155cdf0e10cSrcweir 156cdf0e10cSrcweir 157