LibreOffice Module sdext (master) 1
drawtreevisiting.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_DRAWTREEVISITING_HXX
21#define INCLUDED_SDEXT_SOURCE_PDFIMPORT_TREE_DRAWTREEVISITING_HXX
22
23#include <treevisiting.hxx>
24
25#include <com/sun/star/i18n/XBreakIterator.hpp>
26#include <com/sun/star/i18n/XCharacterClassification.hpp>
27
28namespace pdfi
29{
30 struct DrawElement;
31
33 {
34 private:
36 css::uno::Reference< css::i18n::XBreakIterator > mxBreakIter;
37
38 void optimizeTextElements(Element& rParent);
39
40 public:
41 const css::uno::Reference< css::i18n::XBreakIterator >& GetBreakIterator();
42 explicit DrawXmlOptimizer(PDFIProcessor& rProcessor) :
44 {}
45
46 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
47 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
48 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
49 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
50 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
51 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
52 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
53 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
54 };
55
57 {
58 private:
61
62 public:
63 explicit DrawXmlFinalizer(StyleContainer& rStyleContainer,
64 PDFIProcessor& rProcessor) :
65 m_rStyleContainer(rStyleContainer),
67 {}
68
69 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
70 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
71 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
72 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
73 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
74 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
75 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
76 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
77 };
78
80 {
81 private:
82 css::uno::Reference< css::i18n::XCharacterClassification > mxCharClass;
83
87
88 static void fillFrameProps( DrawElement& rElem,
89 PropertyMap& rProps,
90 const EmitContext& rEmitContext,
91 bool bWasTransformed
92 );
93
94 public:
95 const css::uno::Reference< css::i18n::XCharacterClassification >& GetCharacterClassification();
97 explicit DrawXmlEmitter(EmitContext& rEmitContext, DocType eDocType) :
98 m_rEmitContext(rEmitContext),
100 {}
101
102 virtual void visit( HyperlinkElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
103 virtual void visit( TextElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
104 virtual void visit( ParagraphElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
105 virtual void visit( FrameElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
106 virtual void visit( PolyPolyElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
107 virtual void visit( ImageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
108 virtual void visit( PageElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
109 virtual void visit( DocumentElement&, const std::list< std::unique_ptr<Element> >::const_iterator& ) override;
110 };
111}
112
113#endif
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ::rtl::Reference< IEventProcessor > & rProcessor
css::uno::Reference< css::i18n::XCharacterClassification > mxCharClass
DrawXmlEmitter(EmitContext &rEmitContext, DocType eDocType)
virtual void visit(HyperlinkElement &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
const bool m_bWriteDrawDocument
writes Impress doc when false
const css::uno::Reference< css::i18n::XCharacterClassification > & GetCharacterClassification()
EmitContext & m_rEmitContext
static void fillFrameProps(DrawElement &rElem, PropertyMap &rProps, const EmitContext &rEmitContext, bool bWasTransformed)
DrawXmlFinalizer(StyleContainer &rStyleContainer, PDFIProcessor &rProcessor)
StyleContainer & m_rStyleContainer
PDFIProcessor & m_rProcessor
virtual void visit(HyperlinkElement &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
DrawXmlOptimizer(PDFIProcessor &rProcessor)
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
PDFIProcessor & m_rProcessor
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIter
Main entry from the parser.
std::unordered_map< OUString, OUString > PropertyMap
Definition: pdfihelper.hxx:44
To be visited by all tree element types.