blob: 162ecbeb541173cbf3133a0887f2b249ff0a376c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SC_SOURCE_UI_INC_DATAPROVIDER_HXX
#define INCLUDED_SC_SOURCE_UI_INC_DATAPROVIDER_HXX
#include <salhelper/thread.hxx>
#include <tools/stream.hxx>
#include <rtl/ustring.hxx>
#include <address.hxx>
namespace sc {
class CSVFetchThread : public salhelper::Thread
{
SvStream *mpStream;
bool mbTerminate;
virtual void execute() override;
public:
CSVFetchThread();
virtual ~CSVFetchThread() override;
void RequestTerminate();
void IsRequestedTerminate();
void Terminate();
void EndThread();
};
class DataProvider
{
virtual ~DataProvider() = 0;
virtual void StartImport() = 0;
virtual void StopImport() = 0;
virtual void Refresh() = 0;
virtual void SetUrl(OUString) = 0;
virtual void SetRefreshRate(double) = 0;
virtual ScRange GetRange() const = 0;
virtual const OUString& GetURL() const = 0;
protected:
virtual void DecodeURL() = 0;
};
class CSVDataProvider : public DataProvider
{
OUString maURL;
double mnRefreshRate;
bool mbImportUnderway;
public:
CSVDataProvider (OUString& rUrl);
virtual ~CSVDataProvider() override;
virtual void StartImport() override;
virtual void StopImport() override;
virtual void Refresh() override;
virtual void SetUrl(OUString) override;
virtual void SetRefreshRate(double mnRefreshRate) override;
ScRange GetRange() const override;
const OUString& GetURL() const override { return maURL; }
private:
virtual void DecodeURL() override;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|