nss: upgrade to release 3.73
[LibreOffice.git] / sc / inc / datamapper.hxx
blob0972931fd28d9f7c93a1ac6305adb2f81c18b2a9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
11 #define INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
13 #include <vector>
15 #include "scdllapi.h"
17 #include <rtl/ustring.hxx>
19 #include "orcusxml.hxx"
21 class ScDocument;
23 namespace sc
25 class ScDBDataManager;
26 class DataProvider;
27 class DataTransformation;
29 class SC_DLLPUBLIC ExternalDataSource
31 private:
32 /**
33 * The URL for the external data provider. The URL
34 * will be passed to the data provider together with
35 * the ID.
37 * A data provider may decide to ignore the URL string.
39 OUString maURL;
41 /**
42 * The data provider is a unique identifier that will
43 * allow to identify and instantiate the required data
44 * provider.
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".
54 OUString maProvider;
56 /**
57 * The ID allows the same data provider to support different
58 * data streams.
60 * A data provider may decide to ignore the ID string.
62 OUString maID;
64 ScOrcusImportXMLParam maParam;
66 std::shared_ptr<DataProvider> mpDataProvider;
67 std::shared_ptr<ScDBDataManager> mpDBDataManager;
69 std::vector<std::shared_ptr<sc::DataTransformation>> maDataTransformations;
71 ScDocument* mpDoc;
73 public:
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
100 //ScDocument& mrDoc;
101 std::vector<ExternalDataSource> maDataSources;
103 public:
104 ExternalDataMapper(ScDocument& rDoc);
106 ~ExternalDataMapper();
108 void insertDataSource(const ExternalDataSource& rSource);
110 const std::vector<ExternalDataSource>& getDataSources() const;
111 std::vector<ExternalDataSource>& getDataSources();
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */