LibreOffice Module editeng (master) 1
eehtml.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <memory>
23#include <optional>
24#include <editdoc.hxx>
25#include <rtl/ustrbuf.hxx>
26#include <svtools/parhtml.hxx>
27
28class EditEngine;
29
31{
32 OUString aHRef;
33 OUString aText;
34};
35
37{
39private:
40 OUStringBuffer maStyleSource;
42 OUString aBaseURL;
44 std::optional<AnchorInfo> moCurAnchor;
45
46 bool bInPara:1;
47 bool bWasInPara:1; // Remember bInPara before HeadingStart, because afterwards it will be gone.
49 bool bInTitle:1;
50
54
55 void StartPara( bool bReal );
56 void EndPara();
57 void AnchorStart();
58 void AnchorEnd();
59 void HeadingStart( HtmlTokenId nToken );
60 void HeadingEnd();
61 void SkipGroup( HtmlTokenId nEndToken );
62 bool ThrowAwayBlank();
64
65 void ImpInsertParaBreak();
66 void ImpInsertText( const OUString& rText );
67 void ImpSetAttribs( const SfxItemSet& rItems );
68 void ImpSetStyleSheet( sal_uInt16 nHeadingLevel );
69
70protected:
71 virtual void NextToken( HtmlTokenId nToken ) override;
72
73public:
74 EditHTMLParser(SvStream& rIn, OUString aBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs);
75 virtual ~EditHTMLParser() override;
76
77 SvParserState CallParser(EditEngine* pEE, const EditPaM& rPaM);
78
79 const EditSelection& GetCurSelection() const { return aCurSel; }
80};
81
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool bFieldsInserted
Definition: eehtml.hxx:48
bool HasTextInCurrentPara()
Definition: eehtml.cxx:734
OUString aBaseURL
Definition: eehtml.hxx:42
virtual ~EditHTMLParser() override
Definition: eehtml.cxx:63
sal_uInt8 nDefListLevel
Definition: eehtml.hxx:53
void StartPara(bool bReal)
Definition: eehtml.cxx:687
void AnchorStart()
Definition: eehtml.cxx:739
void HeadingStart(HtmlTokenId nToken)
Definition: eehtml.cxx:787
void EndPara()
Definition: eehtml.cxx:715
bool bInPara
Definition: eehtml.hxx:46
bool bWasInPara
Definition: eehtml.hxx:47
void HeadingEnd()
Definition: eehtml.cxx:801
sal_uInt8 nInTable
Definition: eehtml.hxx:51
void ImpInsertParaBreak()
Definition: eehtml.cxx:496
EditHTMLParser(SvStream &rIn, OUString aBaseURL, SvKeyValueIterator *pHTTPHeaderAttrs)
Definition: eehtml.cxx:38
bool bInTitle
Definition: eehtml.hxx:49
EditSelection aCurSel
Definition: eehtml.hxx:41
std::optional< AnchorInfo > moCurAnchor
Definition: eehtml.hxx:44
virtual void NextToken(HtmlTokenId nToken) override
Definition: eehtml.cxx:98
void ImpInsertText(const OUString &rText)
Definition: eehtml.cxx:647
sal_uInt8 nInCell
Definition: eehtml.hxx:52
void ImpSetAttribs(const SfxItemSet &rItems)
Definition: eehtml.cxx:506
virtual SvParserState CallParser() override
bool ThrowAwayBlank()
Definition: eehtml.cxx:726
void SkipGroup(HtmlTokenId nEndToken)
Definition: eehtml.cxx:659
EditEngine * mpEditEngine
Definition: eehtml.hxx:43
void AnchorEnd()
Definition: eehtml.cxx:769
void ImpSetStyleSheet(sal_uInt16 nHeadingLevel)
Definition: eehtml.cxx:552
const EditSelection & GetCurSelection() const
Definition: eehtml.hxx:79
OUStringBuffer maStyleSource
Definition: eehtml.hxx:40
virtual SvParserState CallParser() override
tools::SvRef< EditHTMLParser > EditHTMLParserRef
Definition: eehtml.hxx:82
HtmlTokenId
OUString aHRef
Definition: eehtml.hxx:32
OUString aText
Definition: eehtml.hxx:33
SvParserState
unsigned char sal_uInt8