xref: /trunk/main/dbaccess/source/ui/inc/HtmlReader.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_HTMLREADER_HXX
28 #define DBAUI_HTMLREADER_HXX
29 
30 #ifndef DBAUI_DATABASEEXPORT_HXX
31 #include "DExport.hxx"
32 #endif
33 #ifndef _PARHTML_HXX //autogen
34 #include <svtools/parhtml.hxx>
35 #endif
36 #ifndef _SVX_SVXENUM_HXX
37 #include <editeng/svxenum.hxx>
38 #endif
39 #ifndef _STREAM_HXX
40 #include <tools/stream.hxx>
41 #endif
42 #ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
43 #include <com/sun/star/awt/FontDescriptor.hpp>
44 #endif
45 
46 
47 namespace dbaui
48 {
49 	//===============================================================================================
50 	// OHTMLReader
51 	//===============================================================================================
52 	class OHTMLReader : public HTMLParser, public ODatabaseExport
53 	{
54         String              m_sCurrent;
55 		sal_Int32			m_nTableCount;
56 		sal_Int16			m_nWidth;
57 		sal_Int16			m_nColumnWidth;		// max. Spaltenbreite
58 		sal_Bool			m_bMetaOptions;		// true when we scaned the meta information
59 		sal_Bool			m_bSDNum;
60 
61 	protected:
62 		virtual void		NextToken( int nToken ); // Basisklasse
63 		virtual sal_Bool	CreateTable(int nToken);
64         virtual TypeSelectionPageFactory
65                              getTypeSelectionPageFactory();
66 
67 		void				TableDataOn(SvxCellHorJustify& eVal,int nToken);
68 		void				TableFontOn(::com::sun::star::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor);
69 		sal_Int16			GetWidthPixel( const HTMLOption* pOption );
70 		void				setTextEncoding();
71         void                fetchOptions();
72 		virtual ~OHTMLReader();
73 	public:
74 		OHTMLReader(SvStream& rIn,
75 					const SharedConnection& _rxConnection,
76 					const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
77 					const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM,
78 					const TColumnVector* rList = 0,
79 					const OTypeInfoMap* _pInfoMap = 0);
80 		// wird f"ur auto. Typ-Erkennung gebraucht
81 		OHTMLReader(SvStream& rIn,
82 					sal_Int32 nRows,
83 					const TPositions &_rColumnPositions,
84 					const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF,
85 					const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM,
86 					const TColumnVector* rList,
87 					const OTypeInfoMap* _pInfoMap,
88                     sal_Bool _bAutoIncrementEnabled);
89 
90 		virtual		SvParserState CallParser();// Basisklasse
91 		virtual		void		  release();
92 		// birgt nur korrekte Daten, wenn der 1. CTOR benutzt wurde
93 	};
94 
95 	SV_DECL_IMPL_REF( OHTMLReader );
96 }
97 #endif // DBAUI_HTMLREADER_HXX
98 
99 
100 
101