20#ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_GENERICELEMENTS_HXX
21#define INCLUDED_SDEXT_SOURCE_PDFIMPORT_INC_GENERICELEMENTS_HXX
26#include <com/sun/star/task/XStatusIndicator.hpp>
27#include <com/sun/star/uno/XComponentContext.hpp>
28#include <com/sun/star/i18n/BreakIterator.hpp>
30#include <rtl/ustring.hxx>
31#include <rtl/ustrbuf.hxx>
51 const css::uno::Reference<
52 css::task::XStatusIndicator>& _xStatusIndicator,
53 css::uno::Reference< css::uno::XComponentContext >
const & xContext)
80 pParent->
Children.emplace_back(
this );
100#if OSL_DEBUG_LEVEL > 0
107 static void setParent( std::list<std::unique_ptr<Element>>::iterator
const & el,
Element* pNewParent );
222#if OSL_DEBUG_LEVEL > 0
251 bool resolveHyperlink(
const std::list<std::unique_ptr<Element>>::iterator& link_it, std::list<std::unique_ptr<Element>>& rElements );
292 {
return new TextElement( pParent, nGCId, nFontId ); }
311 {
return std::make_shared<DocumentElement>(); }
314 bool isComplex(
const css::uno::Reference<css::i18n::XBreakIterator>& rBreakIterator, TextElement*
const pTextElem);
static ParagraphElement * createParagraphElement(Element *pParent)
static FrameElement * createFrameElement(Element *pParent, sal_Int32 nGCId)
static PageElement * createPageElement(Element *pParent, sal_Int32 nPageNr)
static PolyPolyElement * createPolyPolyElement(Element *pParent, sal_Int32 nGCId, const basegfx::B2DPolyPolygon &rPolyPoly, sal_Int8 nAction)
static TextElement * createTextElement(Element *pParent, sal_Int32 nGCId, sal_Int32 nFontId)
static ImageElement * createImageElement(Element *pParent, sal_Int32 nGCId, ImageId nImage)
static HyperlinkElement * createHyperlinkElement(Element *pParent, const OUString &rURI)
static std::shared_ptr< DocumentElement > createDocumentElement()
Main entry from the parser.
bool isComplex(const css::uno::Reference< css::i18n::XBreakIterator > &rBreakIterator, TextElement *const pTextElem)
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.
virtual ~DocumentElement() override
DrawElement(Element *pParent, sal_Int32 nGCId)
To be visited by all tree element types.
Element(Element *pParent)
virtual const TextElement * dynCastAsTextElement() const
To avoid some dynamic_cast cost.
static void setParent(std::list< std::unique_ptr< Element > >::iterator const &el, Element *pNewParent)
el must be a valid dereferenceable iterator of el->Parent->Children pNewParent must not be NULL
std::list< std::unique_ptr< Element > > Children
virtual void emitStructure(int nLevel)
virtual TextElement * dynCastAsTextElement()
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &rParentIt)=0
To be implemented by every tree node that needs to be visitable.
void applyToChildren(ElementTreeVisitor &)
Apply visitor to all children.
void updateGeometryWith(const Element *pMergeFrom)
Union element geometry with given element.
css::uno::Reference< css::uno::XComponentContext > m_xContext
EmitContext(XmlEmitter &_rEmitter, StyleContainer &_rStyles, ImageContainer &_rImages, PDFIProcessor &_rProcessor, const css::uno::Reference< css::task::XStatusIndicator > &_xStatusIndicator, css::uno::Reference< css::uno::XComponentContext > const &xContext)
PDFIProcessor & rProcessor
css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.
FrameElement(Element *pParent, sal_Int32 nGCId)
GraphicalElement(Element *pParent, sal_Int32 nGCId)
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.
HyperlinkElement(Element *pParent, const OUString &rURI)
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.
ImageElement(Element *pParent, sal_Int32 nGCId, ImageId nImage)
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.
std::unique_ptr< Element > FooterElement
std::unique_ptr< Element > HeaderElement
void resolveUnderlines(PDFIProcessor const &rProc)
PageElement(Element *pParent, sal_Int32 nPageNr)
bool resolveHyperlink(const std::list< std::unique_ptr< Element > >::iterator &link_it, std::list< std::unique_ptr< Element > > &rElements)
virtual ~PageElement() override
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &rParentIt) override
To be implemented by every tree node that needs to be visitable.
void resolveFontStyles(PDFIProcessor const &rProc)
TextElement * getFirstTextChild() const
double getLineHeight(PDFIProcessor &rProc) const
ParagraphElement(Element *pParent)
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &rParentIt) override
To be implemented by every tree node that needs to be visitable.
bool isSingleLined(PDFIProcessor const &rProc) const
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &rParentIt) override
To be implemented by every tree node that needs to be visitable.
basegfx::B2DPolyPolygon PolyPoly
PolyPolyElement(Element *pParent, sal_Int32 nGCId, const basegfx::B2DPolyPolygon &rPolyPoly, sal_Int8 nAction)
virtual void emitStructure(int nLevel) override
TextElement(Element *pParent, sal_Int32 nGCId, sal_Int32 nFontId)
virtual TextElement * dynCastAsTextElement() override
virtual const TextElement * dynCastAsTextElement() const override
To avoid some dynamic_cast cost.
virtual void visitedBy(ElementTreeVisitor &, const std::list< std::unique_ptr< Element > >::const_iterator &) override
To be implemented by every tree node that needs to be visitable.