2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2001-02-16 14:54:09 +00:00
|
|
|
#ifndef DBAUI_HTMLREADER_HXX
|
|
|
|
#define DBAUI_HTMLREADER_HXX
|
|
|
|
|
|
|
|
#include "DExport.hxx"
|
|
|
|
#include <svtools/parhtml.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/svxenum.hxx>
|
2001-02-16 14:54:09 +00:00
|
|
|
#include <tools/stream.hxx>
|
2001-02-23 14:02:06 +00:00
|
|
|
#include <com/sun/star/awt/FontDescriptor.hpp>
|
2001-02-16 14:54:09 +00:00
|
|
|
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
class OHTMLReader : public HTMLParser, public ODatabaseExport
|
|
|
|
{
|
2013-09-26 12:17:53 +02:00
|
|
|
OUString m_sCurrent;
|
2001-02-16 14:54:09 +00:00
|
|
|
sal_Int32 m_nTableCount;
|
|
|
|
sal_Int16 m_nWidth;
|
2012-08-12 18:22:40 +02:00
|
|
|
sal_Int16 m_nColumnWidth; ///< maximum column width
|
|
|
|
sal_Bool m_bMetaOptions; ///< true when we scanned the meta information
|
2002-07-09 11:32:36 +00:00
|
|
|
sal_Bool m_bSDNum;
|
2007-11-21 14:59:31 +00:00
|
|
|
|
2001-02-16 14:54:09 +00:00
|
|
|
protected:
|
2012-08-10 21:24:32 +02:00
|
|
|
virtual void NextToken( int nToken ); // base class
|
2001-02-16 14:54:09 +00:00
|
|
|
virtual sal_Bool CreateTable(int nToken);
|
2008-01-30 07:46:52 +00:00
|
|
|
virtual TypeSelectionPageFactory
|
2012-08-12 18:45:53 +02:00
|
|
|
getTypeSelectionPageFactory();
|
2002-01-22 06:22:37 +00:00
|
|
|
|
2011-01-27 11:24:16 +00:00
|
|
|
void TableDataOn(SvxCellHorJustify& eVal);
|
2001-02-23 14:02:06 +00:00
|
|
|
void TableFontOn(::com::sun::star::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor);
|
2011-07-22 16:04:43 -04:00
|
|
|
sal_Int16 GetWidthPixel( const HTMLOption& rOption );
|
2001-02-23 14:02:06 +00:00
|
|
|
void setTextEncoding();
|
2006-05-04 07:42:52 +00:00
|
|
|
void fetchOptions();
|
2006-10-18 12:31:27 +00:00
|
|
|
virtual ~OHTMLReader();
|
2012-08-12 18:38:58 +02:00
|
|
|
|
2001-02-16 14:54:09 +00:00
|
|
|
public:
|
|
|
|
OHTMLReader(SvStream& rIn,
|
2005-09-23 11:33:23 +00:00
|
|
|
const SharedConnection& _rxConnection,
|
2001-02-23 14:02:06 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
|
2012-12-06 14:15:55 +02:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
|
2001-07-02 12:22:11 +00:00
|
|
|
const TColumnVector* rList = 0,
|
|
|
|
const OTypeInfoMap* _pInfoMap = 0);
|
2012-08-10 21:24:32 +02:00
|
|
|
// required for automatic type recognition
|
2001-02-16 14:54:09 +00:00
|
|
|
OHTMLReader(SvStream& rIn,
|
|
|
|
sal_Int32 nRows,
|
2002-05-23 10:10:43 +00:00
|
|
|
const TPositions &_rColumnPositions,
|
2001-02-23 14:02:06 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
|
2012-12-06 14:15:55 +02:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
|
2006-05-04 07:42:52 +00:00
|
|
|
const TColumnVector* rList,
|
|
|
|
const OTypeInfoMap* _pInfoMap,
|
|
|
|
sal_Bool _bAutoIncrementEnabled);
|
2001-02-16 14:54:09 +00:00
|
|
|
|
2012-08-12 18:48:35 +02:00
|
|
|
virtual SvParserState CallParser();// base class
|
|
|
|
virtual void release();
|
2012-08-12 18:22:40 +02:00
|
|
|
///< @attention recovers only valid data if 1. CTOR has been used
|
2001-02-16 14:54:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
SV_DECL_IMPL_REF( OHTMLReader );
|
|
|
|
}
|
2012-08-12 18:38:58 +02:00
|
|
|
#endif
|
2001-02-16 14:54:09 +00:00
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|