LibreOffice Module ucb (master)  1
pkgdatasupplier.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 <com/sun/star/container/XEnumeration.hpp>
25 #include <vector>
26 
27 namespace package_ucp {
28 
29 class Content;
30 
32 {
33 public:
34  DataSupplier( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
35  const rtl::Reference< Content >& rContent );
36  virtual ~DataSupplier() override;
37 
38  virtual OUString queryContentIdentifierString( sal_uInt32 nIndex ) override;
39  virtual css::uno::Reference< css::ucb::XContentIdentifier >
40  queryContentIdentifier( sal_uInt32 nIndex ) override;
41  virtual css::uno::Reference< css::ucb::XContent >
42  queryContent( sal_uInt32 nIndex ) override;
43 
44  virtual bool getResult( sal_uInt32 nIndex ) override;
45 
46  virtual sal_uInt32 totalCount() override;
47  virtual sal_uInt32 currentCount() override;
48  virtual bool isCountFinal() override;
49 
50  virtual css::uno::Reference< css::sdbc::XRow >
51  queryPropertyValues( sal_uInt32 nIndex ) override;
52  virtual void releasePropertyValues( sal_uInt32 nIndex ) override;
53 
54  virtual void close() override;
55 
56  virtual void validate() override;
57 
58  OUString assembleChildURL( const OUString& aName );
59 
60 private:
62  {
63  OUString aURL;
64  css::uno::Reference< css::ucb::XContentIdentifier > xId;
65  css::uno::Reference< css::ucb::XContent > xContent;
66  css::uno::Reference< css::sdbc::XRow > xRow;
67 
68  explicit ResultListEntry( const OUString& rURL ) : aURL( rURL ) {}
69  };
70  osl::Mutex m_aMutex;
71  std::vector< ResultListEntry > m_aResults;
73  css::uno::Reference< css::uno::XComponentContext > m_xContext;
74  css::uno::Reference< css::container::XEnumeration > m_xFolderEnum;
77 };
78 
79 }
80 
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::ucb::XContentIdentifier > xId
sal_Int32 nIndex
OUString assembleChildURL(const OUString &aName)
virtual css::uno::Reference< css::ucb::XContent > queryContent(sal_uInt32 nIndex) override
virtual ~DataSupplier() override
virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override
css::uno::Reference< css::ucb::XContent > xContent
virtual css::uno::Reference< css::sdbc::XRow > queryPropertyValues(sal_uInt32 nIndex) override
virtual void validate() override
css::uno::Reference< css::sdbc::XRow > xRow
css::uno::Reference< css::container::XEnumeration > m_xFolderEnum
virtual sal_uInt32 totalCount() override
virtual void releasePropertyValues(sal_uInt32 nIndex) override
virtual bool getResult(sal_uInt32 nIndex) override
virtual bool isCountFinal() override
virtual css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifier(sal_uInt32 nIndex) override
std::vector< ResultListEntry > m_aResults
css::uno::Reference< css::uno::XComponentContext > m_xContext
DataSupplier(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const rtl::Reference< Content > &rContent)
virtual sal_uInt32 currentCount() override
OUString aName
rtl::Reference< Content > m_xContent
virtual void close() override