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
17 #include <rtl/ustring.hxx>
24 class ScDBDataManager
;
26 class ScDBDataManager
;
27 class DataTransformation
;
29 class SC_DLLPUBLIC ExternalDataSource
34 * The URL for the external data provider. The URL
35 * will be passed to the data provider together with
38 * A data provider may decide to ignore the URL string.
43 * The data provider is a unique identifier that will
44 * allow to identify and instantiate the required data
47 * Examples for the internal data providers are:
49 * org.libreoffice.dataprovider.calc.csv
50 * org.libreoffice.dataprovider.calc.json
52 * Only internal data providers should use the:
53 * "org.libreoffice.dataprovider prefix".
58 * The ID allows the same data provider to support different
61 * A data provider may decide to ignore the ID string.
65 double mnUpdateFrequency
;
67 std::shared_ptr
<DataProvider
> mpDataProvider
;
68 std::shared_ptr
<ScDBDataManager
> mpDBDataManager
;
70 std::vector
<std::shared_ptr
<sc::DataTransformation
>> maDataTransformations
;
76 ExternalDataSource(const OUString
& rURL
,
77 const OUString
& rProvider
, ScDocument
* pDoc
);
79 ~ExternalDataSource();
81 void setUpdateFrequency(double nUpdateFrequency
);
83 void setID(const OUString
& rID
);
84 void setURL(const OUString
& rURL
);
85 void setProvider(const OUString
& rProvider
);
87 const OUString
& getURL() const;
88 const OUString
& getProvider() const;
89 const OUString
& getID() const;
90 double getUpdateFrequency() const;
91 OUString
getDBName() const;
92 void setDBData(const ScDBData
* pDBData
);
93 ScDBDataManager
* getDBManager();
95 void refresh(ScDocument
* pDoc
, bool bDeterministic
= false);
97 void AddDataTransformation(std::shared_ptr
<sc::DataTransformation
> mpDataTransformation
);
98 const std::vector
<std::shared_ptr
<sc::DataTransformation
>>& getDataTransformation() const;
101 class SC_DLLPUBLIC ExternalDataMapper
104 std::vector
<ExternalDataSource
> maDataSources
;
107 ExternalDataMapper(ScDocument
* pDoc
);
109 ~ExternalDataMapper();
111 void insertDataSource(const ExternalDataSource
& rSource
);
113 const std::vector
<ExternalDataSource
>& getDataSources() const;
114 std::vector
<ExternalDataSource
>& getDataSources();
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */