LibreOffice Module sdext (master) 1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
pdfi::PDFIProcessor Class Referencefinal

Main entry from the parser. More...

#include <pdfiprocessor.hxx>

Inheritance diagram for pdfi::PDFIProcessor:
[legend]
Collaboration diagram for pdfi::PDFIProcessor:
[legend]

Public Member Functions

 PDFIProcessor (const css::uno::Reference< css::task::XStatusIndicator > &xStat, css::uno::Reference< css::uno::XComponentContext > const &xContext)
 
void emit (XmlEmitter &rEmitter, const TreeVisitorFactory &rVisitorFactory)
 
sal_Int32 getGCId (const GraphicsContext &rGC)
 
const GraphicsContextgetGraphicsContext (sal_Int32 nGCId) const
 
GraphicsContextgetCurrentContext ()
 
const GraphicsContextgetCurrentContext () const
 
const css::uno::Reference< css::task::XStatusIndicator > & getStatusIndicator () const
 
const FontAttributesgetFont (sal_Int32 nFontId) const
 
sal_Int32 getFontId (const FontAttributes &rAttr) const
 
- Public Member Functions inherited from pdfi::ContentSink
virtual ~ContentSink ()
 
virtual void setPageNum (sal_Int32 nNumPages)=0
 Total number of pages for upcoming document. More...
 
virtual void startPage (const css::geometry::RealSize2D &rSize)=0
 
virtual void endPage ()=0
 
virtual void hyperLink (const css::geometry::RealRectangle2D &rBounds, const OUString &rURI)=0
 
virtual void pushState ()=0
 
virtual void popState ()=0
 
virtual void setFlatness (double)=0
 
virtual void setTransformation (const css::geometry::AffineMatrix2D &rMatrix)=0
 
virtual void setLineDash (const css::uno::Sequence< double > &dashes, double start)=0
 
virtual void setLineJoin (sal_Int8 lineJoin)=0
 
virtual void setLineCap (sal_Int8 lineCap)=0
 
virtual void setMiterLimit (double)=0
 
virtual void setLineWidth (double)=0
 
virtual void setFillColor (const css::rendering::ARGBColor &rColor)=0
 
virtual void setStrokeColor (const css::rendering::ARGBColor &rColor)=0
 
virtual void setFont (const FontAttributes &rFont)=0
 
virtual void setTextRenderMode (sal_Int32)=0
 
virtual void strokePath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath)=0
 
virtual void fillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath)=0
 
virtual void eoFillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath)=0
 
virtual void intersectClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath)=0
 
virtual void intersectEoClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath)=0
 
virtual void drawGlyphs (const OUString &rGlyphs, const css::geometry::RealRectangle2D &rRect, const css::geometry::Matrix2D &rFontMatrix, double fontSize)=0
 
virtual void endText ()=0
 issued when a sequence of associated glyphs is drawn More...
 
virtual void drawMask (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, bool bInvert)=0
 draws given bitmap as a mask (using current fill color) More...
 
virtual void drawImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap)=0
 Given image must already be color-mapped and normalized to sRGB. More...
 
virtual void drawColorMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::uno::Any > &xMaskColors)=0
 Given image must already be color-mapped and normalized to sRGB. More...
 
virtual void drawMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::beans::PropertyValue > &xMask, bool bInvertMask)=0
 
virtual void drawAlphaMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xImage, const css::uno::Sequence< css::beans::PropertyValue > &xMask)=0
 

Static Public Member Functions

static void sortElements (Element *pElement)
 
static OUString SubstituteBidiMirrored (const OUString &rString)
 

Public Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
basegfx::B2DHomMatrix prevTextMatrix
 
double prevCharWidth
 

Private Types

typedef std::unordered_map< sal_Int32, FontAttributesIdToFontMap
 
typedef std::unordered_map< FontAttributes, sal_Int32, FontAttrHashFontToIdMap
 
typedef std::unordered_map< sal_Int32, GraphicsContextIdToGCMap
 
typedef std::unordered_map< GraphicsContext, sal_Int32, GraphicsContextHashGCToIdMap
 
typedef std::vector< GraphicsContextGraphicsContextStack
 

Private Member Functions

void processGlyphLine ()
 
virtual void setPageNum (sal_Int32 nNumPages) override
 Total number of pages for upcoming document. More...
 
virtual void startPage (const css::geometry::RealSize2D &rSize) override
 
virtual void endPage () override
 
virtual void hyperLink (const css::geometry::RealRectangle2D &rBounds, const OUString &rURI) override
 
virtual void pushState () override
 
virtual void popState () override
 
virtual void setFlatness (double) override
 
virtual void setTransformation (const css::geometry::AffineMatrix2D &rMatrix) override
 
virtual void setLineDash (const css::uno::Sequence< double > &dashes, double start) override
 
virtual void setLineJoin (sal_Int8) override
 
virtual void setLineCap (sal_Int8) override
 
virtual void setMiterLimit (double) override
 
virtual void setLineWidth (double) override
 
virtual void setFillColor (const css::rendering::ARGBColor &rColor) override
 
virtual void setStrokeColor (const css::rendering::ARGBColor &rColor) override
 
virtual void setFont (const FontAttributes &rFont) override
 
virtual void setTextRenderMode (sal_Int32) override
 
virtual void strokePath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
 
virtual void fillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
 
virtual void eoFillPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
 
virtual void intersectClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
 
virtual void intersectEoClip (const css::uno::Reference< css::rendering::XPolyPolygon2D > &rPath) override
 
virtual void drawGlyphs (const OUString &rGlyphs, const css::geometry::RealRectangle2D &rRect, const css::geometry::Matrix2D &rFontMatrix, double fontSize) override
 
virtual void endText () override
 issued when a sequence of associated glyphs is drawn More...
 
virtual void drawMask (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, bool bInvert) override
 draws given bitmap as a mask (using current fill color) More...
 
virtual void drawImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap) override
 Given image must already be color-mapped and normalized to sRGB. More...
 
virtual void drawColorMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::uno::Any > &xMaskColors) override
 Given image must already be color-mapped and normalized to sRGB. More...
 
virtual void drawMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xBitmap, const css::uno::Sequence< css::beans::PropertyValue > &xMask, bool bInvertMask) override
 
virtual void drawAlphaMaskedImage (const css::uno::Sequence< css::beans::PropertyValue > &xImage, const css::uno::Sequence< css::beans::PropertyValue > &xMask) override
 
void startIndicator (const OUString &rText)
 
void endIndicator ()
 
void setupImage (ImageId nImage)
 

Private Attributes

std::vector< CharGlyphm_GlyphsList
 
std::shared_ptr< DocumentElementm_pDocument
 
PageElementm_pCurPage
 
Elementm_pCurElement
 
sal_Int32 m_nNextFontId
 
IdToFontMap m_aIdToFont
 
FontToIdMap m_aFontToId
 
GraphicsContextStack m_aGCStack
 
sal_Int32 m_nNextGCId
 
IdToGCMap m_aIdToGC
 
GCToIdMap m_aGCToId
 
ImageContainer m_aImages
 
sal_Int32 m_nPages
 
sal_Int32 m_nNextZOrder
 
css::uno::Reference< css::task::XStatusIndicator > m_xStatusIndicator
 

Detailed Description

Main entry from the parser.

Creates the internal DOM tree from the render calls

Definition at line 56 of file pdfiprocessor.hxx.

Member Typedef Documentation

◆ FontToIdMap

typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash> pdfi::PDFIProcessor::FontToIdMap
private

Definition at line 159 of file pdfiprocessor.hxx.

◆ GCToIdMap

typedef std::unordered_map<GraphicsContext, sal_Int32, GraphicsContextHash> pdfi::PDFIProcessor::GCToIdMap
private

Definition at line 162 of file pdfiprocessor.hxx.

◆ GraphicsContextStack

Definition at line 164 of file pdfiprocessor.hxx.

◆ IdToFontMap

typedef std::unordered_map<sal_Int32,FontAttributes> pdfi::PDFIProcessor::IdToFontMap
private

Definition at line 158 of file pdfiprocessor.hxx.

◆ IdToGCMap

typedef std::unordered_map<sal_Int32,GraphicsContext> pdfi::PDFIProcessor::IdToGCMap
private

Definition at line 161 of file pdfiprocessor.hxx.

Constructor & Destructor Documentation

◆ PDFIProcessor()

pdfi::PDFIProcessor::PDFIProcessor ( const css::uno::Reference< css::task::XStatusIndicator > &  xStat,
css::uno::Reference< css::uno::XComponentContext > const &  xContext 
)
explicit

Member Function Documentation

◆ drawAlphaMaskedImage()

void pdfi::PDFIProcessor::drawAlphaMaskedImage ( const css::uno::Sequence< css::beans::PropertyValue > &  xImage,
const css::uno::Sequence< css::beans::PropertyValue > &  xMask 
)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 377 of file pdfiprocessor.cxx.

References pdfi::ImageContainer::addImage(), m_aImages, and setupImage().

◆ drawColorMaskedImage()

void pdfi::PDFIProcessor::drawColorMaskedImage ( const css::uno::Sequence< css::beans::PropertyValue > &  xBitmap,
const css::uno::Sequence< css::uno::Any > &  xMaskColors 
)
overrideprivatevirtual

Given image must already be color-mapped and normalized to sRGB.

maskColors must contain two sequences of color components

Implements pdfi::ContentSink.

Definition at line 362 of file pdfiprocessor.cxx.

References pdfi::ImageContainer::addImage(), m_aImages, and setupImage().

◆ drawGlyphs()

void pdfi::PDFIProcessor::drawGlyphs ( const OUString &  rGlyphs,
const css::geometry::RealRectangle2D &  rRect,
const css::geometry::Matrix2D &  rFontMatrix,
double  fontSize 
)
overrideprivatevirtual

◆ drawImage()

void pdfi::PDFIProcessor::drawImage ( const css::uno::Sequence< css::beans::PropertyValue > &  xBitmap)
overrideprivatevirtual

Given image must already be color-mapped and normalized to sRGB.

Implements pdfi::ContentSink.

Definition at line 357 of file pdfiprocessor.cxx.

References pdfi::ImageContainer::addImage(), m_aImages, and setupImage().

◆ drawMask()

void pdfi::PDFIProcessor::drawMask ( const css::uno::Sequence< css::beans::PropertyValue > &  xBitmap,
bool  bInvert 
)
overrideprivatevirtual

draws given bitmap as a mask (using current fill color)

Implements pdfi::ContentSink.

Definition at line 350 of file pdfiprocessor.cxx.

References pdfi::ImageContainer::addImage(), m_aImages, and setupImage().

◆ drawMaskedImage()

void pdfi::PDFIProcessor::drawMaskedImage ( const css::uno::Sequence< css::beans::PropertyValue > &  xBitmap,
const css::uno::Sequence< css::beans::PropertyValue > &  xMask,
bool  bInvertMask 
)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 369 of file pdfiprocessor.cxx.

References pdfi::ImageContainer::addImage(), m_aImages, and setupImage().

◆ emit()

void pdfi::PDFIProcessor::emit ( XmlEmitter rEmitter,
const TreeVisitorFactory rVisitorFactory 
)

◆ endIndicator()

void pdfi::PDFIProcessor::endIndicator ( )
private

Definition at line 622 of file pdfiprocessor.cxx.

References m_xStatusIndicator.

Referenced by emit().

◆ endPage()

void pdfi::PDFIProcessor::endPage ( )
overrideprivatevirtual

◆ endText()

void pdfi::PDFIProcessor::endText ( )
overrideprivatevirtual

issued when a sequence of associated glyphs is drawn

Implements pdfi::ContentSink.

Definition at line 318 of file pdfiprocessor.cxx.

References pdfi::Element::dynCastAsTextElement(), m_pCurElement, and pdfi::Element::Parent.

◆ eoFillPath()

void pdfi::PDFIProcessor::eoFillPath ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual

◆ fillPath()

void pdfi::PDFIProcessor::fillPath ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual

◆ getCurrentContext() [1/2]

GraphicsContext & pdfi::PDFIProcessor::getCurrentContext ( )
inline

◆ getCurrentContext() [2/2]

const GraphicsContext & pdfi::PDFIProcessor::getCurrentContext ( ) const
inline

Definition at line 73 of file pdfiprocessor.hxx.

References m_aGCStack.

◆ getFont()

const FontAttributes & pdfi::PDFIProcessor::getFont ( sal_Int32  nFontId) const

◆ getFontId()

sal_Int32 pdfi::PDFIProcessor::getFontId ( const FontAttributes rAttr) const

◆ getGCId()

sal_Int32 pdfi::PDFIProcessor::getGCId ( const GraphicsContext rGC)

◆ getGraphicsContext()

const GraphicsContext & pdfi::PDFIProcessor::getGraphicsContext ( sal_Int32  nGCId) const

◆ getStatusIndicator()

const css::uno::Reference< css::task::XStatusIndicator > & pdfi::PDFIProcessor::getStatusIndicator ( ) const
inline

◆ hyperLink()

void pdfi::PDFIProcessor::hyperLink ( const css::geometry::RealRectangle2D &  rBounds,
const OUString &  rURI 
)
overrideprivatevirtual

◆ intersectClip()

void pdfi::PDFIProcessor::intersectClip ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual

◆ intersectEoClip()

void pdfi::PDFIProcessor::intersectEoClip ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual

◆ popState()

void pdfi::PDFIProcessor::popState ( )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 84 of file pdfiprocessor.cxx.

References m_aGCStack.

◆ processGlyphLine()

void pdfi::PDFIProcessor::processGlyphLine ( )
private

◆ pushState()

void pdfi::PDFIProcessor::pushState ( )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 78 of file pdfiprocessor.cxx.

References a, and m_aGCStack.

◆ setFillColor()

void pdfi::PDFIProcessor::setFillColor ( const css::rendering::ARGBColor &  rColor)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 129 of file pdfiprocessor.cxx.

References pdfi::GraphicsContext::FillColor, and getCurrentContext().

◆ setFlatness()

void pdfi::PDFIProcessor::setFlatness ( double  value)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 89 of file pdfiprocessor.cxx.

References pdfi::GraphicsContext::Flatness, getCurrentContext(), and value.

◆ setFont()

void pdfi::PDFIProcessor::setFont ( const FontAttributes rFont)
overrideprivatevirtual

◆ setLineCap()

void pdfi::PDFIProcessor::setLineCap ( sal_Int8  nCap)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 114 of file pdfiprocessor.cxx.

References getCurrentContext(), and pdfi::GraphicsContext::LineCap.

◆ setLineDash()

void pdfi::PDFIProcessor::setLineDash ( const css::uno::Sequence< double > &  dashes,
double  start 
)
overrideprivatevirtual

◆ setLineJoin()

void pdfi::PDFIProcessor::setLineJoin ( sal_Int8  nJoin)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 109 of file pdfiprocessor.cxx.

References getCurrentContext(), and pdfi::GraphicsContext::LineJoin.

◆ setLineWidth()

void pdfi::PDFIProcessor::setLineWidth ( double  nWidth)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 124 of file pdfiprocessor.cxx.

References getCurrentContext(), and pdfi::GraphicsContext::LineWidth.

◆ setMiterLimit()

void pdfi::PDFIProcessor::setMiterLimit ( double  )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 119 of file pdfiprocessor.cxx.

References SAL_WARN.

◆ setPageNum()

void pdfi::PDFIProcessor::setPageNum ( sal_Int32  nNumPages)
overrideprivatevirtual

Total number of pages for upcoming document.

Implements pdfi::ContentSink.

Definition at line 72 of file pdfiprocessor.cxx.

References m_nPages.

◆ setStrokeColor()

void pdfi::PDFIProcessor::setStrokeColor ( const css::rendering::ARGBColor &  rColor)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 134 of file pdfiprocessor.cxx.

References getCurrentContext(), and pdfi::GraphicsContext::LineColor.

◆ setTextRenderMode()

void pdfi::PDFIProcessor::setTextRenderMode ( sal_Int32  i_nMode)
overrideprivatevirtual

◆ setTransformation()

void pdfi::PDFIProcessor::setTransformation ( const css::geometry::AffineMatrix2D &  rMatrix)
overrideprivatevirtual

◆ setupImage()

void pdfi::PDFIProcessor::setupImage ( ImageId  nImage)
private

◆ sortElements()

void pdfi::PDFIProcessor::sortElements ( Element pElement)
static

◆ startIndicator()

void pdfi::PDFIProcessor::startIndicator ( const OUString &  rText)
private

Definition at line 597 of file pdfiprocessor.cxx.

References aStr, i, m_nPages, m_xStatusIndicator, nElements, and nLength.

Referenced by emit(), and startPage().

◆ startPage()

void pdfi::PDFIProcessor::startPage ( const css::geometry::RealSize2D &  rSize)
overrideprivatevirtual

◆ strokePath()

void pdfi::PDFIProcessor::strokePath ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual

◆ SubstituteBidiMirrored()

OUString pdfi::PDFIProcessor::SubstituteBidiMirrored ( const OUString &  rString)
static

Definition at line 701 of file pdfiprocessor.cxx.

References unicode::GetMirroredChar(), and i.

Referenced by pdfi::DrawXmlEmitter::visit(), and pdfi::WriterXmlEmitter::visit().

Member Data Documentation

◆ m_aFontToId

FontToIdMap pdfi::PDFIProcessor::m_aFontToId
private

Definition at line 173 of file pdfiprocessor.hxx.

Referenced by PDFIProcessor(), and setFont().

◆ m_aGCStack

GraphicsContextStack pdfi::PDFIProcessor::m_aGCStack
private

Definition at line 175 of file pdfiprocessor.hxx.

Referenced by getCurrentContext(), PDFIProcessor(), popState(), and pushState().

◆ m_aGCToId

GCToIdMap pdfi::PDFIProcessor::m_aGCToId
private

Definition at line 178 of file pdfiprocessor.hxx.

Referenced by getGCId(), and PDFIProcessor().

◆ m_aIdToFont

IdToFontMap pdfi::PDFIProcessor::m_aIdToFont
private

Definition at line 172 of file pdfiprocessor.hxx.

Referenced by getFont(), PDFIProcessor(), setFont(), and setTextRenderMode().

◆ m_aIdToGC

IdToGCMap pdfi::PDFIProcessor::m_aIdToGC
private

Definition at line 177 of file pdfiprocessor.hxx.

Referenced by getGCId(), getGraphicsContext(), and PDFIProcessor().

◆ m_aImages

ImageContainer pdfi::PDFIProcessor::m_aImages
private

◆ m_GlyphsList

std::vector<CharGlyph> pdfi::PDFIProcessor::m_GlyphsList
private

Definition at line 166 of file pdfiprocessor.hxx.

Referenced by drawGlyphs(), and processGlyphLine().

◆ m_nNextFontId

sal_Int32 pdfi::PDFIProcessor::m_nNextFontId
private

Definition at line 171 of file pdfiprocessor.hxx.

Referenced by setFont().

◆ m_nNextGCId

sal_Int32 pdfi::PDFIProcessor::m_nNextGCId
private

Definition at line 176 of file pdfiprocessor.hxx.

Referenced by getGCId().

◆ m_nNextZOrder

sal_Int32 pdfi::PDFIProcessor::m_nNextZOrder
private

◆ m_nPages

sal_Int32 pdfi::PDFIProcessor::m_nPages
private

Definition at line 182 of file pdfiprocessor.hxx.

Referenced by endPage(), setPageNum(), and startIndicator().

◆ m_pCurElement

Element* pdfi::PDFIProcessor::m_pCurElement
private

◆ m_pCurPage

PageElement* pdfi::PDFIProcessor::m_pCurPage
private

Definition at line 169 of file pdfiprocessor.hxx.

Referenced by endPage(), hyperLink(), and startPage().

◆ m_pDocument

std::shared_ptr<DocumentElement> pdfi::PDFIProcessor::m_pDocument
private

Definition at line 168 of file pdfiprocessor.hxx.

Referenced by emit(), and startPage().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > pdfi::PDFIProcessor::m_xContext

◆ m_xStatusIndicator

css::uno::Reference< css::task::XStatusIndicator > pdfi::PDFIProcessor::m_xStatusIndicator
private

◆ prevCharWidth

double pdfi::PDFIProcessor::prevCharWidth

Definition at line 62 of file pdfiprocessor.hxx.

Referenced by drawGlyphs().

◆ prevTextMatrix

basegfx::B2DHomMatrix pdfi::PDFIProcessor::prevTextMatrix

Definition at line 61 of file pdfiprocessor.hxx.

Referenced by drawGlyphs().


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