update emoji autocorrect entries from po-files
[LibreOffice.git] / vcl / source / gdi / pdfwriter.cxx
blob85fae2d4b181a370f4e5e46d90a48557467c2f8c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <pdfwriter_impl.hxx>
21 #include <vcl/bitmapex.hxx>
22 #include <vcl/image.hxx>
24 using namespace vcl;
26 PDFWriter::AnyWidget::~AnyWidget()
30 PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
32 xImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
36 PDFWriter::~PDFWriter()
40 OutputDevice* PDFWriter::GetReferenceDevice()
42 return xImplementation->getReferenceDevice();
45 sal_Int32 PDFWriter::NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation )
47 return xImplementation->newPage( nPageWidth, nPageHeight, eOrientation );
50 bool PDFWriter::Emit()
52 return xImplementation->emit();
55 void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
57 xImplementation->setDocumentLocale( rLoc );
60 void PDFWriter::SetFont( const vcl::Font& rFont )
62 xImplementation->setFont( rFont );
65 void PDFWriter::DrawText( const Point& rPos, const OUString& rText )
67 xImplementation->drawText( rPos, rText, 0, rText.getLength() );
70 void PDFWriter::DrawTextLine(
71 const Point& rPos,
72 long nWidth,
73 FontStrikeout eStrikeout,
74 FontUnderline eUnderline,
75 FontUnderline eOverline,
76 bool bUnderlineAbove )
78 xImplementation->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
81 void PDFWriter::DrawTextArray(
82 const Point& rStartPt,
83 const OUString& rStr,
84 const long* pDXAry,
85 sal_Int32 nIndex,
86 sal_Int32 nLen )
88 xImplementation->drawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
91 void PDFWriter::DrawStretchText(
92 const Point& rStartPt,
93 sal_uLong nWidth,
94 const OUString& rStr,
95 sal_Int32 nIndex,
96 sal_Int32 nLen )
98 xImplementation->drawStretchText( rStartPt, nWidth, rStr, nIndex, nLen );
101 void PDFWriter::DrawText(
102 const Rectangle& rRect,
103 const OUString& rStr,
104 DrawTextFlags nStyle )
106 xImplementation->drawText( rRect, rStr, nStyle );
109 void PDFWriter::DrawLine( const Point& rStart, const Point& rStop )
111 xImplementation->drawLine( rStart, rStop );
114 void PDFWriter::DrawLine( const Point& rStart, const Point& rStop, const LineInfo& rInfo )
116 xImplementation->drawLine( rStart, rStop, rInfo );
119 void PDFWriter::DrawPolygon( const Polygon& rPoly )
121 xImplementation->drawPolygon( rPoly );
124 void PDFWriter::DrawPolyLine( const Polygon& rPoly )
126 xImplementation->drawPolyLine( rPoly );
129 void PDFWriter::DrawRect( const Rectangle& rRect )
131 xImplementation->drawRectangle( rRect );
134 void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
136 xImplementation->drawRectangle( rRect, nHorzRound, nVertRound );
139 void PDFWriter::DrawEllipse( const Rectangle& rRect )
141 xImplementation->drawEllipse( rRect );
144 void PDFWriter::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rStop )
146 xImplementation->drawArc( rRect, rStart, rStop, false, false );
149 void PDFWriter::DrawPie( const Rectangle& rRect, const Point& rStart, const Point& rStop )
151 xImplementation->drawArc( rRect, rStart, rStop, true, false );
154 void PDFWriter::DrawChord( const Rectangle& rRect, const Point& rStart, const Point& rStop )
156 xImplementation->drawArc( rRect, rStart, rStop, false, true );
159 void PDFWriter::DrawPolyLine( const Polygon& rPoly, const LineInfo& rInfo )
161 xImplementation->drawPolyLine( rPoly, rInfo );
164 void PDFWriter::DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo )
166 xImplementation->drawPolyLine( rPoly, rInfo );
169 void PDFWriter::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly )
171 xImplementation->drawPolyPolygon( rPolyPoly );
174 void PDFWriter::DrawPixel( const Point& rPos, const Color& rColor )
176 xImplementation->drawPixel( rPos, rColor );
179 void PDFWriter::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap )
181 xImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
184 void PDFWriter::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmap )
186 xImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
189 void PDFWriter::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch )
191 xImplementation->drawHatch( rPolyPoly, rHatch );
194 void PDFWriter::DrawGradient( const Rectangle& rRect, const Gradient& rGradient )
196 xImplementation->drawGradient( rRect, rGradient );
199 void PDFWriter::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient )
201 xImplementation->push(PushFlags::CLIPREGION);
202 xImplementation->setClipRegion( rPolyPoly.getB2DPolyPolygon() );
203 xImplementation->drawGradient( rPolyPoly.GetBoundRect(), rGradient );
204 xImplementation->pop();
207 void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper )
209 xImplementation->drawWallpaper( rRect, rWallpaper );
212 void PDFWriter::DrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
214 xImplementation->drawTransparent( rPolyPoly, nTransparencePercent );
217 void PDFWriter::BeginTransparencyGroup()
219 xImplementation->beginTransparencyGroup();
222 void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
224 xImplementation->endTransparencyGroup( rRect, nTransparentPercent );
227 void PDFWriter::Push( PushFlags nFlags )
229 xImplementation->push( nFlags );
232 void PDFWriter::Pop()
234 xImplementation->pop();
237 void PDFWriter::SetMapMode( const MapMode& rMapMode )
239 xImplementation->setMapMode( rMapMode );
242 void PDFWriter::SetLineColor( const Color& rColor )
244 xImplementation->setLineColor( rColor );
247 void PDFWriter::SetFillColor( const Color& rColor )
249 xImplementation->setFillColor( rColor );
252 void PDFWriter::SetClipRegion()
254 xImplementation->clearClipRegion();
257 void PDFWriter::SetClipRegion( const basegfx::B2DPolyPolygon& rRegion )
259 xImplementation->setClipRegion( rRegion );
262 void PDFWriter::MoveClipRegion( long nHorzMove, long nVertMove )
264 xImplementation->moveClipRegion( nHorzMove, nVertMove );
267 void PDFWriter::IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion )
269 xImplementation->intersectClipRegion( rRegion );
272 void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
274 xImplementation->intersectClipRegion( rRect );
277 void PDFWriter::SetLayoutMode( ComplexTextLayoutMode nMode )
279 xImplementation->setLayoutMode( nMode );
282 void PDFWriter::SetDigitLanguage( LanguageType eLang )
284 xImplementation->setDigitLanguage( eLang );
287 void PDFWriter::SetTextColor( const Color& rColor )
289 xImplementation->setTextColor( rColor );
292 void PDFWriter::SetTextFillColor()
294 xImplementation->setTextFillColor();
297 void PDFWriter::SetTextFillColor( const Color& rColor )
299 xImplementation->setTextFillColor( rColor );
302 void PDFWriter::SetTextLineColor()
304 xImplementation->setTextLineColor();
307 void PDFWriter::SetTextLineColor( const Color& rColor )
309 xImplementation->setTextLineColor( rColor );
312 void PDFWriter::SetOverlineColor()
314 xImplementation->setOverlineColor();
317 void PDFWriter::SetOverlineColor( const Color& rColor )
319 xImplementation->setOverlineColor( rColor );
322 void PDFWriter::SetTextAlign( ::TextAlign eAlign )
324 xImplementation->setTextAlign( eAlign );
327 void PDFWriter::DrawJPGBitmap( SvStream& rStreamData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask )
329 xImplementation->drawJPGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask );
332 sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr )
334 return xImplementation->createLink( rRect, nPageNr );
336 sal_Int32 PDFWriter::RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType )
338 return xImplementation->registerDestReference( nDestId, rRect, nPageNr, eType );
340 //--->i56629
341 sal_Int32 PDFWriter::CreateNamedDest( const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
343 return xImplementation->createNamedDest( sDestName, rRect, nPageNr, eType );
345 sal_Int32 PDFWriter::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
347 return xImplementation->createDest( rRect, nPageNr, eType );
350 sal_Int32 PDFWriter::SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId )
352 return xImplementation->setLinkDest( nLinkId, nDestId );
355 sal_Int32 PDFWriter::SetLinkURL( sal_Int32 nLinkId, const OUString& rURL )
357 return xImplementation->setLinkURL( nLinkId, rURL );
360 void PDFWriter::SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyId )
362 xImplementation->setLinkPropertyId( nLinkId, nPropertyId );
365 sal_Int32 PDFWriter::CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID )
367 return xImplementation->createOutlineItem( nParent, rText, nDestID );
370 sal_Int32 PDFWriter::SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent )
372 return xImplementation->setOutlineItemParent( nItem, nNewParent );
375 sal_Int32 PDFWriter::SetOutlineItemText( sal_Int32 nItem, const OUString& rText )
377 return xImplementation->setOutlineItemText( nItem, rText );
380 sal_Int32 PDFWriter::SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDest )
382 return xImplementation->setOutlineItemDest( nItem, nDest );
385 void PDFWriter::CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr )
387 xImplementation->createNote( rRect, rNote, nPageNr );
390 sal_Int32 PDFWriter::BeginStructureElement( PDFWriter::StructElement eType, const OUString& rAlias )
392 return xImplementation->beginStructureElement( eType, rAlias );
395 void PDFWriter::EndStructureElement()
397 xImplementation->endStructureElement();
400 bool PDFWriter::SetCurrentStructureElement( sal_Int32 nID )
402 return xImplementation->setCurrentStructureElement( nID );
405 bool PDFWriter::SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal )
407 return xImplementation->setStructureAttribute( eAttr, eVal );
410 bool PDFWriter::SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue )
412 return xImplementation->setStructureAttributeNumerical( eAttr, nValue );
415 void PDFWriter::SetStructureBoundingBox( const Rectangle& rRect )
417 xImplementation->setStructureBoundingBox( rRect );
420 void PDFWriter::SetActualText( const OUString& rText )
422 xImplementation->setActualText( rText );
425 void PDFWriter::SetAlternateText( const OUString& rText )
427 xImplementation->setAlternateText( rText );
430 void PDFWriter::SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr )
432 xImplementation->setAutoAdvanceTime( nSeconds, nPageNr );
435 void PDFWriter::SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr )
437 xImplementation->setPageTransition( eType, nMilliSec, nPageNr );
440 sal_Int32 PDFWriter::CreateControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr )
442 return xImplementation->createControl( rControl, nPageNr );
445 PDFOutputStream::~PDFOutputStream()
449 void PDFWriter::AddStream( const OUString& rMimeType, PDFOutputStream* pStream, bool bCompress )
451 xImplementation->addStream( rMimeType, pStream, bCompress );
454 std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
456 return xImplementation->getErrors();
459 com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
460 PDFWriter::InitEncryption( const OUString& i_rOwnerPassword,
461 const OUString& i_rUserPassword,
462 bool b128Bit
465 return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
468 void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
470 xImplementation->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
473 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */