LibreOffice Module connectivity (master) 1
MacabResultSet.hxx
Go to the documentation of this file.
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#pragma once
21
22#include "MacabStatement.hxx"
24#include <com/sun/star/sdbc/XRow.hpp>
25#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
26#include <com/sun/star/sdbc/XColumnLocate.hpp>
27#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
28#include <com/sun/star/sdbc/XRowUpdate.hpp>
29#include <com/sun/star/sdbcx/XRowLocate.hpp>
30#include <com/sun/star/sdbcx/XDeleteRows.hpp>
33
34namespace connectivity::macab
35{
36 /*
37 ** MacabResultSet
38 */
39 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
40 css::sdbc::XRow,
41 css::sdbc::XResultSetMetaDataSupplier,
42 css::util::XCancellable,
43 css::sdbc::XWarningsSupplier,
44 css::sdbc::XResultSetUpdate,
45 css::sdbc::XRowUpdate,
46 css::sdbcx::XRowLocate,
47 css::sdbcx::XDeleteRows,
48 css::sdbc::XCloseable,
49 css::sdbc::XColumnLocate,
50 css::lang::XServiceInfo> MacabResultSet_BASE;
51 class MacabRecords;
52
56 public comphelper::OPropertyArrayUsageHelper<MacabResultSet>
57 {
58 protected:
59 ::rtl::Reference< MacabCommonStatement > m_xStatement; // the statement that has created this result set
60 ::rtl::Reference< MacabResultSetMetaData > m_xMetaData; // the description of the columns in this result set
61 MacabRecords * m_aMacabRecords; // address book entries matching the query
62 sal_Int32 m_nRowPos; // the current row within the result set
63 bool m_bWasNull; // last entry retrieved from this result set was NULL
64 OUString m_sTableName;
65
66 // OPropertyArrayUsageHelper
67 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
68
69 // OPropertySetHelper
70 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
71
72 virtual sal_Bool SAL_CALL convertFastPropertyValue(
73 css::uno::Any & rConvertedValue,
74 css::uno::Any & rOldValue,
75 sal_Int32 nHandle,
76 const css::uno::Any& rValue) override;
77 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
78 sal_Int32 nHandle,
79 const css::uno::Any& rValue) override;
80 virtual void SAL_CALL getFastPropertyValue(
81 css::uno::Any& rValue,
82 sal_Int32 nHandle) const override;
83
84 // you can't delete objects of this type
85 virtual ~MacabResultSet() override;
86
87 public:
89
90 explicit MacabResultSet(MacabCommonStatement *pStmt);
91
92 css::uno::Reference< css::uno::XInterface > operator *()
93 {
94 return css::uno::Reference< css::uno::XInterface >(*static_cast<MacabResultSet_BASE*>(this));
95 }
96
97 void allMacabRecords();
98 void someMacabRecords(const class MacabCondition *pCondition);
99 void sortMacabRecords(const class MacabOrder *pOrder);
100 void setTableName(const OUString& _sTableName);
101
102 // ::cppu::OComponentHelper
103 virtual void SAL_CALL disposing() override;
104
105 // XInterface
106 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
107 virtual void SAL_CALL acquire() noexcept override;
108 virtual void SAL_CALL release() noexcept override;
109
110 // XTypeProvider
111 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
112
113 // XPropertySet
114 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
115
116 // XResultSet
117 virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
118 virtual sal_Bool SAL_CALL isAfterLast( ) override;
119 virtual sal_Bool SAL_CALL isFirst( ) override;
120 virtual sal_Bool SAL_CALL isLast( ) override;
121 virtual void SAL_CALL beforeFirst( ) override;
122 virtual void SAL_CALL afterLast( ) override;
123 virtual sal_Bool SAL_CALL first( ) override;
124 virtual sal_Bool SAL_CALL last( ) override;
125 virtual sal_Int32 SAL_CALL getRow( ) override;
126 virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
127 virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
128 virtual sal_Bool SAL_CALL next( ) override;
129 virtual sal_Bool SAL_CALL previous( ) override;
130 virtual void SAL_CALL refreshRow( ) override;
131 virtual sal_Bool SAL_CALL rowUpdated( ) override;
132 virtual sal_Bool SAL_CALL rowInserted( ) override;
133 virtual sal_Bool SAL_CALL rowDeleted( ) override;
134 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
135
136 // XRow
137 virtual sal_Bool SAL_CALL wasNull( ) override;
138 virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
139 virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
140 virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
141 virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
142 virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
143 virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
144 virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
145 virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
146 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
147 virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
148 virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
149 virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
150 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
151 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
152 virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
153 virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
154 virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
155 virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
156 virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
157
158 // XResultSetMetaDataSupplier
159 virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
160
161 // XCancellable
162 virtual void SAL_CALL cancel( ) override;
163
164 // XCloseable
165 virtual void SAL_CALL close( ) override;
166
167 // XWarningsSupplier
168 virtual css::uno::Any SAL_CALL getWarnings( ) override;
169 virtual void SAL_CALL clearWarnings( ) override;
170
171 // XResultSetUpdate
172 virtual void SAL_CALL insertRow( ) override;
173 virtual void SAL_CALL updateRow( ) override;
174 virtual void SAL_CALL deleteRow( ) override;
175 virtual void SAL_CALL cancelRowUpdates( ) override;
176 virtual void SAL_CALL moveToInsertRow( ) override;
177 virtual void SAL_CALL moveToCurrentRow( ) override;
178 // XRowUpdate
179 virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) override;
180 virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) override;
181 virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) override;
182 virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) override;
183 virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) override;
184 virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) override;
185 virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) override;
186 virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) override;
187 virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) override;
188 virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
189 virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) override;
190 virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) override;
191 virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) override;
192 virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
193 virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
194 virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) override;
195 virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) override;
196
197 // XColumnLocate
198 virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
199
200 // XRowLocate
201 virtual css::uno::Any SAL_CALL getBookmark( ) override;
202 virtual sal_Bool SAL_CALL moveToBookmark( const css::uno::Any& bookmark ) override;
203 virtual sal_Bool SAL_CALL moveRelativeToBookmark( const css::uno::Any& bookmark, sal_Int32 rows ) override;
204 virtual sal_Int32 SAL_CALL compareBookmarks( const css::uno::Any& firstItem, const css::uno::Any& secondItem ) override;
205 virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) override;
206 virtual sal_Int32 SAL_CALL hashBookmark( const css::uno::Any& bookmark ) override;
207
208 // XDeleteRows
209 virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const css::uno::Sequence< css::uno::Any >& rows ) override;
210 };
211}
212
213/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex, sal_Bool x) override
void sortMacabRecords(const class MacabOrder *pOrder)
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual void SAL_CALL updateRow() override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isLast() override
virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex, const css::uno::Any &x, sal_Int32 scale) override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isAfterLast() override
virtual sal_Bool SAL_CALL previous() override
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const css::uno::Any &x) override
virtual void SAL_CALL clearWarnings() override
void someMacabRecords(const class MacabCondition *pCondition)
virtual void SAL_CALL updateFloat(sal_Int32 columnIndex, float x) override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
virtual void SAL_CALL moveToInsertRow() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
void setTableName(const OUString &_sTableName)
virtual void SAL_CALL release() noexcept override
virtual sal_Int32 SAL_CALL getRow() override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
::rtl::Reference< MacabCommonStatement > m_xStatement
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual void SAL_CALL updateByte(sal_Int32 columnIndex, sal_Int8 x) override
virtual void SAL_CALL beforeFirst() override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL updateNull(sal_Int32 columnIndex) override
virtual void SAL_CALL moveToCurrentRow() override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex, const css::util::DateTime &x) override
virtual void SAL_CALL updateShort(sal_Int32 columnIndex, sal_Int16 x) override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL updateLong(sal_Int32 columnIndex, sal_Int64 x) override
virtual void SAL_CALL updateBytes(sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 > &x) override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows(const css::uno::Sequence< css::uno::Any > &rows) override
virtual void SAL_CALL cancelRowUpdates() override
virtual void SAL_CALL updateInt(sal_Int32 columnIndex, sal_Int32 x) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL refreshRow() override
virtual sal_Bool SAL_CALL moveRelativeToBookmark(const css::uno::Any &bookmark, sal_Int32 rows) override
virtual sal_Int32 SAL_CALL compareBookmarks(const css::uno::Any &firstItem, const css::uno::Any &secondItem) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL afterLast() override
virtual sal_Bool SAL_CALL isFirst() override
virtual sal_Bool SAL_CALL wasNull() override
virtual sal_Int32 SAL_CALL hashBookmark(const css::uno::Any &bookmark) override
::rtl::Reference< MacabResultSetMetaData > m_xMetaData
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
virtual void SAL_CALL updateTime(sal_Int32 columnIndex, const css::util::Time &x) override
virtual sal_Bool SAL_CALL hasOrderedBookmarks() override
virtual sal_Bool SAL_CALL moveToBookmark(const css::uno::Any &bookmark) override
virtual void SAL_CALL insertRow() override
virtual void SAL_CALL close() override
virtual void SAL_CALL updateDouble(sal_Int32 columnIndex, double x) override
virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
virtual void SAL_CALL updateString(sal_Int32 columnIndex, const OUString &x) override
virtual sal_Bool SAL_CALL next() override
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual void SAL_CALL updateDate(sal_Int32 columnIndex, const css::util::Date &x) override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
MacabResultSet(MacabCommonStatement *pStmt)
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual void SAL_CALL cancel() override
virtual css::uno::Any SAL_CALL getBookmark() override
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
css::uno::Reference< css::uno::XInterface > operator*()
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual sal_Bool SAL_CALL rowUpdated() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL last() override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Int32 SAL_CALL findColumn(const OUString &columnName) override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Bool SAL_CALL rowInserted() override
virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream > &x, sal_Int32 length) override
virtual sal_Bool SAL_CALL first() override
virtual void SAL_CALL deleteRow() override
Type
::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, css::sdbc::XWarningsSupplier, css::sdbc::XResultSetUpdate, css::sdbc::XRowUpdate, css::sdbcx::XRowLocate, css::sdbcx::XDeleteRows, css::sdbc::XCloseable, css::sdbc::XColumnLocate, css::lang::XServiceInfo > MacabResultSet_BASE
sal_Int32 scale
Definition: pq_statics.cxx:62
const char * columnName
Definition: pq_statics.cxx:56
unsigned char sal_Bool
signed char sal_Int8