2010-10-27 07:11:31 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2004-04-27 10:06:48 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* 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.
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* 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).
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
2008-04-10 06:19:42 -05:00
|
|
|
* 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.
|
2004-04-27 10:06:48 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _LINGUISTIC_CONVDICXML_HXX_
|
|
|
|
#define _LINGUISTIC_CONVDICXML_HXX_
|
|
|
|
|
|
|
|
#include <com/sun/star/linguistic2/XConversionDictionary.hpp>
|
|
|
|
#include <com/sun/star/util/XFlushable.hpp>
|
2011-10-11 07:19:09 -05:00
|
|
|
#include <com/sun/star/util/MeasureUnit.hpp>
|
2004-04-27 10:06:48 -05:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
2011-11-14 04:49:31 -06:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2004-04-27 10:06:48 -05:00
|
|
|
#include <xmloff/xmlexp.hxx>
|
|
|
|
#include <xmloff/xmlimp.hxx>
|
|
|
|
#include <cppuhelper/implbase3.hxx>
|
|
|
|
#include <cppuhelper/interfacecontainer.h>
|
|
|
|
#include <tools/string.hxx>
|
|
|
|
#include <rtl/ustring.hxx>
|
2010-04-20 01:28:42 -05:00
|
|
|
#include "linguistic/misc.hxx"
|
2004-04-27 10:06:48 -05:00
|
|
|
#include "defs.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
class ConvDic;
|
|
|
|
|
|
|
|
|
|
|
|
class ConvDicXMLExport : public SvXMLExport
|
|
|
|
{
|
|
|
|
ConvDic &rDic;
|
|
|
|
sal_Bool bSuccess;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ConvDicXMLExport( ConvDic &rConvDic,
|
|
|
|
const rtl::OUString &rFileName,
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler) :
|
2011-11-14 04:49:31 -06:00
|
|
|
SvXMLExport ( comphelper::getProcessServiceFactory(), rFileName,
|
2011-10-11 07:19:09 -05:00
|
|
|
::com::sun::star::util::MeasureUnit::CM, rHandler ),
|
2004-04-27 10:06:48 -05:00
|
|
|
rDic ( rConvDic ),
|
|
|
|
bSuccess ( sal_False )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
virtual ~ConvDicXMLExport()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// XServiceInfo (override parent method)
|
|
|
|
::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
// SvXMLExport
|
|
|
|
void _ExportAutoStyles() {}
|
|
|
|
void _ExportMasterStyles() {}
|
|
|
|
void _ExportContent();
|
2009-10-18 06:56:34 -05:00
|
|
|
sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass );
|
2004-04-27 10:06:48 -05:00
|
|
|
|
2009-10-06 05:34:07 -05:00
|
|
|
sal_Bool Export();
|
2004-04-27 10:06:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ConvDicXMLImport : public SvXMLImport
|
|
|
|
{
|
|
|
|
ConvDic *pDic; // conversion dictionary to be used
|
|
|
|
// if != NULL: whole file will be read and
|
|
|
|
// all entries will be added to the dictionary
|
|
|
|
// if == NULL: no entries will be added
|
|
|
|
// but the language and conversion type will
|
|
|
|
// still be determined!
|
|
|
|
|
2010-11-09 23:50:33 -06:00
|
|
|
sal_Int16 nLanguage; // language of the dictionary
|
2004-04-27 10:06:48 -05:00
|
|
|
sal_Int16 nConversionType; // conversion type the dictionary is used for
|
|
|
|
sal_Bool bSuccess;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
//!! see comment for pDic member
|
2007-05-25 06:21:35 -05:00
|
|
|
ConvDicXMLImport( ConvDic *pConvDic, const rtl::OUString /*&rFileName*/ ) :
|
2011-11-14 04:49:31 -06:00
|
|
|
SvXMLImport ( comphelper::getProcessServiceFactory(), IMPORT_ALL ),
|
2004-04-27 10:06:48 -05:00
|
|
|
pDic ( pConvDic )
|
|
|
|
{
|
|
|
|
nLanguage = LANGUAGE_NONE;
|
|
|
|
nConversionType = -1;
|
|
|
|
bSuccess = sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~ConvDicXMLImport() throw ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// XServiceInfo (override parent method)
|
|
|
|
::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual void SAL_CALL startDocument(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
virtual void SAL_CALL endDocument(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
virtual SvXMLImportContext * CreateContext(
|
|
|
|
sal_uInt16 nPrefix, const rtl::OUString &rLocalName,
|
|
|
|
const com::sun::star::uno::Reference < com::sun::star::xml::sax::XAttributeList > &rxAttrList );
|
|
|
|
|
|
|
|
ConvDic * GetDic() { return pDic; }
|
2010-11-09 23:50:33 -06:00
|
|
|
sal_Int16 GetLanguage() const { return nLanguage; }
|
2004-04-27 10:06:48 -05:00
|
|
|
sal_Int16 GetConversionType() const { return nConversionType; }
|
|
|
|
sal_Bool GetSuccess() const { return bSuccess; }
|
|
|
|
|
2010-11-09 23:50:33 -06:00
|
|
|
void SetLanguage( sal_Int16 nLang ) { nLanguage = nLang; }
|
2004-04-27 10:06:48 -05:00
|
|
|
void SetConversionType( sal_Int16 nType ) { nConversionType = nType; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 07:11:31 -05:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|