Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <pdfwriter_impl.hxx>
31 : : #include <vcl/bitmapex.hxx>
32 : : #include <vcl/image.hxx>
33 : :
34 : : using namespace vcl;
35 : :
36 [ # # ]: 0 : PDFWriter::AnyWidget::~AnyWidget()
37 : : {
38 [ # # ]: 0 : }
39 : :
40 : 0 : PDFWriter::PDFWriter( const PDFWriter::PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& xEnc )
41 : : :
42 [ # # ]: 0 : pImplementation( new PDFWriterImpl( rContext, xEnc, *this ) )
43 : : {
44 : 0 : }
45 : :
46 : 0 : PDFWriter::~PDFWriter()
47 : : {
48 : 0 : }
49 : :
50 : 0 : OutputDevice* PDFWriter::GetReferenceDevice()
51 : : {
52 : 0 : return pImplementation->getReferenceDevice();
53 : : }
54 : :
55 : 0 : sal_Int32 PDFWriter::NewPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, Orientation eOrientation )
56 : : {
57 : 0 : return pImplementation->newPage( nPageWidth, nPageHeight, eOrientation );
58 : : }
59 : :
60 : 0 : bool PDFWriter::Emit()
61 : : {
62 : 0 : return pImplementation->emit();
63 : : }
64 : :
65 : 0 : void PDFWriter::SetDocumentLocale( const com::sun::star::lang::Locale& rLoc )
66 : : {
67 : 0 : pImplementation->setDocumentLocale( rLoc );
68 : 0 : }
69 : :
70 : 0 : void PDFWriter::SetFont( const Font& rFont )
71 : : {
72 : 0 : pImplementation->setFont( rFont );
73 : 0 : }
74 : :
75 : 0 : void PDFWriter::DrawText( const Point& rPos, const String& rText )
76 : : {
77 : 0 : pImplementation->drawText( rPos, rText );
78 : 0 : }
79 : :
80 : 0 : void PDFWriter::DrawTextLine(
81 : : const Point& rPos,
82 : : long nWidth,
83 : : FontStrikeout eStrikeout,
84 : : FontUnderline eUnderline,
85 : : FontUnderline eOverline,
86 : : sal_Bool bUnderlineAbove )
87 : : {
88 : 0 : pImplementation->drawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
89 : 0 : }
90 : :
91 : 0 : void PDFWriter::DrawTextArray(
92 : : const Point& rStartPt,
93 : : const XubString& rStr,
94 : : const sal_Int32* pDXAry,
95 : : xub_StrLen nIndex,
96 : : xub_StrLen nLen )
97 : : {
98 : 0 : pImplementation->drawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
99 : 0 : }
100 : :
101 : 0 : void PDFWriter::DrawStretchText(
102 : : const Point& rStartPt,
103 : : sal_uLong nWidth,
104 : : const XubString& rStr,
105 : : xub_StrLen nIndex,
106 : : xub_StrLen nLen )
107 : : {
108 : 0 : pImplementation->drawStretchText( rStartPt, nWidth, rStr, nIndex, nLen );
109 : 0 : }
110 : :
111 : 0 : void PDFWriter::DrawText(
112 : : const Rectangle& rRect,
113 : : const XubString& rStr,
114 : : sal_uInt16 nStyle )
115 : : {
116 : 0 : pImplementation->drawText( rRect, rStr, nStyle );
117 : 0 : }
118 : :
119 : 0 : void PDFWriter::DrawLine( const Point& rStart, const Point& rStop )
120 : : {
121 : 0 : pImplementation->drawLine( rStart, rStop );
122 : 0 : }
123 : :
124 : 0 : void PDFWriter::DrawLine( const Point& rStart, const Point& rStop, const LineInfo& rInfo )
125 : : {
126 : 0 : pImplementation->drawLine( rStart, rStop, rInfo );
127 : 0 : }
128 : :
129 : 0 : void PDFWriter::DrawPolygon( const Polygon& rPoly )
130 : : {
131 : 0 : pImplementation->drawPolygon( rPoly );
132 : 0 : }
133 : :
134 : 0 : void PDFWriter::DrawPolyLine( const Polygon& rPoly )
135 : : {
136 : 0 : pImplementation->drawPolyLine( rPoly );
137 : 0 : }
138 : :
139 : 0 : void PDFWriter::DrawRect( const Rectangle& rRect )
140 : : {
141 : 0 : pImplementation->drawRectangle( rRect );
142 : 0 : }
143 : :
144 : 0 : void PDFWriter::DrawRect( const Rectangle& rRect, sal_uLong nHorzRound, sal_uLong nVertRound )
145 : : {
146 : 0 : pImplementation->drawRectangle( rRect, nHorzRound, nVertRound );
147 : 0 : }
148 : :
149 : 0 : void PDFWriter::DrawEllipse( const Rectangle& rRect )
150 : : {
151 : 0 : pImplementation->drawEllipse( rRect );
152 : 0 : }
153 : :
154 : 0 : void PDFWriter::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rStop )
155 : : {
156 : 0 : pImplementation->drawArc( rRect, rStart, rStop, false, false );
157 : 0 : }
158 : :
159 : 0 : void PDFWriter::DrawPie( const Rectangle& rRect, const Point& rStart, const Point& rStop )
160 : : {
161 : 0 : pImplementation->drawArc( rRect, rStart, rStop, true, false );
162 : 0 : }
163 : :
164 : 0 : void PDFWriter::DrawChord( const Rectangle& rRect, const Point& rStart, const Point& rStop )
165 : : {
166 : 0 : pImplementation->drawArc( rRect, rStart, rStop, false, true );
167 : 0 : }
168 : :
169 : 0 : void PDFWriter::DrawPolyLine( const Polygon& rPoly, const LineInfo& rInfo )
170 : : {
171 : 0 : pImplementation->drawPolyLine( rPoly, rInfo );
172 : 0 : }
173 : :
174 : 0 : void PDFWriter::DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo )
175 : : {
176 : 0 : pImplementation->drawPolyLine( rPoly, rInfo );
177 : 0 : }
178 : :
179 : 0 : void PDFWriter::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
180 : : {
181 : 0 : pImplementation->drawPolyPolygon( rPolyPoly );
182 : 0 : }
183 : :
184 : 0 : void PDFWriter::DrawPixel( const Point& rPos, const Color& rColor )
185 : : {
186 : 0 : pImplementation->drawPixel( rPos, rColor );
187 : 0 : }
188 : :
189 : 0 : void PDFWriter::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap )
190 : : {
191 : 0 : pImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
192 : 0 : }
193 : :
194 : 0 : void PDFWriter::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmap )
195 : : {
196 : 0 : pImplementation->drawBitmap( rDestPt, rDestSize, rBitmap );
197 : 0 : }
198 : :
199 : 0 : void PDFWriter::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch )
200 : : {
201 : 0 : pImplementation->drawHatch( rPolyPoly, rHatch );
202 : 0 : }
203 : :
204 : 0 : void PDFWriter::DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper )
205 : : {
206 : 0 : pImplementation->drawWallpaper( rRect, rWallpaper );
207 : 0 : }
208 : :
209 : 0 : void PDFWriter::DrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent )
210 : : {
211 : 0 : pImplementation->drawTransparent( rPolyPoly, nTransparencePercent );
212 : 0 : }
213 : :
214 : 0 : void PDFWriter::BeginTransparencyGroup()
215 : : {
216 : 0 : pImplementation->beginTransparencyGroup();
217 : 0 : }
218 : :
219 : 0 : void PDFWriter::EndTransparencyGroup( const Rectangle& rRect, sal_uInt16 nTransparentPercent )
220 : : {
221 : 0 : pImplementation->endTransparencyGroup( rRect, nTransparentPercent );
222 : 0 : }
223 : :
224 : 0 : void PDFWriter::Push( sal_uInt16 nFlags )
225 : : {
226 : 0 : pImplementation->push( nFlags );
227 : 0 : }
228 : :
229 : 0 : void PDFWriter::Pop()
230 : : {
231 : 0 : pImplementation->pop();
232 : 0 : }
233 : :
234 : 0 : void PDFWriter::SetMapMode( const MapMode& rMapMode )
235 : : {
236 : 0 : pImplementation->setMapMode( rMapMode );
237 : 0 : }
238 : :
239 : 0 : void PDFWriter::SetLineColor( const Color& rColor )
240 : : {
241 : 0 : pImplementation->setLineColor( rColor );
242 : 0 : }
243 : :
244 : 0 : void PDFWriter::SetFillColor( const Color& rColor )
245 : : {
246 : 0 : pImplementation->setFillColor( rColor );
247 : 0 : }
248 : :
249 : 0 : void PDFWriter::SetClipRegion()
250 : : {
251 : 0 : pImplementation->clearClipRegion();
252 : 0 : }
253 : :
254 : 0 : void PDFWriter::SetClipRegion( const basegfx::B2DPolyPolygon& rRegion )
255 : : {
256 : 0 : pImplementation->setClipRegion( rRegion );
257 : 0 : }
258 : :
259 : 0 : void PDFWriter::MoveClipRegion( long nHorzMove, long nVertMove )
260 : : {
261 : 0 : pImplementation->moveClipRegion( nHorzMove, nVertMove );
262 : 0 : }
263 : :
264 : 0 : void PDFWriter::IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion )
265 : : {
266 : 0 : pImplementation->intersectClipRegion( rRegion );
267 : 0 : }
268 : :
269 : 0 : void PDFWriter::IntersectClipRegion( const Rectangle& rRect )
270 : : {
271 : 0 : pImplementation->intersectClipRegion( rRect );
272 : 0 : }
273 : :
274 : 0 : void PDFWriter::SetLayoutMode( sal_uLong nMode )
275 : : {
276 : 0 : pImplementation->setLayoutMode( (sal_Int32)nMode );
277 : 0 : }
278 : :
279 : 0 : void PDFWriter::SetDigitLanguage( LanguageType eLang )
280 : : {
281 : 0 : pImplementation->setDigitLanguage( eLang );
282 : 0 : }
283 : :
284 : 0 : void PDFWriter::SetTextColor( const Color& rColor )
285 : : {
286 : 0 : pImplementation->setTextColor( rColor );
287 : 0 : }
288 : :
289 : 0 : void PDFWriter::SetTextFillColor()
290 : : {
291 : 0 : pImplementation->setTextFillColor();
292 : 0 : }
293 : :
294 : 0 : void PDFWriter::SetTextFillColor( const Color& rColor )
295 : : {
296 : 0 : pImplementation->setTextFillColor( rColor );
297 : 0 : }
298 : :
299 : 0 : void PDFWriter::SetTextLineColor()
300 : : {
301 : 0 : pImplementation->setTextLineColor();
302 : 0 : }
303 : :
304 : 0 : void PDFWriter::SetTextLineColor( const Color& rColor )
305 : : {
306 : 0 : pImplementation->setTextLineColor( rColor );
307 : 0 : }
308 : :
309 : 0 : void PDFWriter::SetOverlineColor()
310 : : {
311 : 0 : pImplementation->setOverlineColor();
312 : 0 : }
313 : :
314 : 0 : void PDFWriter::SetOverlineColor( const Color& rColor )
315 : : {
316 : 0 : pImplementation->setOverlineColor( rColor );
317 : 0 : }
318 : :
319 : 0 : void PDFWriter::SetTextAlign( ::TextAlign eAlign )
320 : : {
321 : 0 : pImplementation->setTextAlign( eAlign );
322 : 0 : }
323 : :
324 : 0 : void PDFWriter::DrawJPGBitmap( SvStream& rStreamData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask )
325 : : {
326 : 0 : pImplementation->drawJPGBitmap( rStreamData, bIsTrueColor, rSrcSizePixel, rTargetArea, rMask );
327 : 0 : }
328 : :
329 : 0 : sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr )
330 : : {
331 : 0 : return pImplementation->createLink( rRect, nPageNr );
332 : : }
333 : 0 : sal_Int32 PDFWriter::RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType )
334 : : {
335 : 0 : return pImplementation->registerDestReference( nDestId, rRect, nPageNr, eType );
336 : : }
337 : : //--->i56629
338 : 0 : sal_Int32 PDFWriter::CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
339 : : {
340 : 0 : return pImplementation->createNamedDest( sDestName, rRect, nPageNr, eType );
341 : : }
342 : 0 : sal_Int32 PDFWriter::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
343 : : {
344 : 0 : return pImplementation->createDest( rRect, nPageNr, eType );
345 : : }
346 : :
347 : 0 : sal_Int32 PDFWriter::SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId )
348 : : {
349 : 0 : return pImplementation->setLinkDest( nLinkId, nDestId );
350 : : }
351 : :
352 : 0 : sal_Int32 PDFWriter::SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL )
353 : : {
354 : 0 : return pImplementation->setLinkURL( nLinkId, rURL );
355 : : }
356 : :
357 : 0 : void PDFWriter::SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyId )
358 : : {
359 : 0 : pImplementation->setLinkPropertyId( nLinkId, nPropertyId );
360 : 0 : }
361 : :
362 : 0 : sal_Int32 PDFWriter::CreateOutlineItem( sal_Int32 nParent, const rtl::OUString& rText, sal_Int32 nDestID )
363 : : {
364 : 0 : return pImplementation->createOutlineItem( nParent, rText, nDestID );
365 : : }
366 : :
367 : 0 : sal_Int32 PDFWriter::SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent )
368 : : {
369 : 0 : return pImplementation->setOutlineItemParent( nItem, nNewParent );
370 : : }
371 : :
372 : 0 : sal_Int32 PDFWriter::SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText )
373 : : {
374 : 0 : return pImplementation->setOutlineItemText( nItem, rText );
375 : : }
376 : :
377 : 0 : sal_Int32 PDFWriter::SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDest )
378 : : {
379 : 0 : return pImplementation->setOutlineItemDest( nItem, nDest );
380 : : }
381 : :
382 : 0 : void PDFWriter::CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr )
383 : : {
384 : 0 : pImplementation->createNote( rRect, rNote, nPageNr );
385 : 0 : }
386 : :
387 : 0 : sal_Int32 PDFWriter::BeginStructureElement( PDFWriter::StructElement eType, const rtl::OUString& rAlias )
388 : : {
389 : 0 : return pImplementation->beginStructureElement( eType, rAlias );
390 : : }
391 : :
392 : 0 : void PDFWriter::EndStructureElement()
393 : : {
394 : 0 : pImplementation->endStructureElement();
395 : 0 : }
396 : :
397 : 0 : bool PDFWriter::SetCurrentStructureElement( sal_Int32 nID )
398 : : {
399 : 0 : return pImplementation->setCurrentStructureElement( nID );
400 : : }
401 : :
402 : 0 : bool PDFWriter::SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal )
403 : : {
404 : 0 : return pImplementation->setStructureAttribute( eAttr, eVal );
405 : : }
406 : :
407 : 0 : bool PDFWriter::SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue )
408 : : {
409 : 0 : return pImplementation->setStructureAttributeNumerical( eAttr, nValue );
410 : : }
411 : :
412 : 0 : void PDFWriter::SetStructureBoundingBox( const Rectangle& rRect )
413 : : {
414 : 0 : pImplementation->setStructureBoundingBox( rRect );
415 : 0 : }
416 : :
417 : 0 : void PDFWriter::SetActualText( const String& rText )
418 : : {
419 : 0 : pImplementation->setActualText( rText );
420 : 0 : }
421 : :
422 : 0 : void PDFWriter::SetAlternateText( const String& rText )
423 : : {
424 : 0 : pImplementation->setAlternateText( rText );
425 : 0 : }
426 : :
427 : 0 : void PDFWriter::SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr )
428 : : {
429 : 0 : pImplementation->setAutoAdvanceTime( nSeconds, nPageNr );
430 : 0 : }
431 : :
432 : 0 : void PDFWriter::SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr )
433 : : {
434 : 0 : pImplementation->setPageTransition( eType, nMilliSec, nPageNr );
435 : 0 : }
436 : :
437 : 0 : sal_Int32 PDFWriter::CreateControl( const PDFWriter::AnyWidget& rControl, sal_Int32 nPageNr )
438 : : {
439 : 0 : return pImplementation->createControl( rControl, nPageNr );
440 : : }
441 : :
442 : 0 : PDFOutputStream::~PDFOutputStream()
443 : : {
444 [ # # ]: 0 : }
445 : :
446 : 0 : void PDFWriter::AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress )
447 : : {
448 : 0 : pImplementation->addStream( rMimeType, pStream, bCompress );
449 : 0 : }
450 : :
451 : 0 : std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
452 : : {
453 : 0 : return pImplementation->getErrors();
454 : : }
455 : :
456 : : com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
457 : 0 : PDFWriter::InitEncryption( const rtl::OUString& i_rOwnerPassword,
458 : : const rtl::OUString& i_rUserPassword,
459 : : bool b128Bit
460 : : )
461 : : {
462 : 0 : return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
463 : : }
464 : :
465 : 0 : void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
466 : : {
467 : 0 : pImplementation->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
468 : 0 : }
469 : :
470 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|