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 Reference

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 ()
 

Static Public Member Functions

static void sortElements (Element *pElement)
 
static OUString mirrorString (const OUString &i_rInString)
 

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 boost::bimaps::bimap< boost::bimaps::unordered_set_of< GraphicsContext, GraphicsContextHash >, boost::bimaps::unordered_set_of< sal_Int32 > > GCToIdBiMap
 
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
 
GCToIdBiMap 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 58 of file pdfiprocessor.hxx.

Member Typedef Documentation

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

Definition at line 161 of file pdfiprocessor.hxx.

typedef boost::bimaps::bimap< boost::bimaps::unordered_set_of<GraphicsContext, GraphicsContextHash>, boost::bimaps::unordered_set_of<sal_Int32> > pdfi::PDFIProcessor::GCToIdBiMap
private

Definition at line 166 of file pdfiprocessor.hxx.

Definition at line 168 of file pdfiprocessor.hxx.

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

Definition at line 160 of file pdfiprocessor.hxx.

Constructor & Destructor Documentation

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

Member Function Documentation

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 368 of file pdfiprocessor.cxx.

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 353 of file pdfiprocessor.cxx.

void pdfi::PDFIProcessor::drawGlyphs ( const OUString &  rGlyphs,
const css::geometry::RealRectangle2D &  rRect,
const css::geometry::Matrix2D &  rFontMatrix,
double  fontSize 
)
overrideprivatevirtual
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 348 of file pdfiprocessor.cxx.

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 341 of file pdfiprocessor.cxx.

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 360 of file pdfiprocessor.cxx.

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

Definition at line 612 of file pdfiprocessor.cxx.

void pdfi::PDFIProcessor::endPage ( )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 492 of file pdfiprocessor.cxx.

void pdfi::PDFIProcessor::endText ( )
overrideprivatevirtual

issued when a sequence of associated glyphs is drawn

Implements pdfi::ContentSink.

Definition at line 309 of file pdfiprocessor.cxx.

References pdfi::Element::Parent.

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

Definition at line 75 of file pdfiprocessor.hxx.

References m_aGCStack.

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

Definition at line 170 of file pdfiprocessor.cxx.

References getCurrentContext().

Referenced by pdfi::PageElement::resolveUnderlines().

sal_Int32 pdfi::PDFIProcessor::getGCId ( const GraphicsContext rGC)
const GraphicsContext & pdfi::PDFIProcessor::getGraphicsContext ( sal_Int32  nGCId) const
const css::uno::Reference< css::task::XStatusIndicator >& pdfi::PDFIProcessor::getStatusIndicator ( ) const
inline
void pdfi::PDFIProcessor::hyperLink ( const css::geometry::RealRectangle2D &  rBounds,
const OUString &  rURI 
)
overrideprivatevirtual
void pdfi::PDFIProcessor::intersectClip ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual
void pdfi::PDFIProcessor::intersectEoClip ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  rPath)
overrideprivatevirtual
OUString pdfi::PDFIProcessor::mirrorString ( const OUString &  i_rInString)
static

Definition at line 689 of file pdfiprocessor.cxx.

References GetMirroredChar(), and i.

Referenced by pdfi::DrawXmlEmitter::visit().

void pdfi::PDFIProcessor::popState ( )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 88 of file pdfiprocessor.cxx.

References m_aGCStack.

void pdfi::PDFIProcessor::processGlyphLine ( )
private
void pdfi::PDFIProcessor::pushState ( )
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 82 of file pdfiprocessor.cxx.

References a, and m_aGCStack.

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

Implements pdfi::ContentSink.

Definition at line 133 of file pdfiprocessor.cxx.

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

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

Implements pdfi::ContentSink.

Definition at line 93 of file pdfiprocessor.cxx.

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

void pdfi::PDFIProcessor::setFont ( const FontAttributes rFont)
overrideprivatevirtual
void pdfi::PDFIProcessor::setLineCap ( sal_Int8  nCap)
overrideprivatevirtual

Implements pdfi::ContentSink.

Definition at line 118 of file pdfiprocessor.cxx.

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

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

Implements pdfi::ContentSink.

Definition at line 113 of file pdfiprocessor.cxx.

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

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

Implements pdfi::ContentSink.

Definition at line 128 of file pdfiprocessor.cxx.

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

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

Implements pdfi::ContentSink.

Definition at line 123 of file pdfiprocessor.cxx.

References SAL_WARN.

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

Total number of pages for upcoming document.

Implements pdfi::ContentSink.

Definition at line 76 of file pdfiprocessor.cxx.

References m_nPages.

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

Implements pdfi::ContentSink.

Definition at line 138 of file pdfiprocessor.cxx.

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

void pdfi::PDFIProcessor::setTextRenderMode ( sal_Int32  i_nMode)
overrideprivatevirtual
void pdfi::PDFIProcessor::setTransformation ( const css::geometry::AffineMatrix2D &  rMatrix)
overrideprivatevirtual
void pdfi::PDFIProcessor::setupImage ( ImageId  nImage)
private
void pdfi::PDFIProcessor::sortElements ( Element pElement)
static
void pdfi::PDFIProcessor::startIndicator ( const OUString &  rText)
private

Definition at line 587 of file pdfiprocessor.cxx.

References aStr, i, nElements, and nLength.

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

Member Data Documentation

FontToIdMap pdfi::PDFIProcessor::m_aFontToId
private

Definition at line 177 of file pdfiprocessor.hxx.

Referenced by PDFIProcessor(), and setFont().

GraphicsContextStack pdfi::PDFIProcessor::m_aGCStack
private

Definition at line 179 of file pdfiprocessor.hxx.

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

GCToIdBiMap pdfi::PDFIProcessor::m_aGCToId
private

Definition at line 181 of file pdfiprocessor.hxx.

Referenced by PDFIProcessor().

IdToFontMap pdfi::PDFIProcessor::m_aIdToFont
private

Definition at line 176 of file pdfiprocessor.hxx.

Referenced by PDFIProcessor(), and setFont().

ImageContainer pdfi::PDFIProcessor::m_aImages
private

Definition at line 183 of file pdfiprocessor.hxx.

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

Definition at line 170 of file pdfiprocessor.hxx.

sal_Int32 pdfi::PDFIProcessor::m_nNextFontId
private

Definition at line 175 of file pdfiprocessor.hxx.

Referenced by setFont().

sal_Int32 pdfi::PDFIProcessor::m_nNextGCId
private

Definition at line 180 of file pdfiprocessor.hxx.

sal_Int32 pdfi::PDFIProcessor::m_nNextZOrder
private

Definition at line 186 of file pdfiprocessor.hxx.

sal_Int32 pdfi::PDFIProcessor::m_nPages
private

Definition at line 185 of file pdfiprocessor.hxx.

Referenced by setPageNum().

Element* pdfi::PDFIProcessor::m_pCurElement
private

Definition at line 174 of file pdfiprocessor.hxx.

PageElement* pdfi::PDFIProcessor::m_pCurPage
private

Definition at line 173 of file pdfiprocessor.hxx.

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

Definition at line 172 of file pdfiprocessor.hxx.

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

Definition at line 62 of file pdfiprocessor.hxx.

Referenced by pdfi::DrawXmlOptimizer::GetBreakIterator().

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

Definition at line 188 of file pdfiprocessor.hxx.

Referenced by getStatusIndicator().

double pdfi::PDFIProcessor::prevCharWidth

Definition at line 64 of file pdfiprocessor.hxx.

basegfx::B2DHomMatrix pdfi::PDFIProcessor::prevTextMatrix

Definition at line 63 of file pdfiprocessor.hxx.


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