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 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>
24 #include <documentstreamaccess.hxx>
28 namespace vcl
{ class Window
; }
32 namespace datastreams
{
37 class DataStream
: boost::noncopyable
57 Cell( const Cell
& r
);
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
);
75 ScDocShell
*pShell
, const OUString
& rURL
, const ScRange
& rRange
,
76 sal_Int32 nLimit
, MoveType eMove
, sal_uInt32 nSettings
);
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
;}
88 const OUString
& rURL
, const ScRange
& rRange
, sal_Int32 nLimit
,
89 MoveType eMove
, const sal_uInt32 nSettings
);
95 void SetRefreshOnEmptyLine( bool bVal
);
103 DECL_LINK_TYPED( ImportTimerHdl
, Timer
*, void );
106 ScDocShell
* mpDocShell
;
107 DocumentStreamAccess maDocAccess
;
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.
115 bool mbRefreshOnEmptyLine
;
118 size_t mnLinesSinceRefresh
;
119 double mfLastRefreshTime
;
121 ScRange maStartRange
;
126 rtl::Reference
<datastreams::ReaderThread
> mxReaderThread
;
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */