update ooo310-m15
[ooovba.git] / sc / source / filter / xml / XMLTextPContext.hxx
blob32351592a278dd228ff4483794873f76798fc6dd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLTextPContext.hxx,v $
10 * $Revision: 1.12 $
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_XMLTEXTPCONTEXT_HXX
32 #define SC_XMLTEXTPCONTEXT_HXX
34 #include <xmloff/xmlictxt.hxx>
35 #include <rtl/ustrbuf.hxx>
37 #include "phonetic.hxx"
39 class ScXMLImport;
40 class ScXMLTableRowCellContext;
42 class ScXMLTextPContext : public SvXMLImportContext
44 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList> xAttrList;
45 SvXMLImportContext* pTextPContext;
46 ScXMLTableRowCellContext* pCellContext;
47 rtl::OUString sLName;
48 rtl::OUString sSimpleContent; // copy of the first Character call's argument
49 rtl::OUStringBuffer* pContentBuffer; // used if there's more than one string
50 USHORT nPrefix;
51 sal_Bool bIsOwn;
52 rtl::OUStringBuffer sOURubyText;
53 PhoneticPortionVec aPhoneticPortions;
55 const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
56 ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
57 void GetContent( rtl::OUString& rContent );
59 public:
60 ScXMLTextPContext( ScXMLImport& rImport, USHORT nPrfx,
61 const ::rtl::OUString& rLName,
62 const ::com::sun::star::uno::Reference<
63 ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
64 ScXMLTableRowCellContext* pCellContext);
66 virtual ~ScXMLTextPContext();
68 virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
69 const ::rtl::OUString& rLocalName,
70 const ::com::sun::star::uno::Reference<
71 ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
73 virtual void Characters( const ::rtl::OUString& rChars );
75 virtual void EndElement();
77 void AddSpaces(sal_Int32 nSpaceCount);
79 /**
80 * Add phonetic and base text into cell.
82 * @param rBaseText the base string.
83 * @param rRubyText the phonetic text.
85 void AddRubyText( const ::rtl::OUString& rBaseText, const ::rtl::OUString& rRubyText );
88 #endif