1 /*************************************************************************
2  *
3  *  The Contents of this file are made available subject to the terms of
4  *  the BSD license.
5  *
6  *  Copyright 2000, 2010 Oracle and/or its affiliates.
7  *  All rights reserved.
8  *
9  *  Redistribution and use in source and binary forms, with or without
10  *  modification, are permitted provided that the following conditions
11  *  are met:
12  *  1. Redistributions of source code must retain the above copyright
13  *     notice, this list of conditions and the following disclaimer.
14  *  2. Redistributions in binary form must reproduce the above copyright
15  *     notice, this list of conditions and the following disclaimer in the
16  *     documentation and/or other materials provided with the distribution.
17  *  3. Neither the name of Sun Microsystems, Inc. nor the names of its
18  *     contributors may be used to endorse or promote products derived
19  *     from this software without specific prior written permission.
20  *
21  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
30  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  *************************************************************************/
34 
35 #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_
36 #define _CONNECTIVITY_PROPERTYIDS_HXX_
37 
38 // this define has to be set to split the names into different dll's or so's
39 // every dll has his own set of property names
40 #include <rtl/ustring.hxx>
41 #ifndef _MAP_
42 #include <map>
43 #endif
44 
45 namespace connectivity
46 {
47 namespace skeleton
48 {
49 	class OPropertyMap
50 	{
51 		::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
52 
53 		::rtl::OUString fillValue(sal_Int32 _nIndex);
54 	public:
55 		OPropertyMap()
56 		{
57 		}
58 		~OPropertyMap();
59 		::rtl::OUString getNameByIndex(sal_Int32 _nIndex) const;
60 
61 		static OPropertyMap& getPropMap()
62 		{
63 			static OPropertyMap s_aPropMap;
64 			return s_aPropMap;
65 		}
66 	};
67 
68 
69 
70 		typedef const sal_Char* (*PVFN)();
71 
72 		struct UStringDescription
73 		{
74 			const sal_Char*	pZeroTerminatedName;
75 			sal_Int32 nLength;
76 
77 			UStringDescription(PVFN _fCharFkt);
78 			operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
79 			~UStringDescription();
80 		private:
81 			UStringDescription();
82 		};
83 	}
84 }
85 
86 
87 //------------------------------------------------------------------------------
88 #define DECL_PROP1IMPL(varname, type) \
89 pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::cppu::UnoType< type >::get(),
90 //------------------------------------------------------------------------------
91 #define DECL_PROP0(varname, type)	\
92 	DECL_PROP1IMPL(varname, type) 0)
93 //------------------------------------------------------------------------------
94 #define DECL_BOOL_PROP1IMPL(varname) \
95         pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
96 //------------------------------------------------------------------------------
97 #define DECL_BOOL_PROP0(varname)	\
98 	DECL_BOOL_PROP1IMPL(varname) 0)
99 
100 
101 #define PROPERTY_ID_QUERYTIMEOUT					1
102 #define PROPERTY_ID_MAXFIELDSIZE					2
103 #define PROPERTY_ID_MAXROWS							3
104 #define PROPERTY_ID_CURSORNAME						4
105 #define PROPERTY_ID_RESULTSETCONCURRENCY			5
106 #define PROPERTY_ID_RESULTSETTYPE					6
107 #define PROPERTY_ID_FETCHDIRECTION					7
108 #define PROPERTY_ID_FETCHSIZE						8
109 #define PROPERTY_ID_ESCAPEPROCESSING				9
110 #define PROPERTY_ID_USEBOOKMARKS					10
111 // Column
112 #define PROPERTY_ID_NAME							11
113 #define PROPERTY_ID_TYPE							12
114 #define PROPERTY_ID_TYPENAME						13
115 #define PROPERTY_ID_PRECISION						14
116 #define PROPERTY_ID_SCALE							15
117 #define PROPERTY_ID_ISNULLABLE						16
118 #define PROPERTY_ID_ISAUTOINCREMENT					17
119 #define PROPERTY_ID_ISROWVERSION					18
120 #define PROPERTY_ID_DESCRIPTION						19
121 #define PROPERTY_ID_DEFAULTVALUE					20
122 
123 #define PROPERTY_ID_REFERENCEDTABLE					21
124 #define PROPERTY_ID_UPDATERULE						22
125 #define PROPERTY_ID_DELETERULE						23
126 #define PROPERTY_ID_CATALOG							24
127 #define PROPERTY_ID_ISUNIQUE						25
128 #define PROPERTY_ID_ISPRIMARYKEYINDEX				26
129 #define PROPERTY_ID_ISCLUSTERED						27
130 #define PROPERTY_ID_ISASCENDING						28
131 #define PROPERTY_ID_SCHEMANAME						29
132 #define PROPERTY_ID_CATALOGNAME						30
133 
134 #define PROPERTY_ID_COMMAND							31
135 #define PROPERTY_ID_CHECKOPTION						32
136 #define PROPERTY_ID_PASSWORD						33
137 #define PROPERTY_ID_RELATEDCOLUMN					34
138 
139 #define PROPERTY_ID_FUNCTION           				35
140 #define PROPERTY_ID_TABLENAME          				36
141 #define PROPERTY_ID_REALNAME           				37
142 #define PROPERTY_ID_DBASEPRECISIONCHANGED			38
143 #define PROPERTY_ID_ISCURRENCY						39
144 #define PROPERTY_ID_ISBOOKMARKABLE					40
145 
146 #define PROPERTY_ID_INVALID_INDEX					41
147 #define PROPERTY_ID_ERRORMSG_SEQUENCE				42
148 #define PROPERTY_ID_HY010							43
149 #define PROPERTY_ID_HY0000							44
150 #define PROPERTY_ID_DELIMITER						45
151 #define PROPERTY_ID_FORMATKEY						46
152 #define PROPERTY_ID_LOCALE							47
153 #define PROPERTY_ID_IM001							48
154 
155 #define PROPERTY_ID_AUTOINCREMENTCREATION			49
156 
157 #define PROPERTY_ID_PRIVILEGES						50
158 
159 #endif // _CONNECTIVITY_PROPERTYIDS_HXX_
160 
161 
162