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