Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / mysqlc / source / mysqlc_propertyids.hxx
blob3118813ccddfb055df7465a1d703bb2636616d44
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_
21 #define _CONNECTIVITY_PROPERTYIDS_HXX_
23 // this define has to be set to split the names into different dll's or so's
24 // every dll has his own set of property names
25 #ifndef _RTL_USTRING_
26 #include <rtl/ustring.hxx>
27 #endif
28 #ifndef _MAP_
29 #include <map>
30 #endif
32 namespace connectivity
34 namespace mysqlc
36 class OPropertyMap
38 ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
40 ::rtl::OUString fillValue(sal_Int32 _nIndex);
41 public:
42 OPropertyMap()
45 ~OPropertyMap();
46 ::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const;
48 static OPropertyMap& getPropMap()
50 static OPropertyMap s_aPropMap;
51 return s_aPropMap;
56 typedef const sal_Char* (*PVFN)();
58 struct UStringDescription
60 const sal_Char* pZeroTerminatedName;
61 sal_Int32 nLength;
63 UStringDescription(PVFN _fCharFkt);
64 operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
65 ~UStringDescription();
66 private:
67 UStringDescription();
71 enum
73 PROPERTY_ID_FIRST = 0,
74 PROPERTY_ID_QUERYTIMEOUT,
75 PROPERTY_ID_MAXFIELDSIZE,
76 PROPERTY_ID_MAXROWS,
77 PROPERTY_ID_CURSORNAME,
78 PROPERTY_ID_RESULTSETCONCURRENCY,
79 PROPERTY_ID_RESULTSETTYPE,
80 PROPERTY_ID_FETCHDIRECTION,
81 PROPERTY_ID_FETCHSIZE,
82 PROPERTY_ID_ESCAPEPROCESSING,
83 PROPERTY_ID_USEBOOKMARKS,
84 // Column
85 PROPERTY_ID_NAME,
86 PROPERTY_ID_TYPE,
87 PROPERTY_ID_TYPENAME,
88 PROPERTY_ID_PRECISION,
89 PROPERTY_ID_SCALE,
90 PROPERTY_ID_ISNULLABLE,
91 PROPERTY_ID_ISAUTOINCREMENT,
92 PROPERTY_ID_ISROWVERSION,
93 PROPERTY_ID_DESCRIPTION,
94 PROPERTY_ID_DEFAULTVALUE,
96 PROPERTY_ID_REFERENCEDTABLE,
97 PROPERTY_ID_UPDATERULE,
98 PROPERTY_ID_DELETERULE,
99 PROPERTY_ID_CATALOG,
100 PROPERTY_ID_ISUNIQUE,
101 PROPERTY_ID_ISPRIMARYKEYINDEX,
102 PROPERTY_ID_ISCLUSTERED,
103 PROPERTY_ID_ISASCENDING,
104 PROPERTY_ID_SCHEMANAME,
105 PROPERTY_ID_CATALOGNAME,
107 PROPERTY_ID_COMMAND,
108 PROPERTY_ID_CHECKOPTION,
109 PROPERTY_ID_PASSWORD,
110 PROPERTY_ID_RELATEDCOLUMN,
112 PROPERTY_ID_FUNCTION,
113 PROPERTY_ID_TABLENAME,
114 PROPERTY_ID_REALNAME,
115 PROPERTY_ID_DBASEPRECISIONCHANGED,
116 PROPERTY_ID_ISCURRENCY,
117 PROPERTY_ID_ISBOOKMARKABLE,
119 PROPERTY_ID_INVALID_INDEX,
120 PROPERTY_ID_ERRORMSG_SEQUENCE,
121 PROPERTY_ID_HY010,
122 PROPERTY_ID_HY0000,
123 PROPERTY_ID_DELIMITER,
124 PROPERTY_ID_FORMATKEY,
125 PROPERTY_ID_LOCALE,
126 PROPERTY_ID_IM001,
128 PROPERTY_ID_AUTOINCREMENTCREATION,
130 PROPERTY_ID_PRIVILEGES,
132 PROPERTY_ID_LAST
134 }/* mysqlc */
135 }/* connectivity */
137 //------------------------------------------------------------------------------
138 #define DECL_PROP1IMPL(varname, type) \
139 pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(static_cast< type*>(0)),
140 //------------------------------------------------------------------------------
141 #define DECL_PROP0(varname, type) \
142 DECL_PROP1IMPL(varname, type) 0)
143 //------------------------------------------------------------------------------
144 #define DECL_BOOL_PROP1IMPL(varname) \
145 pProperties[nPos++] = Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
146 //------------------------------------------------------------------------------
147 #define DECL_BOOL_PROP0(varname) \
148 DECL_BOOL_PROP1IMPL(varname) 0)
152 #endif // _CONNECTIVITY_PROPERTYIDS_HXX_
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */