Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / writerperfect / inc / WPXSvInputStream.hxx
blobb7e6a7a04484a90deaa57ad5347f4b847d3a23a6
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 #pragma once
12 #include <librevenge-stream/librevenge-stream.h>
13 #include <com/sun/star/uno/Reference.h>
14 #include <tools/long.hxx>
15 #include "writerperfectdllapi.h"
16 #include <memory>
17 #include <tools/stream.hxx>
18 #include <sot/storage.hxx>
20 namespace com::sun::star::io
22 class XInputStream;
23 class XSeekable;
26 namespace writerperfect
28 struct OLEStorageImpl;
29 struct ZipStorageImpl;
31 class SAL_DLLPUBLIC_RTTI WPXSvInputStream final : public librevenge::RVNGInputStream
33 public:
34 WRITERPERFECT_DLLPUBLIC
35 WPXSvInputStream(css::uno::Reference<css::io::XInputStream> const& xStream);
36 WRITERPERFECT_DLLPUBLIC virtual ~WPXSvInputStream() override;
38 virtual bool isStructured() override;
39 virtual unsigned subStreamCount() override;
40 virtual const char* subStreamName(unsigned id) override;
41 virtual bool existsSubStream(const char* name) override;
42 virtual librevenge::RVNGInputStream* getSubStreamByName(const char* name) override;
43 virtual librevenge::RVNGInputStream* getSubStreamById(unsigned id) override;
45 WRITERPERFECT_DLLPUBLIC virtual const unsigned char* read(unsigned long numBytes,
46 unsigned long& numBytesRead) override;
47 WRITERPERFECT_DLLPUBLIC virtual int seek(long offset,
48 librevenge::RVNG_SEEK_TYPE seekType) override;
49 virtual long tell() override;
50 virtual bool isEnd() override;
52 private:
53 tools::Long tellImpl();
54 int seek(tools::Long offset);
55 bool isOLE();
56 void ensureOLEIsInitialized();
57 bool isZip();
58 void ensureZipIsInitialized();
59 static librevenge::RVNGInputStream*
60 createWPXStream(const rtl::Reference<SotStorageStream>& rxStorage);
61 static librevenge::RVNGInputStream*
62 createWPXStream(const css::uno::Reference<css::io::XInputStream>& rxStream);
64 css::uno::Reference<css::io::XInputStream> mxStream;
65 css::uno::Reference<css::io::XSeekable> mxSeekable;
66 css::uno::Sequence<sal_Int8> maData;
67 std::unique_ptr<OLEStorageImpl> mpOLEStorage;
68 std::unique_ptr<ZipStorageImpl> mpZipStorage;
69 sal_Int64 mnLength;
70 unsigned long mnReadBufferPos;
71 bool mbCheckedOLE;
72 bool mbCheckedZip;
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */