LibreOffice Module sdext (master) 1
writertreevisiting.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#ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_TREE_WRITERTREEVISITING_HXX
21#define INCLUDED_SDEXT_SOURCE_PDFIMPORT_TREE_WRITERTREEVISITING_HXX
22
23#include <treevisiting.hxx>
24
25#include <pdfihelper.hxx>
26
27#include <com/sun/star/i18n/XBreakIterator.hpp>
28#include <com/sun/star/i18n/XCharacterClassification.hpp>
29
30namespace pdfi
31{
32 struct DrawElement;
33
35 {
36 private:
38 css::uno::Reference<css::i18n::XBreakIterator> mxBreakIter;
39 void optimizeTextElements(Element& rParent);
40 void checkHeaderAndFooter( PageElement& rElem );
41
42 public:
43 const css::uno::Reference<css::i18n::XBreakIterator>& GetBreakIterator();
44 explicit WriterXmlOptimizer(PDFIProcessor& rProcessor) :
46 {}
47
48 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
49 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
50 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
51 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
52 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
53 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
54 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
55 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
56 };
57
59 {
60 private:
63
64 static void setFirstOnPage( ParagraphElement& rElem,
65 StyleContainer& rStyles,
66 const OUString& rMasterPageName );
67
68 public:
69 explicit WriterXmlFinalizer(StyleContainer& rStyleContainer,
70 PDFIProcessor& rProcessor) :
71 m_rStyleContainer(rStyleContainer),
73 {}
74
75 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
76 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
77 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
78 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
79 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
80 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
81 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
82 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
83 };
84
86 {
87 private:
88 css::uno::Reference< css::i18n::XCharacterClassification > mxCharClass;
90 static void fillFrameProps( DrawElement& rElem,
91 PropertyMap& rProps,
92 const EmitContext& rEmitContext );
93
94 public:
95 const css::uno::Reference<css::i18n::XCharacterClassification >& GetCharacterClassification();
96 explicit WriterXmlEmitter(EmitContext& rEmitContext) :
97 m_rEmitContext(rEmitContext)
98 {}
99
100 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
101 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
102 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
103 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
104 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
105 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
106 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
107 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
108 };
109}
110
111#endif
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ::rtl::Reference< IEventProcessor > & rProcessor
Main entry from the parser.
static void fillFrameProps(DrawElement &rElem, PropertyMap &rProps, const EmitContext &rEmitContext)
WriterXmlEmitter(EmitContext &rEmitContext)
virtual void visit(HyperlinkElement &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
const css::uno::Reference< css::i18n::XCharacterClassification > & GetCharacterClassification()
css::uno::Reference< css::i18n::XCharacterClassification > mxCharClass
WriterXmlFinalizer(StyleContainer &rStyleContainer, PDFIProcessor &rProcessor)
static void setFirstOnPage(ParagraphElement &rElem, StyleContainer &rStyles, const OUString &rMasterPageName)
virtual void visit(HyperlinkElement &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
StyleContainer & m_rStyleContainer
void optimizeTextElements(Element &rParent)
const css::uno::Reference< css::i18n::XBreakIterator > & GetBreakIterator()
virtual void visit(HyperlinkElement &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
WriterXmlOptimizer(PDFIProcessor &rProcessor)
void checkHeaderAndFooter(PageElement &rElem)
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIter
std::unordered_map< OUString, OUString > PropertyMap
Definition: pdfihelper.hxx:44
To be visited by all tree element types.