LibreOffice Module ucb (master)  1
gio_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 #ifndef INCLUDED_UCB_SOURCE_UCP_GIO_GIO_DATASUPPLIER_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_GIO_GIO_DATASUPPLIER_HXX
22 
23 #include <ucbhelper/resultset.hxx>
24 #include "gio_content.hxx"
25 #include <memory>
26 #include <vector>
27 
28 namespace gio
29 {
30 
31 class Content;
32 
34 {
35  OUString aId;
36  css::uno::Reference< css::ucb::XContentIdentifier > xId;
37  css::uno::Reference< css::ucb::XContent > xContent;
38  css::uno::Reference< css::sdbc::XRow > xRow;
39  GFileInfo * const pInfo;
40 
41  explicit ResultListEntry( GFileInfo *pInInfo ) : pInfo(pInInfo)
42  {
43  g_object_ref( pInfo );
44  }
45 
47  {
48  g_object_unref( pInfo );
49  }
50 };
51 
52 typedef std::vector< std::unique_ptr<ResultListEntry> > ResultList;
53 
55 {
56 private:
58  sal_Int32 const mnOpenMode;
60  bool getData();
61  ResultList maResults;
62 public:
63  DataSupplier( const rtl::Reference< Content >& rContent, sal_Int32 nOpenMode );
64  virtual ~DataSupplier() override;
65 
66  virtual OUString queryContentIdentifierString( sal_uInt32 nIndex ) override;
67  virtual css::uno::Reference< css::ucb::XContentIdentifier >
68  queryContentIdentifier( sal_uInt32 nIndex ) override;
69  virtual css::uno::Reference< css::ucb::XContent >
70  queryContent( sal_uInt32 nIndex ) override;
71 
72  virtual bool getResult( sal_uInt32 nIndex ) override;
73 
74  virtual sal_uInt32 totalCount() override;
75  virtual sal_uInt32 currentCount() override;
76  virtual bool isCountFinal() override;
77 
78  virtual css::uno::Reference< css::sdbc::XRow >
79  queryPropertyValues( sal_uInt32 nIndex ) override;
80  virtual void releasePropertyValues( sal_uInt32 nIndex ) override;
81 
82  virtual void close() override;
83 
84  virtual void validate() override;
85 };
86 
87 }
88 
89 #endif
90 
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::unique_ptr< ResultListEntry > > ResultList
css::uno::Reference< css::sdbc::XRow > xRow
virtual void validate() override
ResultListEntry(GFileInfo *pInInfo)
virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override
virtual void close() override
rtl::Reference< ::gio::Content > mxContent
GFileInfo *const pInfo
virtual css::uno::Reference< css::ucb::XContent > queryContent(sal_uInt32 nIndex) override
virtual css::uno::Reference< css::sdbc::XRow > queryPropertyValues(sal_uInt32 nIndex) override
DataSupplier(const rtl::Reference< Content > &rContent, sal_Int32 nOpenMode)
virtual bool isCountFinal() override
virtual sal_uInt32 totalCount() override
virtual void releasePropertyValues(sal_uInt32 nIndex) override
sal_Int32 const mnOpenMode
virtual css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifier(sal_uInt32 nIndex) override
virtual sal_uInt32 currentCount() override
css::uno::Reference< css::ucb::XContent > xContent
virtual bool getResult(sal_uInt32 nIndex) override
virtual ~DataSupplier() override
css::uno::Reference< css::ucb::XContentIdentifier > xId