merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_sc / filter.hxx
blob26ef8e363887e724d3fee3ecd42ff917f4d06599
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filter.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_FILTER_HXX
32 #define SC_FILTER_HXX
34 #ifndef _STRING_HXX //autogen
35 #include <tools/string.hxx>
36 #endif
37 #ifndef _RTL_TEXTENC_H
38 #include <rtl/textenc.h>
39 #endif
40 class SvStream;
41 namespace binfilter {
43 class SfxMedium;
45 class ScAddress;
46 class ScDocument;
47 class ScRange;
49 // Return-Werte Im-/Exportfilter (ULONG)
51 typedef ULONG FltError;
52 //enum FltError {
54 #define eERR_OK ERRCODE_NONE // kein Fehler, alles OK
55 #define eERR_OPEN SCERR_IMPORT_OPEN // ...
56 #define eERR_UNBEK SCERR_IMPORT_UNKNOWN // unbekannter Fehler, auch historische Bedeutung
57 #define eERR_FORMAT SCERR_IMPORT_FORMAT // Formatfehler beim Lesen (kein Formel-Fehler!)
58 #define eERR_NI SCERR_IMPORT_NI // Nicht implementierter Filter
59 #define eERR_RNGOVRFLW SCWARN_IMPORT_RANGE_OVERFLOW// ueberlauf der Zellkoordinaten:
60 // Tabelle abgschnitten auf erlaubtem Bereich
61 // mehr Fehlercodes siehe scerrors.hxx
63 // };
66 // fuer Import
67 enum EXCIMPFORMAT { EIF_AUTO, EIF_BIFF5, EIF_BIFF8, EIF_BIFF_LE4 };
69 // fuer Export
70 enum ExportFormatLotus { ExpWK1, ExpWK3, ExpWK4 };
71 enum ExportFormatExcel { ExpBiff2, ExpBiff3, ExpBiff4, ExpBiff4W, ExpBiff5 };
74 // Optionen fuer DIF-Im-/Export (Kombination ueber '|')
75 #define SC_DIFOPT_PLAIN 0x00000000
76 #define SC_DIFOPT_DATE 0x00000001
77 #define SC_DIFOPT_TIME 0x00000002
78 #define SC_DIFOPT_CURRENCY 0x00000004
80 #define SC_DIFOPT_EXCEL (SC_DIFOPT_DATE|SC_DIFOPT_TIME|SC_DIFOPT_CURRENCY)
83 // ***********************************************************************
84 // Diverse Importfilter
85 // ***********************************************************************
87 FltError ScImportLotus123( SfxMedium&, ScDocument*, CharSet eSrc = RTL_TEXTENCODING_DONTKNOW );
89 FltError ScImportExcel( SvStream&, ScDocument* );
91 FltError ScImportExcel( SfxMedium&, ScDocument* );
93 FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT );
94 // eFormat == EIF_AUTO -> passender Filter wird automatisch verwendet
95 // eFormat == EIF_BIFF5 -> nur Biff5-Stream fuehrt zum Erfolg (auch wenn in einem Excel97-Doc)
96 // eFormat == EIF_BIFF8 -> nur Biff8-Stream fuehrt zum Erfolg (nur in Excel97-Docs)
97 // eFormat == EIF_BIFF_LE4 -> nur Nicht-Storage-Dateien _koennen_ zum Erfolg fuehren
99 FltError ScImportStarCalc10( SvStream&, ScDocument* );
101 FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
102 const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL );
104 FltError ScImportRTF( SvStream&, ScDocument*, ScRange& rRange );
106 FltError ScImportHTML( SvStream&, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE );
108 // ***********************************************************************
109 // Diverse Exportfilter
110 // ***********************************************************************
112 FltError ScExportLotus123( SvStream&, ScDocument*, ExportFormatLotus, CharSet eDest );
114 FltError ScExportExcel234( SvStream&, ScDocument*, ExportFormatExcel, CharSet eDest );
116 FltError ScExportExcel5( SfxMedium&, ScDocument*, const BOOL bTuerk, CharSet eDest );
118 FltError ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const CharSet eDest,
119 UINT32 nDifOption = SC_DIFOPT_EXCEL );
121 FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest,
122 UINT32 nDifOption = SC_DIFOPT_EXCEL );
124 FltError ScExportHTML( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest, BOOL bAll,
125 const String& rStreamPath, String& rNonConvertibleChars );
127 FltError ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest );
129 } //namespace binfilter
130 #endif