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