LibreOffice Module ucb (master)  1
tdoc_datasupplier.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 <rtl/ref.hxx>
23 #include <ucbhelper/resultset.hxx>
24 #include <optional>
25 #include <memory>
26 #include <vector>
27 #include <string_view>
28 
29 namespace tdoc_ucp {
30 
31 struct DataSupplier_Impl;
32 class Content;
33 
35 {
37  {
38  OUString aURL;
39  css::uno::Reference< css::ucb::XContentIdentifier > xId;
40  css::uno::Reference< css::ucb::XContent > xContent;
41  css::uno::Reference< css::sdbc::XRow > xRow;
42 
43  explicit ResultListEntry( const OUString& rURL ) : aURL( rURL ) {}
44  };
45 
46  osl::Mutex m_aMutex;
47  std::vector< ResultListEntry > m_aResults;
49  css::uno::Reference< css::uno::XComponentContext > m_xContext;
50  std::optional<css::uno::Sequence< OUString > > m_xNamesOfChildren;
53 
54 private:
55  bool queryNamesOfChildren();
56  OUString assembleChildURL( std::u16string_view aName );
57 
58 public:
60  const css::uno::Reference< css::uno::XComponentContext >& rxContext,
61  const rtl::Reference< Content >& rContent );
62  virtual ~ResultSetDataSupplier() override;
63 
64  virtual OUString queryContentIdentifierString( sal_uInt32 nIndex ) override;
65  virtual css::uno::Reference< css::ucb::XContentIdentifier >
66  queryContentIdentifier( sal_uInt32 nIndex ) override;
67  virtual css::uno::Reference< css::ucb::XContent >
68  queryContent( sal_uInt32 nIndex ) override;
69 
70  virtual bool getResult( sal_uInt32 nIndex ) override;
71 
72  virtual sal_uInt32 totalCount() override;
73  virtual sal_uInt32 currentCount() override;
74  virtual bool isCountFinal() override;
75 
76  virtual css::uno::Reference< css::sdbc::XRow >
77  queryPropertyValues( sal_uInt32 nIndex ) override;
78  virtual void releasePropertyValues( sal_uInt32 nIndex ) override;
79 
80  virtual void close() override;
81 
82  virtual void validate() override;
83 };
84 
85 } // namespace tdoc_ucp
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< Content > m_xContent
virtual css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifier(sal_uInt32 nIndex) override
std::vector< ResultListEntry > m_aResults
css::uno::Reference< css::sdbc::XRow > xRow
std::optional< css::uno::Sequence< OUString > > m_xNamesOfChildren
virtual ~ResultSetDataSupplier() override
virtual bool getResult(sal_uInt32 nIndex) override
virtual css::uno::Reference< css::sdbc::XRow > queryPropertyValues(sal_uInt32 nIndex) override
css::uno::Reference< css::ucb::XContentIdentifier > xId
OUString assembleChildURL(std::u16string_view aName)
virtual bool isCountFinal() override
virtual void validate() override
virtual css::uno::Reference< css::ucb::XContent > queryContent(sal_uInt32 nIndex) override
virtual sal_uInt32 totalCount() override
virtual void releasePropertyValues(sal_uInt32 nIndex) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override
virtual sal_uInt32 currentCount() override
css::uno::Reference< css::ucb::XContent > xContent