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#pragma once
11
12#include <vector>
13
14#include "scdllapi.h"
15
16#include <rtl/ustring.hxx>
17
18#include "orcusxml.hxx"
19
20class ScDocument;
21
22namespace sc
23{
24class ScDBDataManager;
25class DataProvider;
26class DataTransformation;
27
29{
30private:
38 OUString maURL;
39
53 OUString maProvider;
54
61 OUString maID;
62
64
65 std::shared_ptr<DataProvider> mpDataProvider;
66 std::shared_ptr<ScDBDataManager> mpDBDataManager;
67
68 std::vector<std::shared_ptr<sc::DataTransformation>> maDataTransformations;
69
71
72public:
73 ExternalDataSource(OUString aURL, OUString aProvider, ScDocument* pDoc);
74
75 void setUpdateFrequency(double nUpdateFrequency);
76
77 void setID(const OUString& rID);
78 void setURL(const OUString& rURL);
79 void setProvider(const OUString& rProvider);
80 void setXMLImportParam(const ScOrcusImportXMLParam& rParam);
81
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();
90
91 void refresh(ScDocument* pDoc, bool bDeterministic = false);
92
93 void AddDataTransformation(const std::shared_ptr<sc::DataTransformation>& mpDataTransformation);
94 const std::vector<std::shared_ptr<sc::DataTransformation>>& getDataTransformation() const;
95};
96
98{
99 //ScDocument& mrDoc;
100 std::vector<ExternalDataSource> maDataSources;
101
102public:
104
106
107 void insertDataSource(const ExternalDataSource& rSource);
108
109 const std::vector<ExternalDataSource>& getDataSources() const;
110 std::vector<ExternalDataSource>& getDataSources();
111};
112}
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< ExternalDataSource > maDataSources
Definition: datamapper.hxx:100
std::shared_ptr< DataProvider > mpDataProvider
Definition: datamapper.hxx:65
void setUpdateFrequency(double nUpdateFrequency)
std::vector< std::shared_ptr< sc::DataTransformation > > maDataTransformations
Definition: datamapper.hxx:68
ScOrcusImportXMLParam maParam
Definition: datamapper.hxx:63
OUString maURL
The URL for the external data provider.
Definition: datamapper.hxx:38
OUString maID
The ID allows the same data provider to support different data streams.
Definition: datamapper.hxx:61
std::shared_ptr< ScDBDataManager > mpDBDataManager
Definition: datamapper.hxx:66
OUString maProvider
The data provider is a unique identifier that will allow to identify and instantiate the required dat...
Definition: datamapper.hxx:53
This class handles the copying of the data from the imported temporary document to the actual documen...
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
#define SC_DLLPUBLIC
Definition: scdllapi.h:27