LibreOffice Module sc (master)  1
datamapper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
11 #define INCLUDED_SC_INC_EXTERNALDATAMAPPER_HXX
12 
13 #include <vector>
14 
15 #include "scdllapi.h"
16 
17 #include <rtl/ustring.hxx>
18 
19 #include "orcusxml.hxx"
20 
21 class ScDocument;
22 
23 namespace sc {
24 
25 class ScDBDataManager;
26 class DataProvider;
27 class DataTransformation;
28 
30 {
31 private:
32 
40  OUString maURL;
41 
55  OUString maProvider;
56 
63  OUString maID;
64 
66 
67  std::shared_ptr<DataProvider> mpDataProvider;
68  std::shared_ptr<ScDBDataManager> mpDBDataManager;
69 
70  std::vector<std::shared_ptr<sc::DataTransformation>> maDataTransformations;
71 
73 
74 public:
75 
76  ExternalDataSource(const OUString& rURL,
77  const OUString& rProvider, ScDocument* pDoc);
78 
79  void setUpdateFrequency(double nUpdateFrequency);
80 
81  void setID(const OUString& rID);
82  void setURL(const OUString& rURL);
83  void setProvider(const OUString& rProvider);
84  void setXMLImportParam(const ScOrcusImportXMLParam& rParam);
85 
86  const OUString& getURL() const;
87  const OUString& getProvider() const;
88  const OUString& getID() const;
89  const ScOrcusImportXMLParam& getXMLImportParam() const;
90  static double getUpdateFrequency();
91  OUString getDBName() const;
92  void setDBData(const OUString& rDBName);
93  ScDBDataManager* getDBManager();
94 
95  void refresh(ScDocument* pDoc, bool bDeterministic = false);
96 
97  void AddDataTransformation(const std::shared_ptr<sc::DataTransformation>& mpDataTransformation);
98  const std::vector<std::shared_ptr<sc::DataTransformation>>& getDataTransformation() const;
99 };
100 
102 {
103  //ScDocument& mrDoc;
104  std::vector<ExternalDataSource> maDataSources;
105 
106 public:
108 
110 
111  void insertDataSource(const ExternalDataSource& rSource);
112 
113  const std::vector<ExternalDataSource>& getDataSources() const;
114  std::vector<ExternalDataSource>& getDataSources();
115 };
116 
117 }
118 
119 #endif
120 
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class handles the copying of the data from the imported temporary document to the actual documen...
std::shared_ptr< DataProvider > mpDataProvider
Definition: datamapper.hxx:67
OUString maProvider
The data provider is a unique identifier that will allow to identify and instantiate the required dat...
Definition: datamapper.hxx:55
std::vector< ExternalDataSource > maDataSources
Definition: datamapper.hxx:104
std::vector< std::shared_ptr< sc::DataTransformation > > maDataTransformations
Definition: datamapper.hxx:70
OUString maID
The ID allows the same data provider to support different data streams.
Definition: datamapper.hxx:63
OUString maURL
The URL for the external data provider.
Definition: datamapper.hxx:40
std::shared_ptr< ScDBDataManager > mpDBDataManager
Definition: datamapper.hxx:68
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
ScOrcusImportXMLParam maParam
Definition: datamapper.hxx:65