1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_
28 #define _CONNECTIVITY_PROPERTYIDS_HXX_
29 
30 // this define has to be set to split the names into different dll's or so's
31 // every dll has his own set of property names
32 #include <rtl/ustring.hxx>
33 #ifndef _MAP_
34 #include <map>
35 #endif
36 #include "connectivity/dbtoolsdllapi.hxx"
37 
38 namespace dbtools
39 {
40 	class OOO_DLLPUBLIC_DBTOOLS OPropertyMap
41 	{
42 		::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
43 
44 		::rtl::OUString fillValue(sal_Int32 _nIndex);
45 	public:
46 		OPropertyMap()
47 		{
48 		}
49 		~OPropertyMap();
50 		::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const;
51 	};
52 }
53 
54 namespace connectivity
55 {
56 	namespace CONNECTIVITY_PROPERTY_NAME_SPACE
57 	{
58 		typedef const sal_Char* (*PVFN)();
59 
60 		struct OOO_DLLPUBLIC_DBTOOLS UStringDescription
61 		{
62 			const sal_Char*	pZeroTerminatedName;
63 			sal_Int32 nLength;
64 
65 			UStringDescription(PVFN _fCharFkt);
66 			operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
67 			~UStringDescription();
68 		private:
69 			UStringDescription();
70 		};
71 	}
72 }
73 
74 
75 //------------------------------------------------------------------------------
76 #define DECL_PROP1IMPL(varname, type) \
77 pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type*>(NULL)),
78 //------------------------------------------------------------------------------
79 #define DECL_PROP0(varname, type)	\
80 	DECL_PROP1IMPL(varname, type) 0)
81 //------------------------------------------------------------------------------
82 #define DECL_BOOL_PROP1IMPL(varname) \
83         pProperties[nPos++] = ::com::sun::star::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
84 //------------------------------------------------------------------------------
85 #define DECL_BOOL_PROP0(varname)	\
86 	DECL_BOOL_PROP1IMPL(varname) 0)
87 
88 
89 #define PROPERTY_ID_QUERYTIMEOUT					1
90 #define PROPERTY_ID_MAXFIELDSIZE					2
91 #define PROPERTY_ID_MAXROWS							3
92 #define PROPERTY_ID_CURSORNAME						4
93 #define PROPERTY_ID_RESULTSETCONCURRENCY			5
94 #define PROPERTY_ID_RESULTSETTYPE					6
95 #define PROPERTY_ID_FETCHDIRECTION					7
96 #define PROPERTY_ID_FETCHSIZE						8
97 #define PROPERTY_ID_ESCAPEPROCESSING				9
98 #define PROPERTY_ID_USEBOOKMARKS					10
99 // Column
100 #define PROPERTY_ID_NAME							11
101 #define PROPERTY_ID_TYPE							12
102 #define PROPERTY_ID_TYPENAME						13
103 #define PROPERTY_ID_PRECISION						14
104 #define PROPERTY_ID_SCALE							15
105 #define PROPERTY_ID_ISNULLABLE						16
106 #define PROPERTY_ID_ISAUTOINCREMENT					17
107 #define PROPERTY_ID_ISROWVERSION					18
108 #define PROPERTY_ID_DESCRIPTION						19
109 #define PROPERTY_ID_DEFAULTVALUE					20
110 
111 #define PROPERTY_ID_REFERENCEDTABLE					21
112 #define PROPERTY_ID_UPDATERULE						22
113 #define PROPERTY_ID_DELETERULE						23
114 #define PROPERTY_ID_CATALOG							24
115 #define PROPERTY_ID_ISUNIQUE						25
116 #define PROPERTY_ID_ISPRIMARYKEYINDEX				26
117 #define PROPERTY_ID_ISCLUSTERED						27
118 #define PROPERTY_ID_ISASCENDING						28
119 #define PROPERTY_ID_SCHEMANAME						29
120 #define PROPERTY_ID_CATALOGNAME						30
121 
122 #define PROPERTY_ID_COMMAND							31
123 #define PROPERTY_ID_CHECKOPTION						32
124 #define PROPERTY_ID_PASSWORD						33
125 #define PROPERTY_ID_RELATEDCOLUMN					34
126 
127 #define PROPERTY_ID_FUNCTION           				35
128 #define PROPERTY_ID_TABLENAME          				36
129 #define PROPERTY_ID_REALNAME           				37
130 #define PROPERTY_ID_DBASEPRECISIONCHANGED			38
131 #define PROPERTY_ID_ISCURRENCY						39
132 #define PROPERTY_ID_ISBOOKMARKABLE					40
133 
134 #define PROPERTY_ID_INVALID_INDEX					41
135 #define PROPERTY_ID_HY010							43
136 #define PROPERTY_ID_LABEL                           44
137 #define PROPERTY_ID_DELIMITER						45
138 #define PROPERTY_ID_FORMATKEY						46
139 #define PROPERTY_ID_LOCALE							47
140 #define PROPERTY_ID_IM001							48
141 
142 #define PROPERTY_ID_AUTOINCREMENTCREATION			49
143 
144 #define PROPERTY_ID_PRIVILEGES						50
145 #define PROPERTY_ID_HAVINGCLAUSE					51
146 
147 #define PROPERTY_ID_ISSIGNED						52
148 #define PROPERTY_ID_AGGREGATEFUNCTION				53
149 #define PROPERTY_ID_ISSEARCHABLE				    54
150 
151 #define PROPERTY_ID_APPLYFILTER 				    55
152 #define PROPERTY_ID_FILTER				            56
153 #define PROPERTY_ID_MASTERFIELDS			        57
154 #define PROPERTY_ID_DETAILFIELDS			        58
155 #define PROPERTY_ID_FIELDTYPE			            59
156 #define PROPERTY_ID_VALUE       			        60
157 #define PROPERTY_ID_ACTIVE_CONNECTION               61
158 
159 #endif // _CONNECTIVITY_PROPERTYIDS_HXX_
160