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/.
16 #include <rtl/ustring.hxx>
18 #include "orcusxml.hxx"
24 class ScDBDataManager
;
26 class DataTransformation
;
28 class SC_DLLPUBLIC ExternalDataSource
32 * The URL for the external data provider. The URL
33 * will be passed to the data provider together with
36 * A data provider may decide to ignore the URL string.
41 * The data provider is a unique identifier that will
42 * allow to identify and instantiate the required data
45 * Examples for the internal data providers are:
47 * org.libreoffice.dataprovider.calc.csv
48 * org.libreoffice.dataprovider.calc.json
50 * Only internal data providers should use the:
51 * "org.libreoffice.dataprovider prefix".
56 * The ID allows the same data provider to support different
59 * A data provider may decide to ignore the ID string.
63 ScOrcusImportXMLParam maParam
;
65 std::shared_ptr
<DataProvider
> mpDataProvider
;
66 std::shared_ptr
<ScDBDataManager
> mpDBDataManager
;
68 std::vector
<std::shared_ptr
<sc::DataTransformation
>> maDataTransformations
;
73 ExternalDataSource(OUString aURL
, OUString aProvider
, ScDocument
* pDoc
);
75 void setUpdateFrequency(double nUpdateFrequency
);
77 void setID(const OUString
& rID
);
78 void setURL(const OUString
& rURL
);
79 void setProvider(const OUString
& rProvider
);
80 void setXMLImportParam(const ScOrcusImportXMLParam
& rParam
);
82 const OUString
& getURL() const;
83 const OUString
& getProvider() const;
84 const OUString
& getID() const;
85 const ScOrcusImportXMLParam
& getXMLImportParam() const;
86 static double getUpdateFrequency();
87 OUString
getDBName() const;
88 void setDBData(const OUString
& rDBName
);
89 ScDBDataManager
* getDBManager();
91 void refresh(ScDocument
* pDoc
, bool bDeterministic
= false);
93 void AddDataTransformation(const std::shared_ptr
<sc::DataTransformation
>& mpDataTransformation
);
94 const std::vector
<std::shared_ptr
<sc::DataTransformation
>>& getDataTransformation() const;
97 class SC_DLLPUBLIC ExternalDataMapper
100 std::vector
<ExternalDataSource
> maDataSources
;
103 ExternalDataMapper(ScDocument
& rDoc
);
105 ~ExternalDataMapper();
107 void insertDataSource(const ExternalDataSource
& rSource
);
109 const std::vector
<ExternalDataSource
>& getDataSources() const;
110 std::vector
<ExternalDataSource
>& getDataSources();
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */