1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef SC_DATASTREAM_HXX
11 #define SC_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>
24 #include <documentstreamaccess.hxx>
32 namespace datastreams
{
38 class DataStream
: boost::noncopyable
58 Cell( const Cell
& r
);
64 std::vector
<Cell
> maCells
;
66 typedef std::vector
<Line
> LinesType
;
68 enum MoveType
{ NO_MOVE
, RANGE_DOWN
, MOVE_DOWN
, MOVE_UP
};
69 enum { SCRIPT_STREAM
= 1, VALUES_IN_LINE
= 2 };
71 static void MakeToolbarVisible();
72 static DataStream
* Set(ScDocShell
*pShell
, const OUString
& rURL
, const ScRange
& rRange
,
73 sal_Int32 nLimit
, MoveType eMove
, sal_uInt32 nSettings
);
75 static MoveType
ToMoveType( const OUString
& rMoveStr
);
78 ScDocShell
*pShell
, const OUString
& rURL
, const ScRange
& rRange
,
79 sal_Int32 nLimit
, MoveType eMove
, sal_uInt32 nSettings
);
83 ScRange
GetRange() const;
84 const OUString
& GetURL() const { return msURL
; }
85 const sal_Int32
& GetLimit() const { return mnLimit
; }
86 MoveType
GetMove() const;
87 const sal_uInt32
& GetSettings() const { return mnSettings
; }
88 bool IsRefreshOnEmptyLine() const;
91 const OUString
& rURL
, const ScRange
& rRange
, sal_Int32 nLimit
,
92 MoveType eMove
, const sal_uInt32 nSettings
);
98 void SetRefreshOnEmptyLine( bool bVal
);
106 DECL_LINK( ImportTimerHdl
, void* );
109 ScDocShell
* mpDocShell
;
111 DocumentStreamAccess maDocAccess
;
114 sal_uInt32 mnSettings
;
115 MoveType meOrigMove
; // Initial move setting. This one gets saved to file.
116 MoveType meMove
; // move setting during streaming, which may change in the middle.
119 bool mbRefreshOnEmptyLine
;
122 size_t mnLinesSinceRefresh
;
123 double mfLastRefreshTime
;
125 ScRange maStartRange
;
130 rtl::Reference
<datastreams::ReaderThread
> mxReaderThread
;
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */