1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #ifndef INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
11 #define INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
18 #include <rtl/ustring.hxx>
25 class ScDBDataManager
;
27 class ScDBDataManager
;
28 class DataTransformation
;
30 class SC_DLLPUBLIC ExternalDataSource
35 * The URL for the external data provider. The URL
36 * will be passed to the data provider together with
39 * A data provider may decide to ignore the URL string.
44 * The data provider is a unique identifier that will
45 * allow to identify and instantiate the required data
48 * Examples for the internal data providers are:
50 * org.libreoffice.dataprovider.calc.csv
51 * org.libreoffice.dataprovider.calc.json
53 * Only internal data providers should use the:
54 * "org.libreoffice.dataprovider prefix".
59 * The ID allows the same data provider to support different
62 * A data provider may decide to ignore the ID string.
66 double mnUpdateFrequency
;
68 std::shared_ptr
<DataProvider
> mpDataProvider
;
69 std::shared_ptr
<ScDBDataManager
> mpDBDataManager
;
71 std::vector
<std::shared_ptr
<sc::DataTransformation
>> maDataTransformations
;
77 ExternalDataSource(const OUString
& rURL
,
78 const OUString
& rProvider
, ScDocument
* pDoc
);
80 ~ExternalDataSource();
82 void setUpdateFrequency(double nUpdateFrequency
);
84 void setID(const OUString
& rID
);
85 void setURL(const OUString
& rURL
);
86 void setProvider(const OUString
& rProvider
);
88 const OUString
& getURL() const;
89 const OUString
& getProvider() const;
90 const OUString
& getID() const;
91 double getUpdateFrequency() const;
92 OUString
getDBName() const;
93 void setDBData(const ScDBData
* pDBData
);
94 ScDBDataManager
* getDBManager();
96 void refresh(ScDocument
* pDoc
, bool bDeterministic
= false);
98 void AddDataTransformation(std::shared_ptr
<sc::DataTransformation
> mpDataTransformation
);
99 const std::vector
<std::shared_ptr
<sc::DataTransformation
>>& getDataTransformation() const;
102 class SC_DLLPUBLIC ExternalDataMapper
105 std::vector
<ExternalDataSource
> maDataSources
;
108 ExternalDataMapper(ScDocument
* pDoc
);
110 ~ExternalDataMapper();
112 void insertDataSource(const ExternalDataSource
& rSource
);
114 const std::vector
<ExternalDataSource
>& getDataSources() const;
115 std::vector
<ExternalDataSource
>& getDataSources();
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */