LCOV - code coverage report
Current view: top level - sc/source/ui/inc - datastream.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 2 0.0 %
Date: 2014-04-14 Functions: 0 4 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 SC_DATASTREAM_HXX
      11             : #define SC_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             : class Window;
      29             : 
      30             : namespace sc {
      31             : 
      32             : namespace datastreams {
      33             :     class CallerThread;
      34             :     class ReaderThread;
      35             : }
      36             : 
      37             : 
      38             : class DataStream : boost::noncopyable
      39             : {
      40             : public:
      41             :     struct Cell
      42             :     {
      43             :         struct Str
      44             :         {
      45             :             size_t Pos;
      46             :             size_t Size;
      47             :         };
      48             : 
      49             :         union
      50             :         {
      51             :             Str maStr;
      52             :             double mfValue;
      53             :         };
      54             : 
      55             :         bool mbValue;
      56             : 
      57             :         Cell();
      58             :         Cell( const Cell& r );
      59             :     };
      60             : 
      61           0 :     struct Line
      62             :     {
      63             :         OString maLine;
      64             :         std::vector<Cell> maCells;
      65             :     };
      66             :     typedef std::vector<Line> LinesType;
      67             : 
      68             :     enum MoveType { NO_MOVE, RANGE_DOWN, MOVE_DOWN, MOVE_UP };
      69             :     enum { SCRIPT_STREAM = 1, VALUES_IN_LINE = 2 };
      70             : 
      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);
      74             : 
      75             :     DataStream(
      76             :         ScDocShell *pShell, const OUString& rURL, const ScRange& rRange,
      77             :         sal_Int32 nLimit, MoveType eMove, sal_uInt32 nSettings);
      78             : 
      79             :     ~DataStream();
      80             : 
      81             :     ScRange GetRange() const;
      82           0 :     const OUString& GetURL() const { return msURL; }
      83             :     const sal_Int32& GetLimit() const { return mnLimit; }
      84             :     MoveType GetMove() const;
      85             :     const sal_uInt32& GetSettings() const { return mnSettings; }
      86             :     bool IsRefreshOnEmptyLine() const;
      87             : 
      88             :     void Decode(
      89             :         const OUString& rURL, const ScRange& rRange, sal_Int32 nLimit,
      90             :         MoveType eMove, const sal_uInt32 nSettings);
      91             : 
      92             :     bool ImportData();
      93             :     void StartImport();
      94             :     void StopImport();
      95             : 
      96             :     void SetRefreshOnEmptyLine( bool bVal );
      97             : 
      98             : private:
      99             :     Line ConsumeLine();
     100             :     void MoveData();
     101             :     void Text2Doc();
     102             :     void Refresh();
     103             : 
     104             :     DECL_LINK( ImportTimerHdl, void* );
     105             : 
     106             : private:
     107             :     ScDocShell* mpDocShell;
     108             :     ScDocument* mpDoc;
     109             :     DocumentStreamAccess maDocAccess;
     110             :     OUString msURL;
     111             :     sal_Int32 mnLimit;
     112             :     sal_uInt32 mnSettings;
     113             :     MoveType meOrigMove; // Initial move setting. This one gets saved to file.
     114             :     MoveType meMove; // move setting during streaming, which may change in the middle.
     115             :     bool mbRunning;
     116             :     bool mbValuesInLine;
     117             :     bool mbRefreshOnEmptyLine;
     118             :     LinesType* mpLines;
     119             :     size_t mnLinesCount;
     120             :     size_t mnLinesSinceRefresh;
     121             :     double mfLastRefreshTime;
     122             :     SCROW mnCurRow;
     123             :     ScRange maStartRange;
     124             :     ScRange maEndRange;
     125             : 
     126             :     Timer maImportTimer;
     127             : 
     128             :     rtl::Reference<datastreams::ReaderThread> mxReaderThread;
     129             : };
     130             : 
     131             : }
     132             : 
     133             : #endif
     134             : 
     135             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10