LibreOffice Module sc (master) 1
filter.hxx
Go to the documentation of this file.
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <rtl/textenc.h>
23#include <rtl/ustring.hxx>
25
26#include "scdllapi.h"
27#include <memory>
28
29class SfxMedium;
30class SvStream;
31
32class ScAddress;
33class ScDocument;
34class ScRange;
36class ScOrcusFilters;
37
38// for import
40
41// for export
43
44// These are implemented inside the scfilt library and lazy loaded
45
47 public:
48 virtual ~ScEEAbsImport() {}
49 virtual ErrCode Read( SvStream& rStream, const OUString& rBaseURL ) = 0;
50 virtual ScRange GetRange() = 0;
51 virtual void WriteToDocument(
52 bool bSizeColsRows = false, double nOutputFactor = 1.0,
53 SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true,
54 bool bConvertScientific = true ) = 0;
55};
56
57class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
58 public:
59 // various import filters
60 virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument&, rtl_TextEncoding eSrc ) = 0;
61 virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument& rDoc) = 0;
63 // eFormat == EIF_AUTO -> matching filter is used automatically
64 // eFormat == EIF_BIFF5 -> only Biff5 stream is read successfully (in an Excel97 doc, too)
65 // eFormat == EIF_BIFF8 -> only Biff8 stream is read successfully (only in Excel97 docs)
66 // eFormat == EIF_BIFF_LE4 -> only non storage files _might_ be read successfully
67 virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
68 const rtl_TextEncoding eSrc ) = 0;
69 virtual ErrCode ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
70 virtual ErrCode ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor,
71 bool bCalcWidthHeight, SvNumberFormatter* pFormatter, bool bConvertDate,
72 bool bConvertScientific ) = 0;
73
74 // various import helpers
75 virtual std::unique_ptr<ScEEAbsImport> CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0;
76 virtual std::unique_ptr<ScEEAbsImport> CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange ) = 0;
77 virtual OUString GetHTMLRangeNameList( ScDocument& rDoc, const OUString& rOrigName ) = 0;
78
79 // various export filters
80 virtual ErrCode ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) = 0;
81 virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest ) = 0;
82 virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
83 virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
84 const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions ) = 0;
85 virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
86
88
89protected:
91};
92
93// scfilt plugin symbol
94extern "C" {
95 SAL_DLLPUBLIC_EXPORT ScFormatFilterPlugin * ScFilterCreate();
96}
97
99 public:
101};
102
103struct LotusContext;
104
105ErrCode ScImportLotus123old(LotusContext& rContext, SvStream&, rtl_TextEncoding eSrc);
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ErrCode Read(SvStream &rStream, const OUString &rBaseURL)=0
virtual ~ScEEAbsImport()
Definition: filter.hxx:48
virtual ScRange GetRange()=0
virtual void WriteToDocument(bool bSizeColsRows=false, double nOutputFactor=1.0, SvNumberFormatter *pFormatter=nullptr, bool bConvertDate=true, bool bConvertScientific=true)=0
virtual ErrCode ScExportExcel5(SfxMedium &, ScDocument *, ExportFormatExcel eFormat, rtl_TextEncoding eDest)=0
virtual OUString GetHTMLRangeNameList(ScDocument &rDoc, const OUString &rOrigName)=0
virtual ErrCode ScImportQuattroPro(SvStream *pStream, ScDocument &rDoc)=0
virtual std::unique_ptr< ScEEAbsImport > CreateHTMLImport(ScDocument *pDocP, const OUString &rBaseURL, const ScRange &rRange)=0
virtual ErrCode ScImportLotus123(SfxMedium &, ScDocument &, rtl_TextEncoding eSrc)=0
virtual void ScExportDif(SvStream &, ScDocument *, const ScAddress &rOutPos, const rtl_TextEncoding eDest)=0
virtual ErrCode ScImportRTF(SvStream &, const OUString &rBaseURL, ScDocument *, ScRange &rRange)=0
virtual void ScExportHTML(SvStream &, const OUString &rBaseURL, ScDocument *, const ScRange &rRange, const rtl_TextEncoding eDest, bool bAll, const OUString &rStreamPath, OUString &rNonConvertibleChars, const OUString &rFilterOptions)=0
virtual ScOrcusFilters * GetOrcusFilters()=0
virtual ErrCode ScImportHTML(SvStream &, const OUString &rBaseURL, ScDocument *, ScRange &rRange, double nOutputFactor, bool bCalcWidthHeight, SvNumberFormatter *pFormatter, bool bConvertDate, bool bConvertScientific)=0
virtual ErrCode ScImportDif(SvStream &, ScDocument *, const ScAddress &rInsPos, const rtl_TextEncoding eSrc)=0
virtual ErrCode ScImportExcel(SfxMedium &, ScDocument *, const EXCIMPFORMAT)=0
virtual void ScExportRTF(SvStream &, ScDocument *, const ScRange &rRange, const rtl_TextEncoding eDest)=0
virtual std::unique_ptr< ScEEAbsImport > CreateRTFImport(ScDocument *pDoc, const ScRange &rRange)=0
virtual void ScExportDif(SvStream &, ScDocument *, const ScRange &rRange, const rtl_TextEncoding eDest)=0
static SC_DLLPUBLIC ScFormatFilterPlugin & Get()
Definition: impex.cxx:2684
Collection of orcus filter wrappers.
ExportFormatExcel
Definition: filter.hxx:42
@ ExpBiff8
Definition: filter.hxx:42
@ ExpBiff5
Definition: filter.hxx:42
EXCIMPFORMAT
Definition: filter.hxx:39
@ EIF_BIFF8
Definition: filter.hxx:39
@ EIF_BIFF_LE4
Definition: filter.hxx:39
@ EIF_AUTO
Definition: filter.hxx:39
@ EIF_BIFF5
Definition: filter.hxx:39
SAL_DLLPUBLIC_EXPORT ScFormatFilterPlugin * ScFilterCreate()
Definition: ftools.cxx:358
ErrCode ScImportLotus123old(LotusContext &rContext, SvStream &, rtl_TextEncoding eSrc)
Definition: filter.cxx:185
#define SC_DLLPUBLIC
Definition: scdllapi.h:27