1 2 #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ 3 #define _CONNECTIVITY_PROPERTYIDS_HXX_ 4 5 // this define has to be set to split the names into different dll's or so's 6 // every dll has his own set of property names 7 #ifndef _RTL_USTRING_ 8 #include <rtl/ustring.hxx> 9 #endif 10 #ifndef _MAP_ 11 #include <map> 12 #endif 13 14 namespace connectivity 15 { 16 namespace mysqlc 17 { 18 class OPropertyMap 19 { 20 ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap; 21 22 ::rtl::OUString fillValue(sal_Int32 _nIndex); 23 public: 24 OPropertyMap() 25 { 26 } 27 ~OPropertyMap(); 28 ::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const; 29 30 static OPropertyMap& getPropMap() 31 { 32 static OPropertyMap s_aPropMap; 33 return s_aPropMap; 34 } 35 }; 36 37 38 typedef const sal_Char* (*PVFN)(); 39 40 struct UStringDescription 41 { 42 const sal_Char* pZeroTerminatedName; 43 sal_Int32 nLength; 44 45 UStringDescription(PVFN _fCharFkt); 46 operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); } 47 ~UStringDescription(); 48 private: 49 UStringDescription(); 50 }; 51 52 53 enum 54 { 55 PROPERTY_ID_FIRST = 0, 56 PROPERTY_ID_QUERYTIMEOUT, 57 PROPERTY_ID_MAXFIELDSIZE, 58 PROPERTY_ID_MAXROWS, 59 PROPERTY_ID_CURSORNAME, 60 PROPERTY_ID_RESULTSETCONCURRENCY, 61 PROPERTY_ID_RESULTSETTYPE, 62 PROPERTY_ID_FETCHDIRECTION, 63 PROPERTY_ID_FETCHSIZE, 64 PROPERTY_ID_ESCAPEPROCESSING, 65 PROPERTY_ID_USEBOOKMARKS, 66 // Column 67 PROPERTY_ID_NAME, 68 PROPERTY_ID_TYPE, 69 PROPERTY_ID_TYPENAME, 70 PROPERTY_ID_PRECISION, 71 PROPERTY_ID_SCALE, 72 PROPERTY_ID_ISNULLABLE, 73 PROPERTY_ID_ISAUTOINCREMENT, 74 PROPERTY_ID_ISROWVERSION, 75 PROPERTY_ID_DESCRIPTION, 76 PROPERTY_ID_DEFAULTVALUE, 77 78 PROPERTY_ID_REFERENCEDTABLE, 79 PROPERTY_ID_UPDATERULE, 80 PROPERTY_ID_DELETERULE, 81 PROPERTY_ID_CATALOG, 82 PROPERTY_ID_ISUNIQUE, 83 PROPERTY_ID_ISPRIMARYKEYINDEX, 84 PROPERTY_ID_ISCLUSTERED, 85 PROPERTY_ID_ISASCENDING, 86 PROPERTY_ID_SCHEMANAME, 87 PROPERTY_ID_CATALOGNAME, 88 89 PROPERTY_ID_COMMAND, 90 PROPERTY_ID_CHECKOPTION, 91 PROPERTY_ID_PASSWORD, 92 PROPERTY_ID_RELATEDCOLUMN, 93 94 PROPERTY_ID_FUNCTION, 95 PROPERTY_ID_TABLENAME, 96 PROPERTY_ID_REALNAME, 97 PROPERTY_ID_DBASEPRECISIONCHANGED, 98 PROPERTY_ID_ISCURRENCY, 99 PROPERTY_ID_ISBOOKMARKABLE, 100 101 PROPERTY_ID_INVALID_INDEX, 102 PROPERTY_ID_ERRORMSG_SEQUENCE, 103 PROPERTY_ID_HY010, 104 PROPERTY_ID_HY0000, 105 PROPERTY_ID_DELIMITER, 106 PROPERTY_ID_FORMATKEY, 107 PROPERTY_ID_LOCALE, 108 PROPERTY_ID_IM001, 109 110 PROPERTY_ID_AUTOINCREMENTCREATION, 111 112 PROPERTY_ID_PRIVILEGES, 113 114 PROPERTY_ID_LAST 115 }; 116 }/* mysqlc */ 117 }/* connectivity */ 118 119 //------------------------------------------------------------------------------ 120 #define DECL_PROP1IMPL(varname, type) \ 121 pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type*>(NULL)), 122 //------------------------------------------------------------------------------ 123 #define DECL_PROP0(varname, type) \ 124 DECL_PROP1IMPL(varname, type) 0) 125 //------------------------------------------------------------------------------ 126 #define DECL_BOOL_PROP1IMPL(varname) \ 127 pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(), 128 //------------------------------------------------------------------------------ 129 #define DECL_BOOL_PROP0(varname) \ 130 DECL_BOOL_PROP1IMPL(varname) 0) 131 132 133 134 #endif // _CONNECTIVITY_PROPERTYIDS_HXX_ 135 136 137