Commits

Anonymous committed 9df4db4

Added new files, modified files in formula module. Built to verify.

Comments (0)

Files changed (8)

formula/inc/formula/compiler.hrc

 #define SC_OPCODE_UNICODE           155
 #define SC_OPCODE_UNICHAR           156
 #define SC_OPCODE_GAMMA             157
-#define SC_OPCODE_STOP_1_PAR        158
+#define SC_OPCODE_PHONETIC          158
+#define SC_OPCODE_STOP_1_PAR        159
 
 /*** Functions with more than one parameters ***/
 #define SC_OPCODE_START_2_PAR       201

formula/inc/formula/opcode.hxx

         ocAsc               = SC_OPCODE_ASC,
         ocUnicode           = SC_OPCODE_UNICODE,
         ocUnichar           = SC_OPCODE_UNICHAR,
+        ocPhonetic          = SC_OPCODE_PHONETIC,
 	// Functions with more than one parameters
 		ocArcTan2			= SC_OPCODE_ARC_TAN_2,
 		ocCeil				= SC_OPCODE_CEIL,

formula/source/core/resource/core_resource.src

 	String SC_OPCODE_HYPERLINK { Text = "HYPERLINK" ; };
     String SC_OPCODE_INFO { Text = "INFO" ; };
     String SC_OPCODE_BAHTTEXT { Text = "COM.MICROSOFT.BAHTTEXT" ; };
+    String SC_OPCODE_PHONETIC { Text = "PHONETIC" ; };
     String SC_OPCODE_GET_PIVOT_DATA { Text = "GETPIVOTDATA" ; };
 	String SC_OPCODE_EUROCONVERT { Text = "EUROCONVERT" ; };
 	String SC_OPCODE_NUMBERVALUE { Text = "NUMBERVALUE" ; };
 	String SC_OPCODE_HYPERLINK { Text = "HYPERLINK" ; };
     String SC_OPCODE_INFO { Text = "INFO" ; };
     String SC_OPCODE_BAHTTEXT { Text = "BAHTTEXT" ; };
+    String SC_OPCODE_PHONETIC { Text = "PHONETIC" ; };
     String SC_OPCODE_GET_PIVOT_DATA { Text = "GETPIVOTDATA" ; };
 	String SC_OPCODE_EUROCONVERT { Text = "EUROCONVERT" ; };
 	String SC_OPCODE_NUMBERVALUE { Text = "NUMBERVALUE" ; };
     {
         Text [ en-US ] = "BAHTTEXT";
     };
+    String SC_OPCODE_PHONETIC
+    {
+        Text [ en-US ] = "PHONETIC";
+    };
     String SC_OPCODE_GET_PIVOT_DATA
     {
         Text [ en-US ] = "GETPIVOTDATA";

sc/inc/phonetic.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: global.hxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SC_PHONETIC_HXX
+#define SC_PHONETIC_HXX
+
+
+#include "tools/string.hxx"
+#include "scdllapi.h"
+
+#include <vector>
+
+struct PhoneticPortion
+{
+    sal_uInt16          mncpa;  /// position of the first character in the phonetic text
+    sal_uInt16          mncpm;  /// position of the first character in the base text
+    sal_uInt16          mnccm;  /// length of the characters in the base text
+    explicit inline     PhoneticPortion() : mncpa( 0 ), mncpm( 0 ), mnccm( 0 ) {}
+    explicit inline     PhoneticPortion( sal_uInt16 ncpa, sal_uInt16 ncpm, sal_uInt16 nccm ) :
+                            mncpa( ncpa ), mncpm( ncpm ), mnccm ( nccm ) {}
+};
+
+inline bool operator==( const PhoneticPortion& rLeft, const PhoneticPortion& rRight )
+{
+    return
+        ( rLeft.mncpa == rRight.mncpa ) &&
+        ( rLeft.mncpm == rRight.mncpm ) &&
+        ( rLeft.mnccm == rRight.mnccm );
+}
+
+typedef ::std::vector< PhoneticPortion > PhoneticPortionVec;
+
+/*
+ * A class for store Asian phonetic guide information.
+ */
+class SC_DLLPUBLIC ScPhonetic
+{
+public:
+	ScPhonetic() : mnFontIdx( 0 ), mnAdditionalSettings( 0 ), mnRepeatedTotalLength ( 0 ) {}
+	/** A constructor of ScPhonetic.
+	 * @param nFontIdx font index.
+	 * @param nAdditionalSettings an additional settings.
+	 * @param nRepeatedTotalLength the number of repeated total length.
+	 * @param rPhoneticString phonetic text.
+	 * @param rPhoneticPortions the portion of phonetic text.
+	 */
+	ScPhonetic( sal_uInt16 nFontIdx, sal_uInt16 nAdditionalSettings,
+					sal_uInt16 nRepeatedTotalLength, const String& rPhoneticString,
+					const PhoneticPortionVec& rPhoneticPortions) :
+		mnFontIdx( nFontIdx ), mnAdditionalSettings( nAdditionalSettings ),
+		mnRepeatedTotalLength ( nRepeatedTotalLength ),
+		maPhoneticString ( rPhoneticString ), maPhoneticPortions ( rPhoneticPortions ) {}
+	virtual ~ScPhonetic();
+
+	virtual int             operator==( const ScPhonetic& ) const;
+
+	/** Returns True if no phonetic information. */
+	inline BOOL IsEmpty() const { return maPhoneticString.Len() == 0; }
+	/** Returns the text for phonetic information. */
+	inline const String& GetString() const { return maPhoneticString; }
+    /** Returns the portion for phonetic information. */
+	inline const PhoneticPortionVec& GetPortions() const { return maPhoneticPortions; }
+    /** Returns font index of phonetic information. */
+	inline sal_uInt16 GetFontIndex() const { return mnFontIdx; }
+    /** Returns additional settings of phonetic information. */
+	inline sal_uInt16 GetAdditionalSettings() const { return mnAdditionalSettings; }
+    /** Returns repeated length of phonetic information. */
+	inline sal_uInt16 GetRepeatedTotalLength() const { return mnRepeatedTotalLength; }
+    /** Returns the size of phonetic information. */
+	inline sal_uInt32 GetSize() const { return 14 + ( maPhoneticString.Len() ? maPhoneticString.Len() * 2 : 2 ) + maPhoneticPortions.size() * 6; }
+
+private:
+	sal_uInt16         mnFontIdx;            /// Index to FONT record
+	sal_uInt16         mnAdditionalSettings; /// Additional settings for the Asian phonetic text
+	sal_uInt16         mnRepeatedTotalLength;
+	String             maPhoneticString;
+	PhoneticPortionVec maPhoneticPortions;
+};
+
+#endif

sc/source/core/data/phonetic.cxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: global.hxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#if 1
+#ifndef _COM_SUN_STAR_UTIL_CELLPROTECTION_HPP_
+#include <com/sun/star/util/CellProtection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XPROTECTABLE_HPP_
+#include <com/sun/star/util/XProtectable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_
+#include <com/sun/star/text/XText.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#endif
+
+#include "phonetic.hxx"
+
+using namespace com::sun::star;
+
+
+//------------------------------------------------------------------------
+
+ScPhonetic::~ScPhonetic()
+{
+}
+
+//------------------------------------------------------------------------
+
+int ScPhonetic::operator==( const ScPhonetic& rItem ) const
+{
+	return ((mnFontIdx == rItem.mnFontIdx)
+			 && (mnAdditionalSettings == rItem.mnAdditionalSettings)
+			 && (mnRepeatedTotalLength == rItem.mnRepeatedTotalLength)
+			 && (maPhoneticString == rItem.maPhoneticString)
+			 && (maPhoneticPortions == rItem.maPhoneticPortions));
+}
+

sc/source/filter/excel/xlformula.cxx

 {
     { ocGetPivotData,       358,    2,  30, V, { RR, RR, VR }, 0, 0 },
     { ocHyperLink,          359,    1,  2,  V, { VV, VO }, 0, 0 },
-    { ocPhonetic,           360,    1,  1,  V, { R }, 0, 0 },
+    { ocPhonetic,           360,    1,  1,  V, { RX }, 0, 0 },
     { ocAverageA,           361,    1,  30, V, { RX }, 0, 0 },
     { ocMaxA,               362,    1,  30, V, { RX }, 0, 0 },
     { ocMinA,               363,    1,  30, V, { RX }, 0, 0 },

sc/source/filter/xml/xmlrubyi.cxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: global.hxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+
+
+// INCLUDE ---------------------------------------------------------------
+
+#ifndef _SC_XMLRUBYI_HXX
+#include "xmlrubyi.hxx"
+#endif
+#ifndef SC_XMLIMPRT_HXX
+#include "xmlimprt.hxx"
+#endif
+#ifndef SC_XMLCELLI_HXX
+#include "xmlcelli.hxx"
+#endif
+#ifndef _SC_XMLTEXTPCONTEXT_HXX
+#include "XMLTextPContext.hxx"
+#endif
+#ifndef _XMLSTYLI_HXX
+#include "xmlstyli.hxx"
+#endif
+
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_
+#include <com/sun/star/text/XText.hpp>
+#endif
+
+using namespace com::sun::star;
+using namespace xmloff::token;
+
+ScXMLRubyContext::ScXMLRubyContext( ScXMLImport& rImport,
+                                      USHORT nPrfx,
+                                      const ::rtl::OUString& rLName,
+                                      const ::com::sun::star::uno::Reference<
+                                      ::com::sun::star::xml::sax::XAttributeList>& xTempAttrList,
+                                      ScXMLTextPContext* pTempTextContext) :
+    SvXMLImportContext( rImport, nPrfx, rLName ),
+    pCellContext( NULL ),
+    pTextContext( pTempTextContext )
+{
+    sal_Int16 nAttrCount(xTempAttrList.is() ? xTempAttrList->getLength() : 0);
+    const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableRowCellElemTextRubyAttrTokenMap();
+    for( sal_Int16 i=0; i < nAttrCount; ++i )
+    {
+        const rtl::OUString& sAttrName(xTempAttrList->getNameByIndex( i ));
+        rtl::OUString aLocalName;
+        USHORT nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
+                       sAttrName, &aLocalName ));
+        const rtl::OUString& sValue(xTempAttrList->getValueByIndex( i ));
+
+        switch( rAttrTokenMap.Get( nPrefix, aLocalName ) )
+        {
+        case XML_TOK_TABLE_ROW_CELL_TEXT_RUBY_ATTR_STYLE_NAME:
+            sStyleName = sValue;
+            break;
+        }
+    }
+}
+
+ScXMLRubyContext::ScXMLRubyContext( ScXMLImport& rImport,
+                                      USHORT nPrfx,
+                                      const ::rtl::OUString& rLName,
+                                      const ::com::sun::star::uno::Reference<
+                                      ::com::sun::star::xml::sax::XAttributeList>& xTempAttrList,
+                                      ScXMLTableRowCellContext* pTempContext) :
+    SvXMLImportContext( rImport, nPrfx, rLName ),
+    pCellContext( pTempContext ),
+    pTextContext( NULL )
+{
+    sal_Int16 nAttrCount(xTempAttrList.is() ? xTempAttrList->getLength() : 0);
+    const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableRowCellElemTextRubyAttrTokenMap();
+    for( sal_Int16 i=0; i < nAttrCount; ++i )
+    {
+        const rtl::OUString& sAttrName(xTempAttrList->getNameByIndex( i ));
+        rtl::OUString aLocalName;
+        USHORT nPrefix(GetScImport().GetNamespaceMap().GetKeyByAttrName(
+                       sAttrName, &aLocalName ));
+        const rtl::OUString& sValue(xTempAttrList->getValueByIndex( i ));
+
+        switch( rAttrTokenMap.Get( nPrefix, aLocalName ) )
+        {
+        case XML_TOK_TABLE_ROW_CELL_TEXT_RUBY_ATTR_STYLE_NAME:
+            sStyleName = sValue;
+            break;
+        }
+    }
+}
+
+SvXMLImportContext *ScXMLRubyContext::CreateChildContext( USHORT nPrefix,
+                                            const ::rtl::OUString& rLName,
+                                            const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+{
+    SvXMLImportContext *pContext(NULL);
+
+    const SvXMLTokenMap& rTokenMap = GetScImport().GetTableRowCellElemTextRubyTokenMap();
+    switch( rTokenMap.Get( nPrefix, rLName ) )
+    {
+    case XML_TOK_TABLE_ROW_CELL_TEXT_RUBY_BASE:
+        pContext = new ScXMLRubyBaseContext( GetScImport(), nPrefix, rLName, xAttrList, this);
+        break;
+    case XML_TOK_TABLE_ROW_CELL_TEXT_RUBY_TEXT:
+        pContext = new ScXMLRubyTextContext( GetScImport(), nPrefix, rLName, xAttrList, this);
+        break;
+    }
+
+    if( !pContext )
+        pContext = new SvXMLImportContext( GetScImport(), nPrefix, rLName );
+
+    return pContext;
+}
+
+void ScXMLRubyContext::EndElement()
+{
+    if ( pTextContext )
+        pTextContext->AddRubyText( sBaseText.makeStringAndClear(), sRubyText.makeStringAndClear() );
+    else if ( pCellContext )
+        pCellContext->SetPhoneticText( sRubyText.makeStringAndClear() );
+}
+
+void ScXMLRubyContext::AddBaseText( const ::rtl::OUString& rText )
+{
+    sBaseText.append( rText );
+}
+
+void ScXMLRubyContext::AddRubyText( const ::rtl::OUString& rText )
+{
+    sRubyText.append( rText );
+}
+
+ScXMLRubyBaseContext::ScXMLRubyBaseContext( ScXMLImport& rImport,
+                                      USHORT nPrfx,
+                                      const ::rtl::OUString& rLName,
+                                      const ::com::sun::star::uno::Reference<
+                                      ::com::sun::star::xml::sax::XAttributeList>& /*xTempAttrList*/,
+                                      ScXMLRubyContext* pTempRubyContext) :
+    SvXMLImportContext( rImport, nPrfx, rLName ),
+    pRubyContext( pTempRubyContext )
+{
+    // here are no attributes
+}
+
+void ScXMLRubyBaseContext::Characters( const ::rtl::OUString& rChars )
+{
+    pRubyContext->AddBaseText( rChars );
+}
+
+ScXMLRubyTextContext::ScXMLRubyTextContext( ScXMLImport& rImport,
+                                      USHORT nPrfx,
+                                      const ::rtl::OUString& rLName,
+                                      const ::com::sun::star::uno::Reference<
+                                      ::com::sun::star::xml::sax::XAttributeList>& /*xTempAttrList*/,
+                                      ScXMLRubyContext* pTempRubyContext) :
+    SvXMLImportContext( rImport, nPrfx, rLName ),
+    pRubyContext( pTempRubyContext )
+{
+    // here are no attributes
+}
+
+void ScXMLRubyTextContext::Characters( const ::rtl::OUString& rChars )
+{
+    pRubyContext->AddRubyText( rChars );
+}
+
+

sc/source/filter/xml/xmlrubyi.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: global.hxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SC_XMLRUBYI_HXX
+#define _SC_XMLRUBYI_HXX
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
+class ScXMLImport;
+class ScXMLTextPContext;
+class ScXMLTableRowCellContext;
+
+/**
+ * A class for representing Asian phonetic guide information while loading ODF file.
+ */
+class ScXMLRubyContext : public SvXMLImportContext
+{
+    rtl::OUString       sStyleName;
+    rtl::OUStringBuffer sBaseText;
+    rtl::OUStringBuffer sRubyText;
+    ScXMLTableRowCellContext*   pCellContext;
+    ScXMLTextPContext*  pTextContext;
+
+    const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
+    ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
+
+public:
+
+    /**
+     * A constructor of ScXMLRubyContext.
+     * @param rImport a reference of ScXMLImport.
+     * @param nPrfx the number of the element prefix.
+     * @param rLName the string of the element.
+     * @param xAttrList attribute list of the element.
+     * @param pContext a pointer of ScXMLTextPContext.
+     */
+    ScXMLRubyContext( ScXMLImport& rImport, USHORT nPrfx,
+                        const ::rtl::OUString& rLName,
+                        const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+                        ScXMLTextPContext* pContext);
+    /**
+     * A constructor of ScXMLRubyContext.
+     * @param rImport a reference of ScXMLImport.
+     * @param nPrfx the number of the element prefix.
+     * @param rLName the string of the element.
+     * @param xAttrList attribute list of the element.
+     * @param pContext a pointer of ScXMLTableRowCellContext.
+     */
+    ScXMLRubyContext( ScXMLImport& rImport, USHORT nPrfx,
+                        const ::rtl::OUString& rLName,
+                        const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+                        ScXMLTableRowCellContext* pContext);
+
+    virtual ~ScXMLRubyContext() {};
+
+    /**
+     * Create a childs element context. By default, the import's
+     * CreateContext method is called to create a new default context.
+     * @return a new default context.
+     */
+    virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
+                                     const ::rtl::OUString& rLocalName,
+                                     const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
+    /**
+     * EndElement is called before a context will be destructed, but
+     * after a elements context has been parsed. It may be used for actions
+     * that require virtual methods. The default is to do nothing.
+     */
+    virtual void EndElement();
+
+    /**
+     * Adds string into cell string as base string of phonetic infrmation
+     * @param rText the base string.
+     */
+    void AddBaseText(const ::rtl::OUString& rText);
+    /**
+     * Adds string into cell string as phonetic text
+     * @param rText the phonetic text.
+     */
+    void AddRubyText(const ::rtl::OUString& rText);
+};
+
+/**
+ * A class for representing base text of phonetic guide information while loading ODF file.
+ */
+class ScXMLRubyBaseContext : public SvXMLImportContext
+{
+    ScXMLRubyContext*   pRubyContext;
+
+    const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
+    ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
+
+public:
+
+    /**
+     * A constructor of ScXMLRubyBaseContext.
+     * @param rImport a reference of ScXMLImport.
+     * @param nPrfx the number of the element prefix.
+     * @param rLName the string of the element.
+     * @param xAttrList attribute list of the element.
+     * @param pContext a pointer of ScXMLRubyContext.
+     */
+    ScXMLRubyBaseContext( ScXMLImport& rImport, USHORT nPrfx,
+                        const ::rtl::OUString& rLName,
+                        const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+                        ScXMLRubyContext* pContext);
+
+    virtual ~ScXMLRubyBaseContext() {};
+
+    /**
+     * This method is called for all characters that are contained in the
+     * current element. The default is to ignore them.
+     * @param rChars the character reference
+     */ 
+    virtual void Characters( const ::rtl::OUString& rChars );
+};
+
+
+/**
+ * A class for representing phonetic text of phonetic guide information while loading ODF file.
+ */
+class ScXMLRubyTextContext : public SvXMLImportContext
+{
+    ScXMLRubyContext*   pRubyContext;
+
+    const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
+    ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
+
+public:
+
+    /**
+     * A constructor of ScXMLRubyTextContext.
+     * @param rImport a reference of ScXMLImport.
+     * @param nPrfx the number of the element prefix.
+     * @param rLName the string of the element.
+     * @param xAttrList attribute list of the element.
+     * @param pContext a pointer of ScXMLRubyContext.
+     */
+    ScXMLRubyTextContext( ScXMLImport& rImport, USHORT nPrfx,
+                        const ::rtl::OUString& rLName,
+                        const ::com::sun::star::uno::Reference<
+                                        ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
+                        ScXMLRubyContext* pContext);
+
+    virtual ~ScXMLRubyTextContext() {};
+
+    /**
+     * This method is called for all characters that are contained in the
+     * current element. The default is to ignore them.
+     * @param rChars the character reference
+     */ 
+    virtual void Characters( const ::rtl::OUString& rChars );
+};
+
+#endif