Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / HtmlReader.hxx
blob56731055ab10c23e0a0ab089ca07993bbef6d23f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_HTMLREADER_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_HTMLREADER_HXX
22 #include "DExport.hxx"
23 #include <svtools/parhtml.hxx>
24 #include <editeng/svxenum.hxx>
25 #include <com/sun/star/awt/FontDescriptor.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
28 class SvStream;
30 namespace dbaui
32 class OHTMLReader : public HTMLParser, public ODatabaseExport
34 OUString m_sCurrent;
35 sal_Int32 m_nTableCount;
36 sal_Int16 m_nWidth;
37 sal_Int16 m_nColumnWidth; ///< maximum column width
38 bool m_bMetaOptions; ///< true when we scanned the meta information
39 bool m_bSDNum;
41 protected:
42 virtual void NextToken( int nToken ) override; // base class
43 virtual bool CreateTable(int nToken) override;
44 virtual TypeSelectionPageFactory
45 getTypeSelectionPageFactory() override;
47 void TableDataOn(SvxCellHorJustify& eVal);
48 void TableFontOn(css::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor);
49 sal_Int16 GetWidthPixel( const HTMLOption& rOption );
50 void setTextEncoding();
51 void fetchOptions();
52 virtual ~OHTMLReader();
54 public:
55 OHTMLReader(SvStream& rIn,
56 const SharedConnection& _rxConnection,
57 const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
58 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
59 const TColumnVector* rList = nullptr,
60 const OTypeInfoMap* _pInfoMap = nullptr);
61 // required for automatic type recognition
62 OHTMLReader(SvStream& rIn,
63 sal_Int32 nRows,
64 const TPositions &_rColumnPositions,
65 const css::uno::Reference< css::util::XNumberFormatter >& _rxNumberF,
66 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
67 const TColumnVector* rList,
68 const OTypeInfoMap* _pInfoMap,
69 bool _bAutoIncrementEnabled);
71 virtual SvParserState CallParser() override;// base class
72 virtual void release() override;
73 ///< @attention recovers only valid data if 1. CTOR has been used
76 typedef tools::SvRef<OHTMLReader> OHTMLReaderRef;
78 #endif
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */