1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include "sdbdatacolumn.hxx"
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
;
36 //= DataColumn - a class wrapping an object implementing a sdb::DataColumn service
38 DataColumn::DataColumn(const Reference
< ::com::sun::star::beans::XPropertySet
>& _rxIFace
)
40 m_xPropertySet
= _rxIFace
;
41 m_xColumn
= Reference
< ::com::sun::star::sdb::XColumn
>(_rxIFace
, UNO_QUERY
);
42 m_xColumnUpdate
= Reference
< ::com::sun::star::sdb::XColumnUpdate
>(_rxIFace
, UNO_QUERY
);
44 if (!m_xPropertySet
.is() || !m_xColumn
.is())
46 m_xPropertySet
= NULL
;
48 m_xColumnUpdate
= NULL
;
52 // Reference< XPropertySet>
53 Reference
< XPropertySetInfo
> DataColumn::getPropertySetInfo() const throw( RuntimeException
)
55 return m_xPropertySet
->getPropertySetInfo();
58 void DataColumn::setPropertyValue(const OUString
& aPropertyName
, const Any
& aValue
) throw( UnknownPropertyException
, PropertyVetoException
, IllegalArgumentException
, WrappedTargetException
, RuntimeException
)
60 m_xPropertySet
->setPropertyValue(aPropertyName
, aValue
);
63 Any
DataColumn::getPropertyValue(const OUString
& PropertyName
) const throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
65 return m_xPropertySet
->getPropertyValue(PropertyName
);
68 void DataColumn::addPropertyChangeListener(const OUString
& aPropertyName
, const Reference
< XPropertyChangeListener
>& xListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
70 m_xPropertySet
->addPropertyChangeListener(aPropertyName
, xListener
);
73 void DataColumn::removePropertyChangeListener(const OUString
& aPropertyName
, const Reference
< XPropertyChangeListener
>& aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
75 m_xPropertySet
->removePropertyChangeListener(aPropertyName
, aListener
);
78 void DataColumn::addVetoableChangeListener(const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
>& aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
80 m_xPropertySet
->addVetoableChangeListener(PropertyName
, aListener
);
83 void DataColumn::removeVetoableChangeListener(const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
>& aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
85 m_xPropertySet
->removeVetoableChangeListener(PropertyName
, aListener
);
89 bool DataColumn::wasNull() throw( SQLException
, RuntimeException
)
91 return m_xColumn
->wasNull();
94 OUString
DataColumn::getString() throw( SQLException
, RuntimeException
)
96 return m_xColumn
->getString();
99 bool DataColumn::getBoolean() throw( SQLException
, RuntimeException
)
101 return m_xColumn
->getBoolean();
104 sal_Int8
DataColumn::getByte() throw( SQLException
, RuntimeException
)
106 return m_xColumn
->getByte();
109 sal_Int16
DataColumn::getShort() throw( SQLException
, RuntimeException
)
111 return m_xColumn
->getShort();
114 sal_Int32
DataColumn::getInt() throw( SQLException
, RuntimeException
)
116 return m_xColumn
->getInt();
119 sal_Int64
DataColumn::getLong() throw( SQLException
, RuntimeException
)
121 return m_xColumn
->getLong();
124 float DataColumn::getFloat() throw( SQLException
, RuntimeException
)
126 return m_xColumn
->getFloat();
129 double DataColumn::getDouble() throw( SQLException
, RuntimeException
)
131 return m_xColumn
->getDouble();
134 Sequence
< sal_Int8
> DataColumn::getBytes() throw( SQLException
, RuntimeException
)
136 return m_xColumn
->getBytes();
139 com::sun::star::util::Date
DataColumn::getDate() throw( SQLException
, RuntimeException
)
141 return m_xColumn
->getDate();
144 com::sun::star::util::Time
DataColumn::getTime() throw( SQLException
, RuntimeException
)
146 return m_xColumn
->getTime();
149 com::sun::star::util::DateTime
DataColumn::getTimestamp() throw( SQLException
, RuntimeException
)
151 return m_xColumn
->getTimestamp();
154 Reference
< XInputStream
> DataColumn::getBinaryStream() throw( SQLException
, RuntimeException
)
156 return m_xColumn
->getBinaryStream();
159 Reference
< XInputStream
> DataColumn::getCharacterStream() throw( SQLException
, RuntimeException
)
161 return m_xColumn
->getCharacterStream();
164 Any
DataColumn::getObject(const Reference
< XNameAccess
>& typeMap
) throw( SQLException
, RuntimeException
)
166 return m_xColumn
->getObject(typeMap
);
169 Reference
< XRef
> DataColumn::getRef() throw( SQLException
, RuntimeException
)
171 return m_xColumn
->getRef();
174 Reference
< XBlob
> DataColumn::getBlob() throw( SQLException
, RuntimeException
)
176 return m_xColumn
->getBlob();
179 Reference
< XClob
> DataColumn::getClob() throw( SQLException
, RuntimeException
)
181 return m_xColumn
->getClob();
184 Reference
< XArray
> DataColumn::getArray() throw( SQLException
, RuntimeException
)
186 return m_xColumn
->getArray();
190 void DataColumn::updateNull() throw( SQLException
, RuntimeException
)
192 m_xColumnUpdate
->updateNull();
195 void DataColumn::updateBoolean(bool x
) throw( SQLException
, RuntimeException
)
197 m_xColumnUpdate
->updateBoolean(x
);
200 void DataColumn::updateByte(sal_Int8 x
) throw( SQLException
, RuntimeException
)
202 m_xColumnUpdate
->updateByte(x
);
205 void DataColumn::updateShort(sal_Int16 x
) throw( SQLException
, RuntimeException
)
207 m_xColumnUpdate
->updateShort(x
);
210 void DataColumn::updateInt(sal_Int32 x
) throw( SQLException
, RuntimeException
)
212 m_xColumnUpdate
->updateInt(x
);
215 void DataColumn::updateLong(sal_Int64 x
) throw( SQLException
, RuntimeException
)
217 m_xColumnUpdate
->updateLong(x
);
220 void DataColumn::updateFloat(float x
) throw( SQLException
, RuntimeException
)
222 m_xColumnUpdate
->updateFloat(x
);
225 void DataColumn::updateDouble(double x
) throw( SQLException
, RuntimeException
)
227 m_xColumnUpdate
->updateDouble(x
);
230 void DataColumn::updateString(const OUString
& x
) throw( SQLException
, RuntimeException
)
232 m_xColumnUpdate
->updateString(x
);
235 void DataColumn::updateBytes(const Sequence
< sal_Int8
>& x
) throw( SQLException
, RuntimeException
)
237 m_xColumnUpdate
->updateBytes(x
);
240 void DataColumn::updateDate(const com::sun::star::util::Date
& x
) throw( SQLException
, RuntimeException
)
242 m_xColumnUpdate
->updateDate(x
);
245 void DataColumn::updateTime(const com::sun::star::util::Time
& x
) throw( SQLException
, RuntimeException
)
247 m_xColumnUpdate
->updateTime(x
);
250 void DataColumn::updateTimestamp(const com::sun::star::util::DateTime
& x
) throw( SQLException
, RuntimeException
)
252 m_xColumnUpdate
->updateTimestamp(x
);
255 void DataColumn::updateBinaryStream(const Reference
< XInputStream
>& x
, sal_Int32 length
) throw( SQLException
, RuntimeException
)
257 m_xColumnUpdate
->updateBinaryStream(x
, length
);
260 void DataColumn::updateCharacterStream(const Reference
< XInputStream
>& x
, sal_Int32 length
) throw( SQLException
, RuntimeException
)
262 m_xColumnUpdate
->updateCharacterStream(x
, length
);
265 void DataColumn::updateObject(const Any
& x
) throw( SQLException
, RuntimeException
)
267 m_xColumnUpdate
->updateObject(x
);
270 void DataColumn::updateNumericObject(const Any
& x
, sal_Int32 scale
) throw( SQLException
, RuntimeException
)
272 m_xColumnUpdate
->updateNumericObject(x
, scale
);
276 } // namespace svxform
279 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */