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>
19 #include "orcusxml.hxx"
25 class ScDBDataManager
;
27 class DataTransformation
;
29 class SC_DLLPUBLIC ExternalDataSource
33 * The URL for the external data provider. The URL
34 * will be passed to the data provider together with
37 * A data provider may decide to ignore the URL string.
42 * The data provider is a unique identifier that will
43 * allow to identify and instantiate the required data
46 * Examples for the internal data providers are:
48 * org.libreoffice.dataprovider.calc.csv
49 * org.libreoffice.dataprovider.calc.json
51 * Only internal data providers should use the:
52 * "org.libreoffice.dataprovider prefix".
57 * The ID allows the same data provider to support different
60 * A data provider may decide to ignore the ID string.
64 ScOrcusImportXMLParam maParam
;
66 std::shared_ptr
<DataProvider
> mpDataProvider
;
67 std::shared_ptr
<ScDBDataManager
> mpDBDataManager
;
69 std::vector
<std::shared_ptr
<sc::DataTransformation
>> maDataTransformations
;
74 ExternalDataSource(const OUString
& rURL
, const OUString
& rProvider
, ScDocument
* pDoc
);
76 void setUpdateFrequency(double nUpdateFrequency
);
78 void setID(const OUString
& rID
);
79 void setURL(const OUString
& rURL
);
80 void setProvider(const OUString
& rProvider
);
81 void setXMLImportParam(const ScOrcusImportXMLParam
& rParam
);
83 const OUString
& getURL() const;
84 const OUString
& getProvider() const;
85 const OUString
& getID() const;
86 const ScOrcusImportXMLParam
& getXMLImportParam() const;
87 static double getUpdateFrequency();
88 OUString
getDBName() const;
89 void setDBData(const OUString
& rDBName
);
90 ScDBDataManager
* getDBManager();
92 void refresh(ScDocument
* pDoc
, bool bDeterministic
= false);
94 void AddDataTransformation(const std::shared_ptr
<sc::DataTransformation
>& mpDataTransformation
);
95 const std::vector
<std::shared_ptr
<sc::DataTransformation
>>& getDataTransformation() const;
98 class SC_DLLPUBLIC ExternalDataMapper
101 std::vector
<ExternalDataSource
> maDataSources
;
104 ExternalDataMapper(ScDocument
& rDoc
);
106 ~ExternalDataMapper();
108 void insertDataSource(const ExternalDataSource
& rSource
);
110 const std::vector
<ExternalDataSource
>& getDataSources() const;
111 std::vector
<ExternalDataSource
>& getDataSources();
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */