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 std::unique_lock<std::mutex>& rGuard,
54 css::uno::Any& rRowContent,
55 const css::uno::Reference< css::sdbc::XRow >& xRow );
56
57 sal_Int32
58 impl_getColumnCount(std::unique_lock<std::mutex>&);
59
61 static void
63 std::unique_lock<std::mutex>& rGuard,
64 css::uno::Any& rAny
65 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
66
68 static void
70 std::unique_lock<std::mutex>& rGuard,
71 css::uno::Any& rAny
72 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
73
75 static void
77 std::unique_lock<std::mutex>& rGuard,
78 css::uno::Any& rAny
79 , const css::uno::Reference< css::ucb::XContentAccess >& xContentAccess );
80
82 void
83 impl_propagateFetchSizeAndDirection( std::unique_lock<std::mutex>& rGuard, sal_Int32 nFetchSize, bool bFetchDirection );
84
85 css::ucb::FetchResult impl_fetchHelper(
86 std::unique_lock<std::mutex>& rGuard,
87 sal_Int32 nRowStartPosition, sal_Int32 nRowCount, bool bDirection,
88 std::function<void(std::unique_lock<std::mutex>&, css::uno::Any& rRowContent)> impl_loadRow);
89
90public:
91 CachedContentResultSetStub( css::uno::Reference< css::sdbc::XResultSet > const & xOrigin );
92
93 virtual ~CachedContentResultSetStub() override;
94
95
96 // XInterface
97 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
98 virtual void SAL_CALL acquire()
99 noexcept override;
100 virtual void SAL_CALL release()
101 noexcept override;
102
103 // own inherited
104
105 virtual void
106 impl_propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
107
108 virtual void
109 impl_vetoableChange( const css::beans::PropertyChangeEvent& aEvent ) override;
110
111 // XTypeProvider
112
113 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
114 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
115
116 // XServiceInfo
117 virtual OUString SAL_CALL getImplementationName() override;
118 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
119 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
120
121 // XFetchProvider
122
123
124 virtual css::ucb::FetchResult SAL_CALL
125 fetch( sal_Int32 nRowStartPosition
126 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
127
128
129 // XFetchProviderForContentAccess
130
131 virtual css::ucb::FetchResult SAL_CALL
132 fetchContentIdentifierStrings( sal_Int32 nRowStartPosition
133 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
134
135 virtual css::ucb::FetchResult SAL_CALL
136 fetchContentIdentifiers( sal_Int32 nRowStartPosition
137 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
138
139 virtual css::ucb::FetchResult SAL_CALL
140 fetchContents( sal_Int32 nRowStartPosition
141 , sal_Int32 nRowCount, sal_Bool bDirection ) override;
142};
143
144
146 public cppu::WeakImplHelper<
147 css::lang::XServiceInfo,
148 css::ucb::XCachedContentResultSetStubFactory>
149{
150public:
151
153
154 virtual ~CachedContentResultSetStubFactory() override;
155
156 // XServiceInfo
157 virtual OUString SAL_CALL getImplementationName() override;
158 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
159 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
160
161 // XCachedContentResultSetStubFactory
162
163 virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
164 createCachedContentResultSetStub(
165 const css::uno::Reference< css::sdbc::XResultSet > & xSource ) override;
166};
167
168/* 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
static void impl_getCurrentContentIdentifier(std::unique_lock< std::mutex > &rGuard, css::uno::Any &rAny, const css::uno::Reference< css::ucb::XContentAccess > &xContentAccess)
virtual void impl_vetoableChange(const css::beans::PropertyChangeEvent &aEvent) override
css::ucb::FetchResult impl_fetchHelper(std::unique_lock< std::mutex > &rGuard, sal_Int32 nRowStartPosition, sal_Int32 nRowCount, bool bDirection, std::function< void(std::unique_lock< std::mutex > &, css::uno::Any &rRowContent)> impl_loadRow)
static void impl_getCurrentContent(std::unique_lock< std::mutex > &rGuard, css::uno::Any &rAny, const css::uno::Reference< css::ucb::XContentAccess > &xContentAccess)
static void impl_getCurrentContentIdentifierString(std::unique_lock< std::mutex > &rGuard, 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
void impl_getCurrentRowContent(std::unique_lock< std::mutex > &rGuard, css::uno::Any &rRowContent, const css::uno::Reference< css::sdbc::XRow > &xRow)
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
void impl_propagateFetchSizeAndDirection(std::unique_lock< std::mutex > &rGuard, sal_Int32 nFetchSize, bool bFetchDirection)
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
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
sal_Int32 impl_getColumnCount(std::unique_lock< std::mutex > &)
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