xref: /aoo41x/main/svx/source/form/sdbdatacolumn.cxx (revision cdf0e10c)
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 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_svx.hxx"
30 #include "sdbdatacolumn.hxx"
31 
32 //..............................................................................
33 namespace svxform
34 {
35 //..............................................................................
36 
37 	using namespace ::com::sun::star::uno;
38 	using namespace ::com::sun::star::lang;
39 	using namespace ::com::sun::star::beans;
40 	using namespace ::com::sun::star::sdbc;
41 	using namespace ::com::sun::star::util;
42 	using namespace ::com::sun::star::io;
43 	using namespace ::com::sun::star::container;
44 
45 	//==========================================================================
46 	//= DataColumn - a class wrapping an object implementing a sdb::DataColumn service
47 	//==========================================================================
48 	DataColumn::DataColumn(const Reference< ::com::sun::star::beans::XPropertySet>& _rxIFace)
49 	{
50 		m_xPropertySet = _rxIFace;
51 		m_xColumn = Reference< ::com::sun::star::sdb::XColumn>(_rxIFace, UNO_QUERY);
52 		m_xColumnUpdate = Reference< ::com::sun::star::sdb::XColumnUpdate>(_rxIFace, UNO_QUERY);
53 
54 		if (!m_xPropertySet.is() || !m_xColumn.is())
55 		{
56 			m_xPropertySet = NULL;
57 			m_xColumn = NULL;
58 			m_xColumnUpdate = NULL;
59 		}
60 	}
61 
62 	// Reference< XPropertySet>
63 	Reference< XPropertySetInfo> DataColumn::getPropertySetInfo() const throw( RuntimeException )
64 	{
65 		return m_xPropertySet->getPropertySetInfo();
66 	}
67 
68 	void DataColumn::setPropertyValue(const ::rtl::OUString& aPropertyName, const Any& aValue) throw( UnknownPropertyException,  PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException )
69 	{
70 		m_xPropertySet->setPropertyValue(aPropertyName, aValue);
71 	}
72 
73 	Any DataColumn::getPropertyValue(const ::rtl::OUString& PropertyName) const throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
74 	{
75 		return m_xPropertySet->getPropertyValue(PropertyName);
76 	}
77 
78 	void DataColumn::addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference< XPropertyChangeListener>& xListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
79 	{
80 		m_xPropertySet->addPropertyChangeListener(aPropertyName, xListener);
81 	}
82 
83 	void DataColumn::removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference< XPropertyChangeListener>& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
84 	{
85 		m_xPropertySet->removePropertyChangeListener(aPropertyName, aListener);
86 	}
87 
88 	void DataColumn::addVetoableChangeListener(const ::rtl::OUString& PropertyName, const Reference< XVetoableChangeListener>& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
89 	{
90 		m_xPropertySet->addVetoableChangeListener(PropertyName, aListener);
91 	}
92 
93 	void DataColumn::removeVetoableChangeListener(const ::rtl::OUString& PropertyName, const Reference< XVetoableChangeListener>& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
94 	{
95 		m_xPropertySet->removeVetoableChangeListener(PropertyName, aListener);
96 	}
97 
98 	// XColumn
99 	sal_Bool DataColumn::wasNull() throw( SQLException, RuntimeException )
100 	{
101 		return m_xColumn->wasNull();
102 	}
103 
104 	::rtl::OUString DataColumn::getString() throw( SQLException, RuntimeException )
105 	{
106 		return m_xColumn->getString();
107 	}
108 
109 	sal_Bool DataColumn::getBoolean() throw( SQLException, RuntimeException )
110 	{
111 		return m_xColumn->getBoolean();
112 	}
113 
114 	sal_Int8 DataColumn::getByte() throw( SQLException, RuntimeException )
115 	{
116 		return m_xColumn->getByte();
117 	}
118 
119 	sal_Int16 DataColumn::getShort() throw( SQLException, RuntimeException )
120 	{
121 		return m_xColumn->getShort();
122 	}
123 
124 	sal_Int32 DataColumn::getInt() throw( SQLException, RuntimeException )
125 	{
126 		return m_xColumn->getInt();
127 	}
128 
129 	sal_Int64 DataColumn::getLong() throw( SQLException, RuntimeException )
130 	{
131 		return m_xColumn->getLong();
132 	}
133 
134 	float DataColumn::getFloat() throw( SQLException, RuntimeException )
135 	{
136 		return m_xColumn->getFloat();
137 	}
138 
139 	double DataColumn::getDouble() throw( SQLException, RuntimeException )
140 	{
141 		return m_xColumn->getDouble();
142 	}
143 
144 	Sequence< sal_Int8 > DataColumn::getBytes() throw( SQLException, RuntimeException )
145 	{
146 		return m_xColumn->getBytes();
147 	}
148 
149 	com::sun::star::util::Date DataColumn::getDate() throw( SQLException, RuntimeException )
150 	{
151 		return m_xColumn->getDate();
152 	}
153 
154 	com::sun::star::util::Time DataColumn::getTime() throw( SQLException, RuntimeException )
155 	{
156 		return m_xColumn->getTime();
157 	}
158 
159 	com::sun::star::util::DateTime DataColumn::getTimestamp() throw( SQLException, RuntimeException )
160 	{
161 		return m_xColumn->getTimestamp();
162 	}
163 
164 	Reference< XInputStream> DataColumn::getBinaryStream() throw( SQLException, RuntimeException )
165 	{
166 		return m_xColumn->getBinaryStream();
167 	}
168 
169 	Reference< XInputStream> DataColumn::getCharacterStream() throw( SQLException, RuntimeException )
170 	{
171 		return m_xColumn->getCharacterStream();
172 	}
173 
174 	Any DataColumn::getObject(const Reference< XNameAccess>& typeMap) throw( SQLException, RuntimeException )
175 	{
176 		return m_xColumn->getObject(typeMap);
177 	}
178 
179 	Reference< XRef> DataColumn::getRef() throw( SQLException, RuntimeException )
180 	{
181 		return m_xColumn->getRef();
182 	}
183 
184 	Reference< XBlob> DataColumn::getBlob() throw( SQLException, RuntimeException )
185 	{
186 		return m_xColumn->getBlob();
187 	}
188 
189 	Reference< XClob> DataColumn::getClob() throw( SQLException, RuntimeException )
190 	{
191 		return m_xColumn->getClob();
192 	}
193 
194 	Reference< XArray> DataColumn::getArray() throw( SQLException, RuntimeException )
195 	{
196 		return m_xColumn->getArray();
197 	}
198 
199 	// XColumnUpdate
200 	void DataColumn::updateNull() throw( SQLException, RuntimeException )
201 	{
202 		m_xColumnUpdate->updateNull();
203 	}
204 
205 	void DataColumn::updateBoolean(sal_Bool x) throw( SQLException, RuntimeException )
206 	{
207 		m_xColumnUpdate->updateBoolean(x);
208 	}
209 
210 	void DataColumn::updateByte(sal_Int8 x) throw( SQLException, RuntimeException )
211 	{
212 		m_xColumnUpdate->updateByte(x);
213 	}
214 
215 	void DataColumn::updateShort(sal_Int16 x) throw( SQLException, RuntimeException )
216 	{
217 		m_xColumnUpdate->updateShort(x);
218 	}
219 
220 	void DataColumn::updateInt(sal_Int32 x) throw( SQLException, RuntimeException )
221 	{
222 		m_xColumnUpdate->updateInt(x);
223 	}
224 
225 	void DataColumn::updateLong(sal_Int64 x) throw( SQLException, RuntimeException )
226 	{
227 		m_xColumnUpdate->updateLong(x);
228 	}
229 
230 	void DataColumn::updateFloat(float x) throw( SQLException, RuntimeException )
231 	{
232 		m_xColumnUpdate->updateFloat(x);
233 	}
234 
235 	void DataColumn::updateDouble(double x) throw( SQLException, RuntimeException )
236 	{
237 		m_xColumnUpdate->updateDouble(x);
238 	}
239 
240 	void DataColumn::updateString(const ::rtl::OUString& x) throw( SQLException, RuntimeException )
241 	{
242 		m_xColumnUpdate->updateString(x);
243 	}
244 
245 	void DataColumn::updateBytes(const Sequence< sal_Int8 >& x) throw( SQLException, RuntimeException )
246 	{
247 		m_xColumnUpdate->updateBytes(x);
248 	}
249 
250 	void DataColumn::updateDate(const com::sun::star::util::Date& x) throw( SQLException, RuntimeException )
251 	{
252 		m_xColumnUpdate->updateDate(x);
253 	}
254 
255 	void DataColumn::updateTime(const com::sun::star::util::Time& x) throw( SQLException, RuntimeException )
256 	{
257 		m_xColumnUpdate->updateTime(x);
258 	}
259 
260 	void DataColumn::updateTimestamp(const com::sun::star::util::DateTime& x) throw( SQLException, RuntimeException )
261 	{
262 		m_xColumnUpdate->updateTimestamp(x);
263 	}
264 
265 	void DataColumn::updateBinaryStream(const Reference< XInputStream>& x, sal_Int32 length) throw( SQLException, RuntimeException )
266 	{
267 		m_xColumnUpdate->updateBinaryStream(x, length);
268 	}
269 
270 	void DataColumn::updateCharacterStream(const Reference< XInputStream>& x, sal_Int32 length) throw( SQLException, RuntimeException )
271 	{
272 		m_xColumnUpdate->updateCharacterStream(x, length);
273 	}
274 
275 	void DataColumn::updateObject(const Any& x) throw( SQLException, RuntimeException )
276 	{
277 		m_xColumnUpdate->updateObject(x);
278 	}
279 
280 	void DataColumn::updateNumericObject(const Any& x, sal_Int32 scale) throw( SQLException, RuntimeException )
281 	{
282 		m_xColumnUpdate->updateNumericObject(x, scale);
283 	}
284 
285 	//..............................................................................
286 }	// namespace svxform
287 //..............................................................................
288