1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir #ifndef DBAUI_HTMLREADER_HXX 24cdf0e10cSrcweir #define DBAUI_HTMLREADER_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef DBAUI_DATABASEEXPORT_HXX 27cdf0e10cSrcweir #include "DExport.hxx" 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir #ifndef _PARHTML_HXX //autogen 30cdf0e10cSrcweir #include <svtools/parhtml.hxx> 31cdf0e10cSrcweir #endif 32cdf0e10cSrcweir #ifndef _SVX_SVXENUM_HXX 33cdf0e10cSrcweir #include <editeng/svxenum.hxx> 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir #ifndef _STREAM_HXX 36cdf0e10cSrcweir #include <tools/stream.hxx> 37cdf0e10cSrcweir #endif 38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_ 39cdf0e10cSrcweir #include <com/sun/star/awt/FontDescriptor.hpp> 40cdf0e10cSrcweir #endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir namespace dbaui 44cdf0e10cSrcweir { 45cdf0e10cSrcweir //=============================================================================================== 46cdf0e10cSrcweir // OHTMLReader 47cdf0e10cSrcweir //=============================================================================================== 48cdf0e10cSrcweir class OHTMLReader : public HTMLParser, public ODatabaseExport 49cdf0e10cSrcweir { 50cdf0e10cSrcweir String m_sCurrent; 51cdf0e10cSrcweir sal_Int32 m_nTableCount; 52cdf0e10cSrcweir sal_Int16 m_nWidth; 53cdf0e10cSrcweir sal_Int16 m_nColumnWidth; // max. Spaltenbreite 54cdf0e10cSrcweir sal_Bool m_bMetaOptions; // true when we scaned the meta information 55cdf0e10cSrcweir sal_Bool m_bSDNum; 56cdf0e10cSrcweir 57cdf0e10cSrcweir protected: 58cdf0e10cSrcweir virtual void NextToken( int nToken ); // Basisklasse 59cdf0e10cSrcweir virtual sal_Bool CreateTable(int nToken); 60cdf0e10cSrcweir virtual TypeSelectionPageFactory 61cdf0e10cSrcweir getTypeSelectionPageFactory(); 62cdf0e10cSrcweir 63cdf0e10cSrcweir void TableDataOn(SvxCellHorJustify& eVal,int nToken); 64cdf0e10cSrcweir void TableFontOn(::com::sun::star::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor); 65cdf0e10cSrcweir sal_Int16 GetWidthPixel( const HTMLOption* pOption ); 66cdf0e10cSrcweir void setTextEncoding(); 67cdf0e10cSrcweir void fetchOptions(); 68cdf0e10cSrcweir virtual ~OHTMLReader(); 69cdf0e10cSrcweir public: 70cdf0e10cSrcweir OHTMLReader(SvStream& rIn, 71cdf0e10cSrcweir const SharedConnection& _rxConnection, 72cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, 73cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, 74cdf0e10cSrcweir const TColumnVector* rList = 0, 75cdf0e10cSrcweir const OTypeInfoMap* _pInfoMap = 0); 76cdf0e10cSrcweir // wird f"ur auto. Typ-Erkennung gebraucht 77cdf0e10cSrcweir OHTMLReader(SvStream& rIn, 78cdf0e10cSrcweir sal_Int32 nRows, 79cdf0e10cSrcweir const TPositions &_rColumnPositions, 80cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, 81cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, 82cdf0e10cSrcweir const TColumnVector* rList, 83cdf0e10cSrcweir const OTypeInfoMap* _pInfoMap, 84cdf0e10cSrcweir sal_Bool _bAutoIncrementEnabled); 85cdf0e10cSrcweir 86cdf0e10cSrcweir virtual SvParserState CallParser();// Basisklasse 87cdf0e10cSrcweir virtual void release(); 88cdf0e10cSrcweir // birgt nur korrekte Daten, wenn der 1. CTOR benutzt wurde 89cdf0e10cSrcweir }; 90cdf0e10cSrcweir 91cdf0e10cSrcweir SV_DECL_IMPL_REF( OHTMLReader ); 92cdf0e10cSrcweir } 93cdf0e10cSrcweir #endif // DBAUI_HTMLREADER_HXX 94cdf0e10cSrcweir 95cdf0e10cSrcweir 96cdf0e10cSrcweir 97