LCOV - code coverage report
Current view: top level - sc/source/ui/inc - datastream.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 4 0.0 %
Date: 2014-11-03 Functions: 0 6 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #ifndef INCLUDED_SC_SOURCE_UI_INC_DATASTREAM_HXX
      11             : #define INCLUDED_SC_SOURCE_UI_INC_DATASTREAM_HXX
      12             : 
      13             : #include <sal/config.h>
      14             : 
      15             : #include <rtl/ref.hxx>
      16             : #include <rtl/ustring.hxx>
      17             : #include <vcl/timer.hxx>
      18             : #include <address.hxx>
      19             : 
      20             : #include <boost/noncopyable.hpp>
      21             : #include <boost/scoped_ptr.hpp>
      22             : #include <vector>
      23             : 
      24             : #include <documentstreamaccess.hxx>
      25             : 
      26             : class ScDocShell;
      27             : class ScDocument;
      28             : namespace vcl { class Window; }
      29             : 
      30             : namespace sc {
      31             : 
      32             : namespace datastreams {
      33             :     class CallerThread;
      34             :     class ReaderThread;
      35             : }
      36             : 
      37             : class DataStream : boost::noncopyable
      38             : {
      39             : public:
      40             :     struct Cell
      41             :     {
      42             :         struct Str
      43             :         {
      44             :             size_t Pos;
      45             :             size_t Size;
      46             :         };
      47             : 
      48             :         union
      49             :         {
      50             :             Str maStr;
      51             :             double mfValue;
      52             :         };
      53             : 
      54             :         bool mbValue;
      55             : 
      56             :         Cell();
      57             :         Cell( const Cell& r );
      58             :     };
      59             : 
      60           0 :     struct Line
      61             :     {
      62             :         OString maLine;
      63             :         std::vector<Cell> maCells;
      64             :     };
      65             :     typedef std::vector<Line> LinesType;
      66             : 
      67             :     enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP };
      68             :     enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 };
      69             : 
      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);
      73             : 
      74             :     DataStream(
      75             :         ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
      76             :         sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
      77             : 
      78             :     ~DataStream();
      79             : 
      80             :     ScRange GetRange() const;
      81           0 :     const OUString& GetURL() const { return msURL; }
      82             :     const sal_Int32& GetLimit() const { return mnLimit; }
      83           0 :     MoveType GetMove() const { return meOrigMove;}
      84             :     const sal_uInt32& GetSettings() const { return mnSettings; }
      85           0 :     bool IsRefreshOnEmptyLine() const { return mbRefreshOnEmptyLine;}
      86             : 
      87             :     void Decode(
      88             :         const OUString& rURL, const ScRange& rRange, sal_Int32 nLimit,
      89             :         MoveType eMove, const sal_uInt32 nSettings);
      90             : 
      91             :     bool ImportData();
      92             :     void StartImport();
      93             :     void StopImport();
      94             : 
      95             :     void SetRefreshOnEmptyLine( bool bVal );
      96             : 
      97             : private:
      98             :     Line ConsumeLine();
      99             :     void MoveData();
     100             :     void Text2Doc();
     101             :     void Refresh();
     102             : 
     103             :     DECL_LINK( ImportTimerHdl, void* );
     104             : 
     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;
     123             : 
     124             :     Timer maImportTimer;
     125             : 
     126             :     rtl::Reference<datastreams::ReaderThread> mxReaderThread;
     127             :     bool mbIsFirst;
     128             :     bool mbIsUpdate;
     129             : };
     130             : 
     131             : }
     132             : 
     133             : #endif
     134             : 
     135             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10