LibreOffice Module connectivity (master) 1
NResultSet.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 <memory>
23
24#include <com/sun/star/sdbc/XResultSet.hpp>
25#include <com/sun/star/sdbc/XRow.hpp>
26#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
27#include <com/sun/star/sdbc/XCloseable.hpp>
28#include <com/sun/star/sdbc/XColumnLocate.hpp>
29#include <com/sun/star/util/XCancellable.hpp>
30#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
31#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
32#include <com/sun/star/sdbc/XRowUpdate.hpp>
33#include <com/sun/star/sdbcx/XRowLocate.hpp>
34#include <com/sun/star/sdbcx/XDeleteRows.hpp>
41#include "NStatement.hxx"
43
44namespace connectivity::evoab
45{
46 struct ComparisonData;
47
49 {
50 public:
51 virtual EBook* openBook(const char *abname) = 0;
52 virtual void executeQuery (EBook* pBook, EBookQuery* pQuery) = 0;
53 virtual void freeContacts() = 0;
54 virtual bool isLDAP( EBook *pBook ) = 0;
55 virtual bool isLocal( EBook *pBook ) = 0;
56 virtual EContact *getContact(sal_Int32 nIndex) = 0;
57 virtual sal_Int32 getNumContacts() = 0;
58 virtual bool hasContacts() = 0;
59 virtual void sortContacts( const ComparisonData& _rCompData ) = 0;
60 OString getUserName( EBook *pBook );
62 };
63
64 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet
65 , css::sdbc::XRow
66 , css::sdbc::XResultSetMetaDataSupplier
67 , css::util::XCancellable
68 , css::sdbc::XWarningsSupplier
69 , css::sdbc::XCloseable
70 , css::sdbc::XColumnLocate
71 , css::lang::XServiceInfo
73
74
75 class OEvoabResultSet final : public cppu::BaseMutex
76 ,public OResultSet_BASE
78 ,public ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet>
79 {
80 private:
81 std::unique_ptr<OEvoabVersionHelper> m_pVersionHelper;
82
87
89 // <properties>
90 sal_Int32 m_nFetchSize;
94 // </properties>
95
96 // Data & iteration
97 sal_Int32 m_nIndex;
98 sal_Int32 m_nLength;
100 {
101 return m_pVersionHelper->getContact(m_nIndex);
102 }
103
104 // OPropertyArrayUsageHelper
105 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
106 // OPropertySetHelper
107 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
108
109 // you can't delete objects of this type
110 virtual ~OEvoabResultSet() override;
111 public:
113
114 OEvoabResultSet( OCommonStatement *pStmt, OEvoabConnection *pConnection );
115 void construct( const QueryData& _rData );
116
117 // ::cppu::OComponentHelper
118 virtual void SAL_CALL disposing() override;
119 // XInterface
120 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
121 virtual void SAL_CALL acquire() noexcept override;
122 virtual void SAL_CALL release() noexcept override;
123 //XTypeProvider
124 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
125 // XPropertySet
126 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
127 // XResultSet
128 virtual sal_Bool SAL_CALL next( ) override;
129 virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
130 virtual sal_Bool SAL_CALL isAfterLast( ) override;
131 virtual sal_Bool SAL_CALL isFirst( ) override;
132 virtual sal_Bool SAL_CALL isLast( ) override;
133 virtual void SAL_CALL beforeFirst( ) override;
134 virtual void SAL_CALL afterLast( ) override;
135 virtual sal_Bool SAL_CALL first( ) override;
136 virtual sal_Bool SAL_CALL last( ) override;
137 virtual sal_Int32 SAL_CALL getRow( ) override;
138 virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
139 virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
140 virtual sal_Bool SAL_CALL previous( ) override;
141 virtual void SAL_CALL refreshRow( ) override;
142 virtual sal_Bool SAL_CALL rowUpdated( ) override;
143 virtual sal_Bool SAL_CALL rowInserted( ) override;
144 virtual sal_Bool SAL_CALL rowDeleted( ) override;
145 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
146 // XRow
147 virtual sal_Bool SAL_CALL wasNull( ) override;
148 virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
149 virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
150 virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
151 virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
152 virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
153 virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
154 virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
155 virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
156 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
157 virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
158 virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
159 virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
160 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
161 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
162 virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
163 virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
164 virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
165 virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
166 virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
167 // XCancellable
168 virtual void SAL_CALL cancel( ) override;
169 // XCloseable
170 virtual void SAL_CALL close( ) override;
171 // XResultSetMetaDataSupplier
172 virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
173 // XWarningsSupplier
174 virtual css::uno::Any SAL_CALL getWarnings( ) override;
175 virtual void SAL_CALL clearWarnings( ) override;
176 // XColumnLocate
177 virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
178 };
179}
180
181
182/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void EContact
Definition: EApi.h:44
void EBookQuery
Definition: EApi.h:81
void EBook
Definition: EApi.h:80
virtual void SAL_CALL disposing() override
Definition: NResultSet.cxx:592
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:719
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:665
virtual sal_Bool SAL_CALL rowDeleted() override
Definition: NResultSet.cxx:919
std::unique_ptr< OEvoabVersionHelper > m_pVersionHelper
Definition: NResultSet.hxx:81
virtual sal_Bool SAL_CALL next() override
Definition: NResultSet.cxx:777
virtual sal_Bool SAL_CALL isBeforeFirst() override
Definition: NResultSet.cxx:797
virtual void SAL_CALL refreshRow() override
Definition: NResultSet.cxx:943
virtual void SAL_CALL beforeFirst() override
Definition: NResultSet.cxx:837
virtual sal_Bool SAL_CALL rowInserted() override
Definition: NResultSet.cxx:927
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
Definition: NResultSet.cxx:873
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:737
virtual sal_Bool SAL_CALL first() override
Definition: NResultSet.cxx:854
OEvoabResultSet(OCommonStatement *pStmt, OEvoabConnection *pConnection)
Definition: NResultSet.cxx:489
virtual css::uno::Any SAL_CALL getWarnings() override
Definition: NResultSet.cxx:975
virtual sal_Bool SAL_CALL isAfterLast() override
Definition: NResultSet.cxx:813
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
Definition: NResultSet.cxx:885
virtual sal_Int32 SAL_CALL findColumn(const OUString &columnName) override
Definition: NResultSet.cxx:981
virtual void SAL_CALL cancel() override
Definition: NResultSet.cxx:952
virtual sal_Bool SAL_CALL last() override
Definition: NResultSet.cxx:864
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:755
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:743
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:749
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:671
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: NResultSet.cxx:602
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:643
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
Definition: NResultSet.cxx:911
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
rtl::Reference< OEvoabResultSetMetaData > m_xMetaData
Definition: NResultSet.hxx:85
virtual sal_Bool SAL_CALL isLast() override
Definition: NResultSet.cxx:829
virtual void SAL_CALL afterLast() override
Definition: NResultSet.cxx:845
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: NResultSet.cxx:610
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:695
virtual sal_Int32 SAL_CALL getRow() override
Definition: NResultSet.cxx:805
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: NResultSet.cxx:689
virtual sal_Bool SAL_CALL wasNull() override
Definition: NResultSet.cxx:789
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:677
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:713
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
Definition: NResultSet.cxx:764
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:683
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL rowUpdated() override
Definition: NResultSet.cxx:935
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:731
virtual sal_Bool SAL_CALL isFirst() override
Definition: NResultSet.cxx:821
virtual void SAL_CALL clearWarnings() override
Definition: NResultSet.cxx:970
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:707
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
getString: @nColumnNum: The column index from the table.
Definition: NResultSet.cxx:628
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:701
::dbtools::WarningsContainer m_aWarnings
Definition: NResultSet.hxx:86
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:725
virtual sal_Bool SAL_CALL previous() override
Definition: NResultSet.cxx:898
virtual void SAL_CALL close() override
Definition: NResultSet.cxx:959
void construct(const QueryData &_rData)
Definition: NResultSet.cxx:537
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: NResultSet.cxx:659
virtual EBook * openBook(const char *abname)=0
virtual void executeQuery(EBook *pBook, EBookQuery *pQuery)=0
virtual bool isLocal(EBook *pBook)=0
virtual bool isLDAP(EBook *pBook)=0
virtual EContact * getContact(sal_Int32 nIndex)=0
virtual void sortContacts(const ComparisonData &_rCompData)=0
helper class for implementing XWarningsSupplier, which mixes own warnings with warnings obtained from...
Type
::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, css::sdbc::XWarningsSupplier, css::sdbc::XCloseable, css::sdbc::XColumnLocate, css::lang::XServiceInfo > OResultSet_BASE
Definition: NResultSet.hxx:72
const char * columnName
Definition: pq_statics.cxx:56
unsigned char sal_Bool
signed char sal_Int8