LibreOffice Module ucb (master) 1
cachedcontentresultsetstub.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
23#include <com/sun/star/lang/XTypeProvider.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/ucb/XFetchProvider.hpp>
26#include <com/sun/star/ucb/XFetchProviderForContentAccess.hpp>
27#include <com/sun/star/ucb/XCachedContentResultSetStubFactory.hpp>
29
32 , public css::lang::XTypeProvider
33 , public css::lang::XServiceInfo
34 , public css::ucb::XFetchProvider
35 , public css::ucb::XFetchProviderForContentAccess
36{
37private:
38 sal_Int32 m_nColumnCount;
40
41 //members to propagate fetchsize and direction:
48
51 void
53 css::uno::Any& rRowContent,
54 const css::uno::Reference< css::sdbc::XRow >& xRow );
55
56 sal_Int32
58
60 static void
62 css::uno::Any& rAny
63 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
64
66 static void
68 css::uno::Any& rAny
69 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
70
72 static void
74 css::uno::Any& rAny
75 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
76
78 void
79 impl_propagateFetchSizeAndDirection( sal_Int32 nFetchSize, bool bFetchDirection );
80
81 css::ucb::FetchResult impl_fetchHelper(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, bool bDirection,
82 std::function<void(css::uno::Any& rRowContent)> impl_loadRow);
83
84public:
85 CachedContentResultSetStub( css::uno::Reference< css::sdbc::XResultSet > const & xOrigin );
86
87 virtual ~CachedContentResultSetStub() override;
88
89
90 // XInterface
91 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
92 virtual void SAL_CALL acquire()
93 noexcept override;
94 virtual void SAL_CALL release()
95 noexcept override;
96
97 // own inherited
98
99 virtual void
100 impl_propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
101
102 virtual void
103 impl_vetoableChange( const css::beans::PropertyChangeEvent& aEvent ) override;
104
105 // XTypeProvider
106
107 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
108 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
109
110 // XServiceInfo
111 virtual OUString SAL_CALL getImplementationName() override;
112 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
113 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
114
115 // XFetchProvider
116
117
118 virtual css::ucb::FetchResult SAL_CALL
119 fetch( sal_Int32 nRowStartPosition
120 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
121
122
123 // XFetchProviderForContentAccess
124
125 virtual css::ucb::FetchResult SAL_CALL
126 fetchContentIdentifierStrings( sal_Int32 nRowStartPosition
127 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
128
129 virtual css::ucb::FetchResult SAL_CALL
130 fetchContentIdentifiers( sal_Int32 nRowStartPosition
131 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
132
133 virtual css::ucb::FetchResult SAL_CALL
134 fetchContents( sal_Int32 nRowStartPosition
135 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
136};
137
138
140 public cppu::WeakImplHelper<
141 css::lang::XServiceInfo,
142 css::ucb::XCachedContentResultSetStubFactory>
143{
144public:
145
147
148 virtual ~CachedContentResultSetStubFactory() override;
149
150 // XServiceInfo
151 virtual OUString SAL_CALL getImplementationName() override;
152 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
153 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
154
155 // XCachedContentResultSetStubFactory
156
157 virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
158 createCachedContentResultSetStub(
159 const css::uno::Reference< css::sdbc::XResultSet > & xSource ) override;
160};
161
162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL acquire() noexcept override
virtual void impl_propertyChange(const css::beans::PropertyChangeEvent &evt) override
virtual css::ucb::FetchResult SAL_CALL fetchContentIdentifierStrings(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, sal_Bool bDirection) override
virtual void impl_vetoableChange(const css::beans::PropertyChangeEvent &aEvent) override
void impl_propagateFetchSizeAndDirection(sal_Int32 nFetchSize, bool bFetchDirection)
static void impl_getCurrentContent(css::uno::Any &rAny, const css::uno::Reference< css::ucb::XContentAccess > &xContentAccess)
virtual css::ucb::FetchResult SAL_CALL fetch(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, sal_Bool bDirection) override
virtual void SAL_CALL release() noexcept override
virtual OUString SAL_CALL getImplementationName() override
virtual css::ucb::FetchResult SAL_CALL fetchContents(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, sal_Bool bDirection) override
css::ucb::FetchResult impl_fetchHelper(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, bool bDirection, std::function< void(css::uno::Any &rRowContent)> impl_loadRow)
static void impl_getCurrentContentIdentifierString(css::uno::Any &rAny, const css::uno::Reference< css::ucb::XContentAccess > &xContentAccess)
static void impl_getCurrentContentIdentifier(css::uno::Any &rAny, const css::uno::Reference< css::ucb::XContentAccess > &xContentAccess)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::ucb::FetchResult SAL_CALL fetchContentIdentifiers(sal_Int32 nRowStartPosition, sal_Int32 nRowCount, sal_Bool bDirection) override
void impl_getCurrentRowContent(css::uno::Any &rRowContent, const css::uno::Reference< css::sdbc::XRow > &xRow)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
CachedContentResultSetStub(css::uno::Reference< css::sdbc::XResultSet > const &xOrigin)
Type
unsigned char sal_Bool
signed char sal_Int8