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 #ifndef _XMLOFF_TEXTPARAI_HXX_ 28 #define _XMLOFF_TEXTPARAI_HXX_ 29 30 31 #include <com/sun/star/uno/Reference.h> 32 #include <xmloff/xmlictxt.hxx> 33 34 class XMLHints_Impl; 35 namespace com { namespace sun { namespace star { 36 namespace text { class XTextRange; } 37 namespace xml { namespace sax { class XAttributeList; } } 38 } } } 39 40 #define CONV_FROM_STAR_BATS 1 41 #define CONV_FROM_STAR_MATH 2 42 #define CONV_STAR_FONT_FLAGS_VALID 4 43 44 class XMLParaContext : public SvXMLImportContext 45 { 46 ::com::sun::star::uno::Reference < 47 ::com::sun::star::text::XTextRange > xStart; // xub_StrLen nStart; 48 ::rtl::OUString sStyleName; 49 ::rtl::OUString m_sXmlId; 50 ::rtl::OUString m_sAbout; 51 ::rtl::OUString m_sProperty; 52 ::rtl::OUString m_sContent; 53 ::rtl::OUString m_sDatatype; 54 bool m_bHaveAbout; 55 sal_Int8 nOutlineLevel; 56 XMLHints_Impl *pHints; 57 // --> OD 2007-07-25 #i73509# 58 sal_Bool mbOutlineLevelAttrFound; 59 // <-- 60 sal_Bool bIgnoreLeadingSpace; 61 sal_Bool bHeading; 62 sal_Bool bIsListHeader; 63 sal_Bool bIsRestart; 64 sal_Int16 nStartValue; 65 sal_uInt8 nStarFontsConvFlags; 66 67 public: 68 69 TYPEINFO(); 70 71 XMLParaContext( SvXMLImport& rImport, 72 sal_uInt16 nPrfx, 73 const ::rtl::OUString& rLName, 74 const ::com::sun::star::uno::Reference< 75 ::com::sun::star::xml::sax::XAttributeList > & xAttrList, 76 sal_Bool bHeading ); 77 78 virtual ~XMLParaContext(); 79 80 virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, 81 const ::rtl::OUString& rLocalName, 82 const ::com::sun::star::uno::Reference< 83 ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 84 85 virtual void Characters( const ::rtl::OUString& rChars ); 86 87 }; 88 89 class XMLNumberedParaContext : public SvXMLImportContext 90 { 91 /// text:list-level MINUS 1 92 sal_Int16 m_Level; 93 /// text:start-value 94 sal_Int16 m_StartValue; 95 /// xml:id 96 ::rtl::OUString m_XmlId; 97 /// text:list-id 98 ::rtl::OUString m_ListId; 99 /// text:style-name 100 ::com::sun::star::uno::Reference < 101 ::com::sun::star::container::XIndexReplace > m_xNumRules; 102 103 public: 104 105 TYPEINFO(); 106 107 XMLNumberedParaContext( SvXMLImport& i_rImport, 108 sal_uInt16 i_nPrefix, 109 const ::rtl::OUString& i_rLocalName, 110 const ::com::sun::star::uno::Reference< 111 ::com::sun::star::xml::sax::XAttributeList > & i_xAttrList ); 112 113 virtual ~XMLNumberedParaContext(); 114 115 virtual void EndElement(); 116 117 virtual SvXMLImportContext *CreateChildContext( sal_uInt16 i_nPrefix, 118 const ::rtl::OUString& i_rLocalName, 119 const ::com::sun::star::uno::Reference< 120 ::com::sun::star::xml::sax::XAttributeList > & i_xAttrList ); 121 122 sal_Int16 GetLevel() const { return m_Level; } 123 const ::com::sun::star::uno::Reference < 124 ::com::sun::star::container::XIndexReplace >& GetNumRules() const 125 { return m_xNumRules; } 126 const ::rtl::OUString& GetListId() const { return m_ListId; } 127 sal_Int16 GetStartValue() const { return m_StartValue; } 128 129 }; 130 131 #endif 132