fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / datastream.hxx
blobbfe17201732607acc0596f73770a514ec986b8e6
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_SOURCE_UI_INC_DATASTREAM_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_DATASTREAM_HXX
13 #include <sal/config.h>
15 #include <rtl/ref.hxx>
16 #include <rtl/ustring.hxx>
17 #include <vcl/timer.hxx>
18 #include <address.hxx>
20 #include <boost/noncopyable.hpp>
21 #include <boost/scoped_ptr.hpp>
22 #include <vector>
24 #include <documentstreamaccess.hxx>
26 class ScDocShell;
27 class ScDocument;
28 namespace vcl { class Window; }
30 namespace sc {
32 namespace datastreams {
33 class CallerThread;
34 class ReaderThread;
37 class DataStream : boost::noncopyable
39 public:
40 struct Cell
42 struct Str
44 size_t Pos;
45 size_t Size;
48 union
50 Str maStr;
51 double mfValue;
54 bool mbValue;
56 Cell();
57 Cell( const Cell& r );
60 struct Line
62 OString maLine;
63 std::vector<Cell> maCells;
65 typedef std::vector<Line> LinesType;
67 enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP };
68 enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 };
70 static void MakeToolbarVisible();
71 static DataStream* Set(ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
72 sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
74 DataStream(
75 ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
76 sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
78 ~DataStream();
80 ScRange GetRange() const;
81 const OUString& GetURL() const { return msURL; }
82 const sal_Int32& GetLimit() const { return mnLimit; }
83 MoveType GetMove() const { return meOrigMove;}
84 const sal_uInt32& GetSettings() const { return mnSettings; }
85 bool IsRefreshOnEmptyLine() const { return mbRefreshOnEmptyLine;}
87 void Decode(
88 const OUString& rURL, const ScRange& rRange, sal_Int32 nLimit,
89 MoveType eMove, const sal_uInt32 nSettings);
91 bool ImportData();
92 void StartImport();
93 void StopImport();
95 void SetRefreshOnEmptyLine( bool bVal );
97 private:
98 Line ConsumeLine();
99 void MoveData();
100 void Text2Doc();
101 void Refresh();
103 DECL_LINK_TYPED( ImportTimerHdl, Timer*, void );
105 private:
106 ScDocShell* mpDocShell;
107 DocumentStreamAccess maDocAccess;
108 OUString msURL;
109 sal_Int32 mnLimit;
110 sal_uInt32 mnSettings;
111 MoveType meOrigMove; // Initial move setting. This one gets saved to file.
112 MoveType meMove; // move setting during streaming, which may change in the middle.
113 bool mbRunning;
114 bool mbValuesInLine;
115 bool mbRefreshOnEmptyLine;
116 LinesType* mpLines;
117 size_t mnLinesCount;
118 size_t mnLinesSinceRefresh;
119 double mfLastRefreshTime;
120 SCROW mnCurRow;
121 ScRange maStartRange;
122 ScRange maEndRange;
124 Timer maImportTimer;
126 rtl::Reference<datastreams::ReaderThread> mxReaderThread;
127 bool mbIsFirst;
128 bool mbIsUpdate;
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */