LibreOffice Module sc (master)  1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ScHTMLQueryParser Class Reference

The HTML parser for data queries. More...

#include <htmlpars.hxx>

Inheritance diagram for ScHTMLQueryParser:
[legend]
Collaboration diagram for ScHTMLQueryParser:
[legend]

Public Member Functions

 ScHTMLQueryParser (EditEngine *pEditEngine, ScDocument *pDoc)
 
virtual ~ScHTMLQueryParser () override
 
virtual ErrCode Read (SvStream &rStrm, const OUString &rBaseURL) override
 
virtual const ScHTMLTableGetGlobalTable () const override
 Returns the "global table" which contains the entire HTML document. More...
 
- Public Member Functions inherited from ScHTMLParser
 ScHTMLParser (EditEngine *pEditEngine, ScDocument *pDoc)
 The destination document. More...
 
virtual ~ScHTMLParser () override
 
ScHTMLStylesGetStyles ()
 
ScDocumentGetDoc ()
 
- Public Member Functions inherited from ScEEParser
 ScEEParser (EditEngine *)
 
virtual ~ScEEParser ()
 
const ColWidthsMapGetColWidths () const
 
ColWidthsMapGetColWidths ()
 
void GetDimensions (SCCOL &nCols, SCROW &nRows) const
 
size_t ListSize () const
 
ScEEParseEntryListEntry (size_t index)
 
const ScEEParseEntryListEntry (size_t index) const
 

Private Types

typedef ::std::unique_ptr< ScHTMLGlobalTableScHTMLGlobalTablePtr
 

Private Member Functions

void ProcessToken (const HtmlImportInfo &rInfo)
 Handles all possible tags in the HTML document. More...
 
void InsertText (const HtmlImportInfo &rInfo)
 Inserts a text portion into current entry. More...
 
void FontOn (const HtmlImportInfo &rInfo)
 Processes the <font> tag. More...
 
void MetaOn (const HtmlImportInfo &rInfo)
 Processes the <meta> tag. More...
 
void TitleOn ()
 Opens the title of the HTML document (<title> tag). More...
 
void TitleOff (const HtmlImportInfo &rInfo)
 Closes the title of the HTML document (</title> tag). More...
 
void TableOn (const HtmlImportInfo &rInfo)
 Opens a new table at the current position. More...
 
void TableOff (const HtmlImportInfo &rInfo)
 Closes the current table. More...
 
void PreOn (const HtmlImportInfo &rInfo)
 Opens a new table based on preformatted text. More...
 
void PreOff (const HtmlImportInfo &rInfo)
 Closes the current preformatted text table. More...
 
void CloseTable (const HtmlImportInfo &rInfo)
 Closes the current table, regardless on opening tag. More...
 
 DECL_LINK (HTMLImportHdl, HtmlImportInfo &, void)
 

Static Private Member Functions

static void ParseStyle (const OUString &rStrm)
 

Private Attributes

OUStringBuffer maTitle
 
ScHTMLGlobalTablePtr mxGlobTable
 The title of the document. More...
 
ScHTMLTablempCurrTable
 Contains the entire imported document. More...
 
ScHTMLTableId mnUnusedId
 Pointer to current table (performance). More...
 
bool mbTitleOn
 First unused table identifier. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ScEEParser
void NewActEntry (const ScEEParseEntry *)
 
- Protected Attributes inherited from ScHTMLParser
sal_uInt32 maFontHeights [SC_HTML_FONTSIZES]
 
ScDocumentmpDoc
 
- Protected Attributes inherited from ScEEParser
EditEnginepEdit
 
SfxItemPoolpPool
 
SfxItemPoolpDocPool
 
std::vector< std::shared_ptr< ScEEParseEntry > > maList
 
std::shared_ptr< ScEEParseEntrymxActEntry
 
ColWidthsMap maColWidths
 
int nRtfLastToken
 
SCCOL nColCnt
 
SCROW nRowCnt
 
SCCOL nColMax
 
SCROW nRowMax
 

Detailed Description

The HTML parser for data queries.

Focuses on data import, not on layout.

Builds the table structure correctly, ignores extended formatting like pictures or column widths.

Definition at line 565 of file htmlpars.hxx.

Member Typedef Documentation

typedef ::std::unique_ptr< ScHTMLGlobalTable > ScHTMLQueryParser::ScHTMLGlobalTablePtr
private

Definition at line 608 of file htmlpars.hxx.

Constructor & Destructor Documentation

ScHTMLQueryParser::ScHTMLQueryParser ( EditEngine pEditEngine,
ScDocument pDoc 
)
explicit
ScHTMLQueryParser::~ScHTMLQueryParser ( )
overridevirtual

Definition at line 2767 of file htmlpars.cxx.

Member Function Documentation

void ScHTMLQueryParser::CloseTable ( const HtmlImportInfo rInfo)
private

Closes the current table, regardless on opening tag.

Definition at line 3003 of file htmlpars.cxx.

References ScHTMLTable::CloseTable(), and mpCurrTable.

ScHTMLQueryParser::DECL_LINK ( HTMLImportHdl  ,
HtmlImportInfo ,
void   
)
private
void ScHTMLQueryParser::FontOn ( const HtmlImportInfo rInfo)
private
const ScHTMLTable * ScHTMLQueryParser::GetGlobalTable ( ) const
overridevirtual

Returns the "global table" which contains the entire HTML document.

Implements ScHTMLParser.

Definition at line 2809 of file htmlpars.cxx.

References mxGlobTable.

void ScHTMLQueryParser::InsertText ( const HtmlImportInfo rInfo)
private

Inserts a text portion into current entry.

Definition at line 2897 of file htmlpars.cxx.

References HtmlImportInfo::aText, maTitle, mbTitleOn, mpCurrTable, and ScHTMLTable::PutText().

Referenced by ProcessToken(), and TitleOff().

void ScHTMLQueryParser::MetaOn ( const HtmlImportInfo rInfo)
private
void ScHTMLQueryParser::ParseStyle ( const OUString &  rStrm)
staticprivate

Definition at line 3093 of file htmlpars.cxx.

References aStr, and OUStringToOString().

Referenced by ProcessToken().

void ScHTMLQueryParser::PreOff ( const HtmlImportInfo rInfo)
private

Closes the current preformatted text table.

Definition at line 2998 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::PreOff().

Referenced by ProcessToken().

void ScHTMLQueryParser::PreOn ( const HtmlImportInfo rInfo)
private

Opens a new table based on preformatted text.

Definition at line 2993 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::PreOn().

Referenced by ProcessToken().

void ScHTMLQueryParser::ProcessToken ( const HtmlImportInfo rInfo)
private
ErrCode ScHTMLQueryParser::Read ( SvStream rStrm,
const OUString &  rBaseURL 
)
overridevirtual
void ScHTMLQueryParser::TableOff ( const HtmlImportInfo rInfo)
private

Closes the current table.

Definition at line 2988 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::TableOff().

Referenced by ProcessToken().

void ScHTMLQueryParser::TableOn ( const HtmlImportInfo rInfo)
private

Opens a new table at the current position.

Definition at line 2983 of file htmlpars.cxx.

References mpCurrTable, and ScHTMLTable::TableOn().

Referenced by ProcessToken().

void ScHTMLQueryParser::TitleOff ( const HtmlImportInfo rInfo)
private

Closes the title of the HTML document (</title> tag).

Definition at line 2966 of file htmlpars.cxx.

References ScDocument::GetDocumentShell(), SfxObjectShell::GetModel(), InsertText(), maTitle, mbTitleOn, and ScHTMLParser::mpDoc.

Referenced by ProcessToken().

void ScHTMLQueryParser::TitleOn ( )
private

Opens the title of the HTML document (<title> tag).

Definition at line 2960 of file htmlpars.cxx.

References maTitle, and mbTitleOn.

Referenced by ProcessToken().

Member Data Documentation

OUStringBuffer ScHTMLQueryParser::maTitle
private

Definition at line 610 of file htmlpars.hxx.

Referenced by InsertText(), TitleOff(), and TitleOn().

bool ScHTMLQueryParser::mbTitleOn
private

First unused table identifier.

Definition at line 614 of file htmlpars.hxx.

Referenced by InsertText(), TitleOff(), and TitleOn().

ScHTMLTableId ScHTMLQueryParser::mnUnusedId
private

Pointer to current table (performance).

Definition at line 613 of file htmlpars.hxx.

Referenced by ScHTMLQueryParser().

ScHTMLTable* ScHTMLQueryParser::mpCurrTable
private

Contains the entire imported document.

Definition at line 612 of file htmlpars.hxx.

Referenced by CloseTable(), FontOn(), InsertText(), PreOff(), PreOn(), ProcessToken(), ScHTMLQueryParser(), TableOff(), and TableOn().

ScHTMLGlobalTablePtr ScHTMLQueryParser::mxGlobTable
private

The title of the document.

Definition at line 611 of file htmlpars.hxx.

Referenced by GetGlobalTable(), Read(), and ScHTMLQueryParser().


The documentation for this class was generated from the following files: