1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _HTMLOUT_HXX 29 #define _HTMLOUT_HXX 30 31 #include "svtools/svtdllapi.h" 32 #include <tools/solar.h> 33 #include <rtl/textenc.h> 34 #include <svl/macitem.hxx> 35 36 class Color; 37 class ImageMap; 38 class String; 39 class SvStream; 40 class SvxMacroTableDtor; 41 class SvNumberFormatter; 42 class SvDataObject; 43 44 struct HTMLOutEvent 45 { 46 const sal_Char *pBasicName; 47 const sal_Char *pJavaName; 48 sal_uInt16 nEvent; 49 }; 50 51 struct SVT_DLLPUBLIC HTMLOutContext 52 { 53 rtl_TextEncoding m_eDestEnc; 54 rtl_TextToUnicodeConverter m_hConv; 55 rtl_TextToUnicodeContext m_hContext; 56 57 HTMLOutContext( rtl_TextEncoding eDestEnc ); 58 ~HTMLOutContext(); 59 }; 60 61 struct HTMLOutFuncs 62 { 63 #if defined(UNX) 64 static const sal_Char sNewLine; // nur \012 oder \015 65 #else 66 static const sal_Char __FAR_DATA sNewLine[]; // \015\012 67 #endif 68 69 SVT_DLLPUBLIC static void ConvertStringToHTML( const String& sSrc, ByteString& rDest, 70 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 71 String *pNonConvertableChars = 0); 72 73 SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr, 74 sal_Bool bOn = sal_True, 75 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252); 76 SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar, 77 HTMLOutContext& rContext, 78 String *pNonConvertableChars = 0 ); 79 SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&, 80 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 81 String *pNonConvertableChars = 0 ); 82 SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen, 83 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 ); 84 SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&, 85 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 ); 86 SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const String&, 87 const HTMLOutEvent *pEventTable, 88 sal_Bool bOutStarBasic, 89 const sal_Char *pDelim = 0, 90 const sal_Char *pIndentArea = 0, 91 const sal_Char *pIndentMap = 0, 92 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 93 String *pNonConvertableChars = 0 ); 94 SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext ); 95 96 SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm, 97 const String& rBaseURL, 98 const String& rSource, 99 const String& rLanguage, 100 ScriptType eScriptType, 101 const String& rSrc, 102 const String *pSBLibrary = 0, 103 const String *pSBModule = 0, 104 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 105 String *pNonConvertableChars = 0 ); 106 107 // der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem 108 // nur aus 0 bestehen Eintrag terminiert ist. 109 SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&, 110 const HTMLOutEvent*, sal_Bool bOutStarBasic, 111 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 112 String *pNonConvertableChars = 0 ); 113 114 // <TD SDVAL="..." SDNUM="..."> 115 SVT_DLLPUBLIC static ByteString& CreateTableDataOptionsValNum( ByteString& aStrTD, 116 sal_Bool bValue, double fVal, sal_uLong nFormat, 117 SvNumberFormatter& rFormatter, 118 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252, 119 String *pNonConvertableChars = 0 ); 120 121 SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL ); 122 }; 123 124 #endif 125 126