1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SV_METAACT_HXX 29 #define _SV_METAACT_HXX 30 31 #include <vcl/dllapi.h> 32 #include <vcl/gradient.hxx> 33 #include <vcl/hatch.hxx> 34 #include <vcl/wall.hxx> 35 #include <vcl/font.hxx> 36 #include <tools/poly.hxx> 37 #include <vcl/bitmap.hxx> 38 #include <vcl/bitmapex.hxx> 39 #include <vcl/region.hxx> 40 #include <vcl/graph.hxx> 41 #include <vcl/outdev.hxx> 42 #include <vcl/gdimtf.hxx> 43 #include <vcl/gfxlink.hxx> 44 #include <vcl/lineinfo.hxx> 45 #include <vcl/rendergraphic.hxx> 46 47 class SvStream; 48 49 // ----------- 50 // - Defines - 51 // ----------- 52 53 #define META_NULL_ACTION (0) 54 #define META_PIXEL_ACTION (100) 55 #define META_POINT_ACTION (101) 56 #define META_LINE_ACTION (102) 57 #define META_RECT_ACTION (103) 58 #define META_ROUNDRECT_ACTION (104) 59 #define META_ELLIPSE_ACTION (105) 60 #define META_ARC_ACTION (106) 61 #define META_PIE_ACTION (107) 62 #define META_CHORD_ACTION (108) 63 #define META_POLYLINE_ACTION (109) 64 #define META_POLYGON_ACTION (110) 65 #define META_POLYPOLYGON_ACTION (111) 66 #define META_TEXT_ACTION (112) 67 #define META_TEXTARRAY_ACTION (113) 68 #define META_STRETCHTEXT_ACTION (114) 69 #define META_TEXTRECT_ACTION (115) 70 #define META_BMP_ACTION (116) 71 #define META_BMPSCALE_ACTION (117) 72 #define META_BMPSCALEPART_ACTION (118) 73 #define META_BMPEX_ACTION (119) 74 #define META_BMPEXSCALE_ACTION (120) 75 #define META_BMPEXSCALEPART_ACTION (121) 76 #define META_MASK_ACTION (122) 77 #define META_MASKSCALE_ACTION (123) 78 #define META_MASKSCALEPART_ACTION (124) 79 #define META_GRADIENT_ACTION (125) 80 #define META_HATCH_ACTION (126) 81 #define META_WALLPAPER_ACTION (127) 82 #define META_CLIPREGION_ACTION (128) 83 #define META_ISECTRECTCLIPREGION_ACTION (129) 84 #define META_ISECTREGIONCLIPREGION_ACTION (130) 85 #define META_MOVECLIPREGION_ACTION (131) 86 #define META_LINECOLOR_ACTION (132) 87 #define META_FILLCOLOR_ACTION (133) 88 #define META_TEXTCOLOR_ACTION (134) 89 #define META_TEXTFILLCOLOR_ACTION (135) 90 #define META_TEXTALIGN_ACTION (136) 91 #define META_MAPMODE_ACTION (137) 92 #define META_FONT_ACTION (138) 93 #define META_PUSH_ACTION (139) 94 #define META_POP_ACTION (140) 95 #define META_RASTEROP_ACTION (141) 96 #define META_TRANSPARENT_ACTION (142) 97 #define META_EPS_ACTION (143) 98 #define META_REFPOINT_ACTION (144) 99 #define META_TEXTLINECOLOR_ACTION (145) 100 #define META_TEXTLINE_ACTION (146) 101 #define META_FLOATTRANSPARENT_ACTION (147) 102 #define META_GRADIENTEX_ACTION (148) 103 #define META_LAYOUTMODE_ACTION (149) 104 #define META_TEXTLANGUAGE_ACTION (150) 105 #define META_OVERLINECOLOR_ACTION (151) 106 #define META_RENDERGRAPHIC_ACTION (152) 107 108 #define META_COMMENT_ACTION (512) 109 110 // ------------------------------------------------------------------------ 111 112 struct ImplMetaReadData 113 { 114 rtl_TextEncoding meActualCharSet; 115 116 ImplMetaReadData() : 117 meActualCharSet( RTL_TEXTENCODING_ASCII_US ) 118 { 119 } 120 }; 121 122 // ------------------------------------------------------------------------ 123 124 struct ImplMetaWriteData 125 { 126 rtl_TextEncoding meActualCharSet; 127 GDIMetaFileWriteFlags mnWriteFlags; 128 129 ImplMetaWriteData() : 130 meActualCharSet( RTL_TEXTENCODING_ASCII_US ), 131 mnWriteFlags( GDIMETAFILE_WRITE_DEFAULT ) 132 { 133 } 134 }; 135 136 // ------------------------------------------------------------------------ 137 138 #define DECL_META_ACTION( Name, nType ) \ 139 Meta##Name##Action(); \ 140 protected: \ 141 virtual ~Meta##Name##Action(); \ 142 public: \ 143 virtual void Execute( OutputDevice* pOut ); \ 144 virtual MetaAction* Clone(); \ 145 virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); \ 146 virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); 147 148 #define IMPL_META_ACTION( Name, nType ) \ 149 Meta##Name##Action::Meta##Name##Action() : \ 150 MetaAction( nType ) {} \ 151 Meta##Name##Action::~Meta##Name##Action() {} 152 153 // -------------- 154 // - MetaAction - 155 // -------------- 156 157 class VCL_DLLPUBLIC MetaAction 158 { 159 private: 160 sal_uLong mnRefCount; 161 sal_uInt16 mnType; 162 163 virtual sal_Bool Compare( const MetaAction& ) const; 164 165 protected: 166 virtual ~MetaAction(); 167 168 public: 169 MetaAction(); 170 MetaAction( sal_uInt16 nType ); 171 172 virtual void Execute( OutputDevice* pOut ); 173 174 virtual MetaAction* Clone(); 175 176 virtual void Move( long nHorzMove, long nVertMove ); 177 virtual void Scale( double fScaleX, double fScaleY ); 178 179 virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); 180 virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); 181 182 sal_Bool IsEqual( const MetaAction& ) const; 183 184 sal_uInt16 GetType() const { return mnType; } 185 sal_uLong GetRefCount() const { return mnRefCount; } 186 void ResetRefCount() { mnRefCount = 1; } 187 void Duplicate() { mnRefCount++; } 188 void Delete() { if ( 0 == --mnRefCount ) delete this; } 189 190 public: 191 static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData ); 192 }; 193 194 // ------------------- 195 // - MetaPixelAction - 196 // ------------------- 197 198 class VCL_DLLPUBLIC MetaPixelAction : public MetaAction 199 { 200 private: 201 Point maPt; 202 Color maColor; 203 204 virtual sal_Bool Compare( const MetaAction& ) const; 205 206 public: 207 DECL_META_ACTION( Pixel, META_PIXEL_ACTION ) 208 209 MetaPixelAction( const Point& rPt, const Color& rColor ); 210 211 virtual void Move( long nHorzMove, long nVertMove ); 212 virtual void Scale( double fScaleX, double fScaleY ); 213 214 const Point& GetPoint() const { return maPt; } 215 const Color& GetColor() const { return maColor; } 216 }; 217 218 // ------------------- 219 // - MetaPointAction - 220 // ------------------- 221 222 class VCL_DLLPUBLIC MetaPointAction : public MetaAction 223 { 224 private: 225 Point maPt; 226 227 virtual sal_Bool Compare( const MetaAction& ) const; 228 229 public: 230 DECL_META_ACTION( Point, META_POINT_ACTION ) 231 232 MetaPointAction( const Point& rPt ); 233 234 virtual void Move( long nHorzMove, long nVertMove ); 235 virtual void Scale( double fScaleX, double fScaleY ); 236 237 const Point& GetPoint() const { return maPt; } 238 }; 239 240 // ------------------ 241 // - MetaLineAction - 242 // ------------------ 243 244 class VCL_DLLPUBLIC MetaLineAction : public MetaAction 245 { 246 private: 247 248 LineInfo maLineInfo; 249 Point maStartPt; 250 Point maEndPt; 251 252 virtual sal_Bool Compare( const MetaAction& ) const; 253 254 public: 255 DECL_META_ACTION( Line, META_LINE_ACTION ) 256 257 MetaLineAction( const Point& rStart, const Point& rEnd ); 258 MetaLineAction( const Point& rStart, const Point& rEnd, 259 const LineInfo& rLineInfo ); 260 261 virtual void Move( long nHorzMove, long nVertMove ); 262 virtual void Scale( double fScaleX, double fScaleY ); 263 264 const Point& GetStartPoint() const { return maStartPt; } 265 const Point& GetEndPoint() const { return maEndPt; } 266 const LineInfo& GetLineInfo() const { return maLineInfo; } 267 }; 268 269 // ------------------ 270 // - MetaRectAction - 271 // ------------------ 272 273 class VCL_DLLPUBLIC MetaRectAction : public MetaAction 274 { 275 private: 276 277 Rectangle maRect; 278 279 virtual sal_Bool Compare( const MetaAction& ) const; 280 public: 281 DECL_META_ACTION( Rect, META_RECT_ACTION ) 282 283 MetaRectAction( const Rectangle& rRect ); 284 285 virtual void Move( long nHorzMove, long nVertMove ); 286 virtual void Scale( double fScaleX, double fScaleY ); 287 288 const Rectangle& GetRect() const { return maRect; } 289 }; 290 291 // ----------------------- 292 // - MetaRoundRectAction - 293 // ----------------------- 294 295 class VCL_DLLPUBLIC MetaRoundRectAction : public MetaAction 296 { 297 private: 298 299 Rectangle maRect; 300 sal_uInt32 mnHorzRound; 301 sal_uInt32 mnVertRound; 302 303 virtual sal_Bool Compare( const MetaAction& ) const; 304 305 public: 306 DECL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION ) 307 308 MetaRoundRectAction( const Rectangle& rRect, 309 sal_uInt32 nHorzRound, sal_uInt32 nVertRound ); 310 311 virtual void Move( long nHorzMove, long nVertMove ); 312 virtual void Scale( double fScaleX, double fScaleY ); 313 314 const Rectangle& GetRect() const { return maRect; } 315 sal_uInt32 GetHorzRound() const { return mnHorzRound; } 316 sal_uInt32 GetVertRound() const { return mnVertRound; } 317 }; 318 319 // --------------------- 320 // - MetaEllipseAction - 321 // --------------------- 322 323 class VCL_DLLPUBLIC MetaEllipseAction : public MetaAction 324 { 325 private: 326 327 Rectangle maRect; 328 329 virtual sal_Bool Compare( const MetaAction& ) const; 330 331 public: 332 DECL_META_ACTION( Ellipse, META_ELLIPSE_ACTION ) 333 334 MetaEllipseAction( const Rectangle& rRect ); 335 336 virtual void Move( long nHorzMove, long nVertMove ); 337 virtual void Scale( double fScaleX, double fScaleY ); 338 339 const Rectangle& GetRect() const { return maRect; } 340 }; 341 342 // ----------------- 343 // - MetaArcAction - 344 // ----------------- 345 346 class VCL_DLLPUBLIC MetaArcAction : public MetaAction 347 { 348 private: 349 350 Rectangle maRect; 351 Point maStartPt; 352 Point maEndPt; 353 354 virtual sal_Bool Compare( const MetaAction& ) const; 355 356 public: 357 DECL_META_ACTION( Arc, META_ARC_ACTION ) 358 359 MetaArcAction( const Rectangle& rRect, 360 const Point& rStart, const Point& rEnd ); 361 362 virtual void Move( long nHorzMove, long nVertMove ); 363 virtual void Scale( double fScaleX, double fScaleY ); 364 365 const Rectangle& GetRect() const { return maRect; } 366 const Point& GetStartPoint() const { return maStartPt; } 367 const Point& GetEndPoint() const { return maEndPt; } 368 }; 369 370 // ----------------- 371 // - MetaPieAction - 372 // ----------------- 373 374 class VCL_DLLPUBLIC MetaPieAction : public MetaAction 375 { 376 private: 377 378 Rectangle maRect; 379 Point maStartPt; 380 Point maEndPt; 381 382 virtual sal_Bool Compare( const MetaAction& ) const; 383 384 public: 385 DECL_META_ACTION( Pie, META_PIE_ACTION ) 386 387 MetaPieAction( const Rectangle& rRect, 388 const Point& rStart, const Point& rEnd ); 389 390 virtual void Move( long nHorzMove, long nVertMove ); 391 virtual void Scale( double fScaleX, double fScaleY ); 392 393 const Rectangle& GetRect() const { return maRect; } 394 const Point& GetStartPoint() const { return maStartPt; } 395 const Point& GetEndPoint() const { return maEndPt; } 396 }; 397 398 // ------------------- 399 // - MetaChordAction - 400 // ------------------- 401 402 class VCL_DLLPUBLIC MetaChordAction : public MetaAction 403 { 404 private: 405 406 Rectangle maRect; 407 Point maStartPt; 408 Point maEndPt; 409 410 virtual sal_Bool Compare( const MetaAction& ) const; 411 412 public: 413 DECL_META_ACTION( Chord, META_CHORD_ACTION ) 414 415 MetaChordAction( const Rectangle& rRect, 416 const Point& rStart, const Point& rEnd ); 417 418 virtual void Move( long nHorzMove, long nVertMove ); 419 virtual void Scale( double fScaleX, double fScaleY ); 420 421 const Rectangle& GetRect() const { return maRect; } 422 const Point& GetStartPoint() const { return maStartPt; } 423 const Point& GetEndPoint() const { return maEndPt; } 424 }; 425 426 // ---------------------- 427 // - MetaPolyLineAction - 428 // ---------------------- 429 430 class VCL_DLLPUBLIC MetaPolyLineAction : public MetaAction 431 { 432 private: 433 434 LineInfo maLineInfo; 435 Polygon maPoly; 436 437 virtual sal_Bool Compare( const MetaAction& ) const; 438 439 public: 440 DECL_META_ACTION( PolyLine, META_POLYLINE_ACTION ) 441 442 MetaPolyLineAction( const Polygon& rPoly ); 443 MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo ); 444 445 virtual void Move( long nHorzMove, long nVertMove ); 446 virtual void Scale( double fScaleX, double fScaleY ); 447 448 const Polygon& GetPolygon() const { return maPoly; } 449 const LineInfo& GetLineInfo() const { return maLineInfo; } 450 }; 451 452 // --------------------- 453 // - MetaPolygonAction - 454 // --------------------- 455 456 class VCL_DLLPUBLIC MetaPolygonAction : public MetaAction 457 { 458 private: 459 460 Polygon maPoly; 461 462 virtual sal_Bool Compare( const MetaAction& ) const; 463 464 public: 465 DECL_META_ACTION( Polygon, META_POLYGON_ACTION ) 466 467 MetaPolygonAction( const Polygon& rPoly ); 468 469 virtual void Move( long nHorzMove, long nVertMove ); 470 virtual void Scale( double fScaleX, double fScaleY ); 471 472 const Polygon& GetPolygon() const { return maPoly; } 473 }; 474 475 // ------------------------- 476 // - MetaPolyPolygonAction - 477 // ------------------------- 478 479 class VCL_DLLPUBLIC MetaPolyPolygonAction : public MetaAction 480 { 481 private: 482 483 PolyPolygon maPolyPoly; 484 485 virtual sal_Bool Compare( const MetaAction& ) const; 486 487 public: 488 DECL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION ) 489 490 MetaPolyPolygonAction( const PolyPolygon& rPolyPoly ); 491 492 virtual void Move( long nHorzMove, long nVertMove ); 493 virtual void Scale( double fScaleX, double fScaleY ); 494 495 const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } 496 }; 497 498 // ------------------ 499 // - MetaTextAction - 500 // ------------------ 501 502 class VCL_DLLPUBLIC MetaTextAction : public MetaAction 503 { 504 private: 505 506 Point maPt; 507 XubString maStr; 508 sal_uInt16 mnIndex; 509 sal_uInt16 mnLen; 510 511 virtual sal_Bool Compare( const MetaAction& ) const; 512 513 public: 514 DECL_META_ACTION( Text, META_TEXT_ACTION ) 515 516 MetaTextAction( const Point& rPt, const XubString& rStr, 517 sal_uInt16 nIndex, sal_uInt16 nLen ); 518 519 virtual void Move( long nHorzMove, long nVertMove ); 520 virtual void Scale( double fScaleX, double fScaleY ); 521 522 const Point& GetPoint() const { return maPt; } 523 const XubString& GetText() const { return maStr; } 524 sal_uInt16 GetIndex() const { return mnIndex; } 525 sal_uInt16 GetLen() const { return mnLen; } 526 }; 527 528 // ----------------------- 529 // - MetaTextArrayAction - 530 // ----------------------- 531 532 class VCL_DLLPUBLIC MetaTextArrayAction : public MetaAction 533 { 534 private: 535 536 Point maStartPt; 537 XubString maStr; 538 sal_Int32* mpDXAry; 539 sal_uInt16 mnIndex; 540 sal_uInt16 mnLen; 541 542 virtual sal_Bool Compare( const MetaAction& ) const; 543 544 protected: 545 virtual ~MetaTextArrayAction(); 546 547 public: 548 MetaTextArrayAction(); 549 MetaTextArrayAction( const MetaTextArrayAction& rAction ); 550 MetaTextArrayAction( const Point& rStartPt, 551 const XubString& rStr, 552 const sal_Int32* pDXAry, 553 sal_uInt16 nIndex, 554 sal_uInt16 nLen ); 555 556 virtual void Execute( OutputDevice* pOut ); 557 558 virtual MetaAction* Clone(); 559 560 virtual void Move( long nHorzMove, long nVertMove ); 561 virtual void Scale( double fScaleX, double fScaleY ); 562 563 virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); 564 virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); 565 566 const Point& GetPoint() const { return maStartPt; } 567 const XubString& GetText() const { return maStr; } 568 sal_uInt16 GetIndex() const { return mnIndex; } 569 sal_uInt16 GetLen() const { return mnLen; } 570 sal_Int32* GetDXArray() const { return mpDXAry; } 571 }; 572 573 // ------------------------- 574 // - MetaStretchTextAction - 575 // ------------------------- 576 577 class VCL_DLLPUBLIC MetaStretchTextAction : public MetaAction 578 { 579 private: 580 581 Point maPt; 582 XubString maStr; 583 sal_uInt32 mnWidth; 584 sal_uInt16 mnIndex; 585 sal_uInt16 mnLen; 586 587 virtual sal_Bool Compare( const MetaAction& ) const; 588 589 public: 590 DECL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION ) 591 592 MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth, 593 const XubString& rStr, 594 sal_uInt16 nIndex, sal_uInt16 nLen ); 595 596 virtual void Move( long nHorzMove, long nVertMove ); 597 virtual void Scale( double fScaleX, double fScaleY ); 598 599 const Point& GetPoint() const { return maPt; } 600 const XubString& GetText() const { return maStr; } 601 sal_uInt32 GetWidth() const { return mnWidth; } 602 sal_uInt16 GetIndex() const { return mnIndex; } 603 sal_uInt16 GetLen() const { return mnLen; } 604 }; 605 606 // ---------------------- 607 // - MetaTextRectAction - 608 // ---------------------- 609 610 class VCL_DLLPUBLIC MetaTextRectAction : public MetaAction 611 { 612 private: 613 614 Rectangle maRect; 615 XubString maStr; 616 sal_uInt16 mnStyle; 617 618 virtual sal_Bool Compare( const MetaAction& ) const; 619 620 public: 621 DECL_META_ACTION( TextRect, META_TEXTRECT_ACTION ) 622 623 MetaTextRectAction( const Rectangle& rRect, 624 const XubString& rStr, sal_uInt16 nStyle ); 625 626 virtual void Move( long nHorzMove, long nVertMove ); 627 virtual void Scale( double fScaleX, double fScaleY ); 628 629 const Rectangle& GetRect() const { return maRect; } 630 const XubString& GetText() const { return maStr; } 631 sal_uInt16 GetStyle() const { return mnStyle; } 632 }; 633 634 // ---------------------- 635 // - MetaTextLineAction - 636 // ---------------------- 637 638 class VCL_DLLPUBLIC MetaTextLineAction : public MetaAction 639 { 640 private: 641 642 Point maPos; 643 long mnWidth; 644 FontStrikeout meStrikeout; 645 FontUnderline meUnderline; 646 FontUnderline meOverline; 647 648 virtual sal_Bool Compare( const MetaAction& ) const; 649 650 public: 651 DECL_META_ACTION( TextLine, META_TEXTLINE_ACTION ) 652 653 MetaTextLineAction( const Point& rPos, long nWidth, 654 FontStrikeout eStrikeout, 655 FontUnderline eUnderline, 656 FontUnderline eOverline ); 657 virtual void Move( long nHorzMove, long nVertMove ); 658 virtual void Scale( double fScaleX, double fScaleY ); 659 660 const Point& GetStartPoint() const { return maPos; } 661 long GetWidth() const { return mnWidth; } 662 FontStrikeout GetStrikeout() const { return meStrikeout; } 663 FontUnderline GetUnderline() const { return meUnderline; } 664 FontUnderline GetOverline() const { return meOverline; } 665 }; 666 667 // ----------------- 668 // - MetaBmpAction - 669 // ----------------- 670 671 class VCL_DLLPUBLIC MetaBmpAction : public MetaAction 672 { 673 private: 674 675 Bitmap maBmp; 676 Point maPt; 677 678 virtual sal_Bool Compare( const MetaAction& ) const; 679 680 public: 681 DECL_META_ACTION( Bmp, META_BMP_ACTION ) 682 683 MetaBmpAction( const Point& rPt, const Bitmap& rBmp ); 684 685 virtual void Move( long nHorzMove, long nVertMove ); 686 virtual void Scale( double fScaleX, double fScaleY ); 687 688 const Bitmap& GetBitmap() const { return maBmp; } 689 const Point& GetPoint() const { return maPt; } 690 }; 691 692 // ---------------------- 693 // - MetaBmpScaleAction - 694 // ---------------------- 695 696 class VCL_DLLPUBLIC MetaBmpScaleAction : public MetaAction 697 { 698 private: 699 700 Bitmap maBmp; 701 Point maPt; 702 Size maSz; 703 704 virtual sal_Bool Compare( const MetaAction& ) const; 705 706 public: 707 DECL_META_ACTION( BmpScale, META_BMPSCALE_ACTION ) 708 709 MetaBmpScaleAction( const Point& rPt, const Size& rSz, 710 const Bitmap& rBmp ); 711 712 virtual void Move( long nHorzMove, long nVertMove ); 713 virtual void Scale( double fScaleX, double fScaleY ); 714 715 const Bitmap& GetBitmap() const { return maBmp; } 716 const Point& GetPoint() const { return maPt; } 717 const Size& GetSize() const { return maSz; } 718 }; 719 720 // -------------------------- 721 // - MetaBmpScalePartAction - 722 // -------------------------- 723 724 class VCL_DLLPUBLIC MetaBmpScalePartAction : public MetaAction 725 { 726 private: 727 728 Bitmap maBmp; 729 Point maDstPt; 730 Size maDstSz; 731 Point maSrcPt; 732 Size maSrcSz; 733 734 virtual sal_Bool Compare( const MetaAction& ) const; 735 736 public: 737 DECL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION ) 738 739 MetaBmpScalePartAction( const Point& rDstPt, const Size& rDstSz, 740 const Point& rSrcPt, const Size& rSrcSz, 741 const Bitmap& rBmp ); 742 743 virtual void Move( long nHorzMove, long nVertMove ); 744 virtual void Scale( double fScaleX, double fScaleY ); 745 746 const Bitmap& GetBitmap() const { return maBmp; } 747 const Point& GetDestPoint() const { return maDstPt; } 748 const Size& GetDestSize() const { return maDstSz; } 749 const Point& GetSrcPoint() const { return maSrcPt; } 750 const Size& GetSrcSize() const { return maSrcSz; } 751 }; 752 753 // ----------------- 754 // - MetaBmpExAction - 755 // ----------------- 756 757 class VCL_DLLPUBLIC MetaBmpExAction : public MetaAction 758 { 759 private: 760 761 BitmapEx maBmpEx; 762 Point maPt; 763 764 virtual sal_Bool Compare( const MetaAction& ) const; 765 766 public: 767 DECL_META_ACTION( BmpEx, META_BMPEX_ACTION ) 768 769 MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx ); 770 771 virtual void Move( long nHorzMove, long nVertMove ); 772 virtual void Scale( double fScaleX, double fScaleY ); 773 774 const BitmapEx& GetBitmapEx() const { return maBmpEx; } 775 const Point& GetPoint() const { return maPt; } 776 }; 777 778 // ---------------------- 779 // - MetaBmpExScaleAction - 780 // ---------------------- 781 782 class VCL_DLLPUBLIC MetaBmpExScaleAction : public MetaAction 783 { 784 private: 785 786 BitmapEx maBmpEx; 787 Point maPt; 788 Size maSz; 789 790 virtual sal_Bool Compare( const MetaAction& ) const; 791 792 public: 793 DECL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION ) 794 795 MetaBmpExScaleAction( const Point& rPt, const Size& rSz, 796 const BitmapEx& rBmpEx ) ; 797 798 virtual void Move( long nHorzMove, long nVertMove ); 799 virtual void Scale( double fScaleX, double fScaleY ); 800 801 const BitmapEx& GetBitmapEx() const { return maBmpEx; } 802 const Point& GetPoint() const { return maPt; } 803 const Size& GetSize() const { return maSz; } 804 }; 805 806 // ---------------------------- 807 // - MetaBmpExScalePartAction - 808 // ---------------------------- 809 810 class VCL_DLLPUBLIC MetaBmpExScalePartAction : public MetaAction 811 { 812 private: 813 814 BitmapEx maBmpEx; 815 Point maDstPt; 816 Size maDstSz; 817 Point maSrcPt; 818 Size maSrcSz; 819 820 virtual sal_Bool Compare( const MetaAction& ) const; 821 822 public: 823 DECL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION ) 824 825 MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz, 826 const Point& rSrcPt, const Size& rSrcSz, 827 const BitmapEx& rBmpEx ); 828 829 virtual void Move( long nHorzMove, long nVertMove ); 830 virtual void Scale( double fScaleX, double fScaleY ); 831 832 const BitmapEx& GetBitmapEx() const { return maBmpEx; } 833 const Point& GetDestPoint() const { return maDstPt; } 834 const Size& GetDestSize() const { return maDstSz; } 835 const Point& GetSrcPoint() const { return maSrcPt; } 836 const Size& GetSrcSize() const { return maSrcSz; } 837 }; 838 839 // ------------------ 840 // - MetaMaskAction - 841 // ------------------ 842 843 class VCL_DLLPUBLIC MetaMaskAction : public MetaAction 844 { 845 private: 846 847 Bitmap maBmp; 848 Color maColor; 849 Point maPt; 850 851 virtual sal_Bool Compare( const MetaAction& ) const; 852 853 public: 854 DECL_META_ACTION( Mask, META_MASK_ACTION ) 855 856 MetaMaskAction( const Point& rPt, 857 const Bitmap& rBmp, 858 const Color& rColor ); 859 860 virtual void Move( long nHorzMove, long nVertMove ); 861 virtual void Scale( double fScaleX, double fScaleY ); 862 863 const Bitmap& GetBitmap() const { return maBmp; } 864 const Color& GetColor() const { return maColor; } 865 const Point& GetPoint() const { return maPt; } 866 }; 867 868 // ----------------------- 869 // - MetaMaskScaleAction - 870 // ----------------------- 871 872 class VCL_DLLPUBLIC MetaMaskScaleAction : public MetaAction 873 { 874 private: 875 876 Bitmap maBmp; 877 Color maColor; 878 Point maPt; 879 Size maSz; 880 881 virtual sal_Bool Compare( const MetaAction& ) const; 882 883 public: 884 DECL_META_ACTION( MaskScale, META_MASKSCALE_ACTION ) 885 886 MetaMaskScaleAction( const Point& rPt, const Size& rSz, 887 const Bitmap& rBmp, 888 const Color& rColor ); 889 890 virtual void Move( long nHorzMove, long nVertMove ); 891 virtual void Scale( double fScaleX, double fScaleY ); 892 893 const Bitmap& GetBitmap() const { return maBmp; } 894 const Color& GetColor() const { return maColor; } 895 const Point& GetPoint() const { return maPt; } 896 const Size& GetSize() const { return maSz; } 897 }; 898 899 // --------------------------- 900 // - MetaMaskScalePartAction - 901 // --------------------------- 902 903 class VCL_DLLPUBLIC MetaMaskScalePartAction : public MetaAction 904 { 905 private: 906 907 Bitmap maBmp; 908 Color maColor; 909 Point maDstPt; 910 Size maDstSz; 911 Point maSrcPt; 912 Size maSrcSz; 913 914 virtual sal_Bool Compare( const MetaAction& ) const; 915 916 public: 917 DECL_META_ACTION( MaskScalePart, META_MASKSCALEPART_ACTION ) 918 919 MetaMaskScalePartAction( const Point& rDstPt, const Size& rDstSz, 920 const Point& rSrcPt, const Size& rSrcSz, 921 const Bitmap& rBmp, 922 const Color& rColor ); 923 924 virtual void Move( long nHorzMove, long nVertMove ); 925 virtual void Scale( double fScaleX, double fScaleY ); 926 927 const Bitmap& GetBitmap() const { return maBmp; } 928 const Color& GetColor() const { return maColor; } 929 const Point& GetDestPoint() const { return maDstPt; } 930 const Size& GetDestSize() const { return maDstSz; } 931 const Point& GetSrcPoint() const { return maSrcPt; } 932 const Size& GetSrcSize() const { return maSrcSz; } 933 }; 934 935 // ---------------------- 936 // - MetaGradientAction - 937 // ---------------------- 938 939 class VCL_DLLPUBLIC MetaGradientAction : public MetaAction 940 { 941 private: 942 943 Rectangle maRect; 944 Gradient maGradient; 945 946 virtual sal_Bool Compare( const MetaAction& ) const; 947 948 public: 949 DECL_META_ACTION( Gradient, META_GRADIENT_ACTION ) 950 951 MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient ); 952 953 virtual void Move( long nHorzMove, long nVertMove ); 954 virtual void Scale( double fScaleX, double fScaleY ); 955 956 const Rectangle& GetRect() const { return maRect; } 957 const Gradient& GetGradient() const { return maGradient; } 958 }; 959 960 // ------------------------ 961 // - MetaGradientExAction - 962 // ------------------------ 963 964 class VCL_DLLPUBLIC MetaGradientExAction : public MetaAction 965 { 966 private: 967 968 PolyPolygon maPolyPoly; 969 Gradient maGradient; 970 971 virtual sal_Bool Compare( const MetaAction& ) const; 972 973 public: 974 DECL_META_ACTION( GradientEx, META_GRADIENTEX_ACTION ) 975 976 MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient ); 977 978 virtual void Move( long nHorzMove, long nVertMove ); 979 virtual void Scale( double fScaleX, double fScaleY ); 980 981 const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } 982 const Gradient& GetGradient() const { return maGradient; } 983 }; 984 985 // ------------------- 986 // - MetaHatchAction - 987 // ------------------- 988 989 class VCL_DLLPUBLIC MetaHatchAction : public MetaAction 990 { 991 private: 992 993 PolyPolygon maPolyPoly; 994 Hatch maHatch; 995 996 virtual sal_Bool Compare( const MetaAction& ) const; 997 998 public: 999 DECL_META_ACTION( Hatch, META_HATCH_ACTION ) 1000 1001 MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch ); 1002 1003 virtual void Move( long nHorzMove, long nVertMove ); 1004 virtual void Scale( double fScaleX, double fScaleY ); 1005 1006 const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } 1007 const Hatch& GetHatch() const { return maHatch; } 1008 }; 1009 1010 // ----------------------- 1011 // - MetaWallpaperAction - 1012 // ----------------------- 1013 1014 class VCL_DLLPUBLIC MetaWallpaperAction : public MetaAction 1015 { 1016 private: 1017 1018 Rectangle maRect; 1019 Wallpaper maWallpaper; 1020 1021 virtual sal_Bool Compare( const MetaAction& ) const; 1022 1023 public: 1024 DECL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION ) 1025 1026 MetaWallpaperAction( const Rectangle& rRect, 1027 const Wallpaper& rPaper ); 1028 1029 virtual void Move( long nHorzMove, long nVertMove ); 1030 virtual void Scale( double fScaleX, double fScaleY ); 1031 1032 const Rectangle& GetRect() const { return maRect; } 1033 const Wallpaper& GetWallpaper() const { return maWallpaper; } 1034 }; 1035 1036 // ------------------------ 1037 // - MetaClipRegionAction - 1038 // ------------------------ 1039 1040 class VCL_DLLPUBLIC MetaClipRegionAction : public MetaAction 1041 { 1042 private: 1043 1044 Region maRegion; 1045 sal_Bool mbClip; 1046 1047 virtual sal_Bool Compare( const MetaAction& ) const; 1048 1049 public: 1050 DECL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION ) 1051 1052 MetaClipRegionAction( const Region& rRegion, sal_Bool bClip ); 1053 1054 virtual void Move( long nHorzMove, long nVertMove ); 1055 virtual void Scale( double fScaleX, double fScaleY ); 1056 1057 const Region& GetRegion() const { return maRegion; } 1058 sal_Bool IsClipping() const { return mbClip; } 1059 }; 1060 1061 // --------------------------------- 1062 // - MetaISectRectClipRegionAction - 1063 // --------------------------------- 1064 1065 class VCL_DLLPUBLIC MetaISectRectClipRegionAction : public MetaAction 1066 { 1067 private: 1068 1069 Rectangle maRect; 1070 1071 virtual sal_Bool Compare( const MetaAction& ) const; 1072 1073 public: 1074 DECL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION ) 1075 1076 MetaISectRectClipRegionAction( const Rectangle& rRect ); 1077 1078 virtual void Move( long nHorzMove, long nVertMove ); 1079 virtual void Scale( double fScaleX, double fScaleY ); 1080 1081 const Rectangle& GetRect() const { return maRect; } 1082 }; 1083 1084 // ----------------------------------- 1085 // - MetaISectRegionClipRegionAction - 1086 // ----------------------------------- 1087 1088 class VCL_DLLPUBLIC MetaISectRegionClipRegionAction : public MetaAction 1089 { 1090 private: 1091 1092 Region maRegion; 1093 1094 virtual sal_Bool Compare( const MetaAction& ) const; 1095 1096 public: 1097 DECL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION ) 1098 1099 MetaISectRegionClipRegionAction( const Region& rRegion ); 1100 1101 virtual void Move( long nHorzMove, long nVertMove ); 1102 virtual void Scale( double fScaleX, double fScaleY ); 1103 1104 const Region& GetRegion() const { return maRegion; } 1105 }; 1106 1107 // ---------------------------- 1108 // - MetaMoveClipRegionAction - 1109 // ---------------------------- 1110 1111 class VCL_DLLPUBLIC MetaMoveClipRegionAction : public MetaAction 1112 { 1113 private: 1114 1115 long mnHorzMove; 1116 long mnVertMove; 1117 1118 virtual sal_Bool Compare( const MetaAction& ) const; 1119 1120 public: 1121 DECL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION ) 1122 1123 MetaMoveClipRegionAction( long nHorzMove, long nVertMove ); 1124 1125 virtual void Scale( double fScaleX, double fScaleY ); 1126 1127 long GetHorzMove() const { return mnHorzMove; } 1128 long GetVertMove() const { return mnVertMove; } 1129 }; 1130 1131 // ----------------------- 1132 // - MetaLineColorAction - 1133 // ----------------------- 1134 1135 class VCL_DLLPUBLIC MetaLineColorAction : public MetaAction 1136 { 1137 private: 1138 1139 Color maColor; 1140 sal_Bool mbSet; 1141 1142 virtual sal_Bool Compare( const MetaAction& ) const; 1143 1144 public: 1145 DECL_META_ACTION( LineColor, META_LINECOLOR_ACTION ) 1146 1147 MetaLineColorAction( const Color& rColor, sal_Bool bSet ); 1148 1149 const Color& GetColor() const { return maColor; } 1150 sal_Bool IsSetting() const { return mbSet; } 1151 }; 1152 1153 // ----------------------- 1154 // - MetaFillColorAction - 1155 // ----------------------- 1156 1157 class VCL_DLLPUBLIC MetaFillColorAction : public MetaAction 1158 { 1159 private: 1160 1161 Color maColor; 1162 sal_Bool mbSet; 1163 1164 virtual sal_Bool Compare( const MetaAction& ) const; 1165 1166 public: 1167 DECL_META_ACTION( FillColor, META_FILLCOLOR_ACTION ) 1168 1169 MetaFillColorAction( const Color& rColor, sal_Bool bSet ); 1170 1171 const Color& GetColor() const { return maColor; } 1172 sal_Bool IsSetting() const { return mbSet; } 1173 }; 1174 1175 // ----------------------- 1176 // - MetaTextColorAction - 1177 // ----------------------- 1178 1179 class VCL_DLLPUBLIC MetaTextColorAction : public MetaAction 1180 { 1181 private: 1182 1183 Color maColor; 1184 1185 virtual sal_Bool Compare( const MetaAction& ) const; 1186 1187 public: 1188 DECL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION ) 1189 1190 MetaTextColorAction( const Color& rColor ); 1191 1192 const Color& GetColor() const { return maColor; } 1193 }; 1194 1195 // --------------------------- 1196 // - MetaTextFillColorAction - 1197 // --------------------------- 1198 1199 class VCL_DLLPUBLIC MetaTextFillColorAction : public MetaAction 1200 { 1201 private: 1202 1203 Color maColor; 1204 sal_Bool mbSet; 1205 1206 virtual sal_Bool Compare( const MetaAction& ) const; 1207 1208 public: 1209 DECL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION ) 1210 1211 MetaTextFillColorAction( const Color& rColor, sal_Bool bSet ); 1212 1213 const Color& GetColor() const { return maColor; } 1214 sal_Bool IsSetting() const { return mbSet; } 1215 }; 1216 1217 // --------------------------- 1218 // - MetaTextLineColorAction - 1219 // --------------------------- 1220 1221 class VCL_DLLPUBLIC MetaTextLineColorAction : public MetaAction 1222 { 1223 private: 1224 1225 Color maColor; 1226 sal_Bool mbSet; 1227 1228 virtual sal_Bool Compare( const MetaAction& ) const; 1229 1230 public: 1231 DECL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION ) 1232 1233 MetaTextLineColorAction( const Color& rColor, sal_Bool bSet ); 1234 1235 const Color& GetColor() const { return maColor; } 1236 sal_Bool IsSetting() const { return mbSet; } 1237 }; 1238 1239 // --------------------------- 1240 // - MetaOverlineColorAction - 1241 // --------------------------- 1242 1243 class VCL_DLLPUBLIC MetaOverlineColorAction : public MetaAction 1244 { 1245 private: 1246 1247 Color maColor; 1248 sal_Bool mbSet; 1249 1250 virtual sal_Bool Compare( const MetaAction& ) const; 1251 1252 public: 1253 DECL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION ) 1254 1255 MetaOverlineColorAction( const Color& rColor, sal_Bool bSet ); 1256 1257 const Color& GetColor() const { return maColor; } 1258 sal_Bool IsSetting() const { return mbSet; } 1259 }; 1260 1261 // ----------------------- 1262 // - MetaTextAlignAction - 1263 // ----------------------- 1264 1265 class VCL_DLLPUBLIC MetaTextAlignAction : public MetaAction 1266 { 1267 private: 1268 1269 TextAlign maAlign; 1270 1271 virtual sal_Bool Compare( const MetaAction& ) const; 1272 1273 public: 1274 DECL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION ) 1275 1276 MetaTextAlignAction( TextAlign aAlign ); 1277 1278 TextAlign GetTextAlign() const { return maAlign; } 1279 }; 1280 1281 // --------------------- 1282 // - MetaMapModeAction - 1283 // --------------------- 1284 1285 class VCL_DLLPUBLIC MetaMapModeAction : public MetaAction 1286 { 1287 private: 1288 1289 MapMode maMapMode; 1290 1291 virtual sal_Bool Compare( const MetaAction& ) const; 1292 1293 public: 1294 DECL_META_ACTION( MapMode, META_MAPMODE_ACTION ) 1295 1296 MetaMapModeAction( const MapMode& rMapMode ); 1297 1298 virtual void Scale( double fScaleX, double fScaleY ); 1299 1300 const MapMode& GetMapMode() const { return maMapMode; } 1301 }; 1302 1303 // --------------------- 1304 // - MetaFontAction - 1305 // --------------------- 1306 1307 class VCL_DLLPUBLIC MetaFontAction : public MetaAction 1308 { 1309 private: 1310 1311 Font maFont; 1312 1313 virtual sal_Bool Compare( const MetaAction& ) const; 1314 1315 public: 1316 DECL_META_ACTION( Font, META_FONT_ACTION ) 1317 1318 MetaFontAction( const Font& rFont ); 1319 1320 virtual void Scale( double fScaleX, double fScaleY ); 1321 1322 const Font& GetFont() const { return maFont; } 1323 }; 1324 1325 // ------------------ 1326 // - MetaPushAction - 1327 // ------------------ 1328 1329 class VCL_DLLPUBLIC MetaPushAction : public MetaAction 1330 { 1331 private: 1332 1333 sal_uInt16 mnFlags; 1334 1335 virtual sal_Bool Compare( const MetaAction& ) const; 1336 1337 public: 1338 DECL_META_ACTION( Push, META_PUSH_ACTION ) 1339 1340 MetaPushAction( sal_uInt16 nFlags ); 1341 1342 sal_uInt16 GetFlags() const { return mnFlags; } 1343 }; 1344 1345 // ----------------- 1346 // - MetaPopAction - 1347 // ----------------- 1348 1349 class VCL_DLLPUBLIC MetaPopAction : public MetaAction 1350 { 1351 public: 1352 1353 DECL_META_ACTION( Pop, META_POP_ACTION ) 1354 }; 1355 1356 // ---------------------- 1357 // - MetaRasterOpAction - 1358 // ---------------------- 1359 1360 class VCL_DLLPUBLIC MetaRasterOpAction : public MetaAction 1361 { 1362 private: 1363 1364 RasterOp meRasterOp; 1365 1366 virtual sal_Bool Compare( const MetaAction& ) const; 1367 1368 public: 1369 DECL_META_ACTION( RasterOp, META_RASTEROP_ACTION ) 1370 1371 MetaRasterOpAction( RasterOp eRasterOp ); 1372 1373 RasterOp GetRasterOp() const { return meRasterOp; } 1374 }; 1375 1376 // ------------------------- 1377 // - MetaTransparentAction - 1378 // ------------------------- 1379 1380 class VCL_DLLPUBLIC MetaTransparentAction : public MetaAction 1381 { 1382 private: 1383 1384 PolyPolygon maPolyPoly; 1385 sal_uInt16 mnTransPercent; 1386 1387 virtual sal_Bool Compare( const MetaAction& ) const; 1388 1389 public: 1390 DECL_META_ACTION( Transparent, META_TRANSPARENT_ACTION ) 1391 1392 MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ); 1393 1394 virtual void Move( long nHorzMove, long nVertMove ); 1395 virtual void Scale( double fScaleX, double fScaleY ); 1396 1397 const PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } 1398 sal_uInt16 GetTransparence() const { return mnTransPercent; } 1399 }; 1400 1401 // ------------------------------ 1402 // - MetaFloatTransparentAction - 1403 // ------------------------------ 1404 1405 class VCL_DLLPUBLIC MetaFloatTransparentAction : public MetaAction 1406 { 1407 private: 1408 1409 GDIMetaFile maMtf; 1410 Point maPoint; 1411 Size maSize; 1412 Gradient maGradient; 1413 1414 virtual sal_Bool Compare( const MetaAction& ) const; 1415 1416 public: 1417 DECL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION ) 1418 1419 MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos, 1420 const Size& rSize, const Gradient& rGradient ); 1421 1422 virtual void Move( long nHorzMove, long nVertMove ); 1423 virtual void Scale( double fScaleX, double fScaleY ); 1424 1425 const GDIMetaFile& GetGDIMetaFile() const { return maMtf; } 1426 const Point& GetPoint() const { return maPoint; } 1427 const Size& GetSize() const { return maSize; } 1428 const Gradient& GetGradient() const { return maGradient; } 1429 }; 1430 1431 // --------------------- 1432 // - MetaDrawEPSAction - 1433 // --------------------- 1434 1435 class VCL_DLLPUBLIC MetaEPSAction : public MetaAction 1436 { 1437 private: 1438 1439 GfxLink maGfxLink; 1440 GDIMetaFile maSubst; 1441 Point maPoint; 1442 Size maSize; 1443 1444 virtual sal_Bool Compare( const MetaAction& ) const; 1445 1446 public: 1447 DECL_META_ACTION( EPS, META_EPS_ACTION ) 1448 1449 MetaEPSAction( const Point& rPoint, const Size& rSize, 1450 const GfxLink& rGfxLink, const GDIMetaFile& rSubst ); 1451 1452 virtual void Move( long nHorzMove, long nVertMove ); 1453 virtual void Scale( double fScaleX, double fScaleY ); 1454 1455 const GfxLink& GetLink() const { return maGfxLink; } 1456 const GDIMetaFile& GetSubstitute() const { return maSubst; } 1457 const Point& GetPoint() const { return maPoint; } 1458 const Size& GetSize() const { return maSize; } 1459 }; 1460 1461 // ---------------------- 1462 // - MetaRefPointAction - 1463 // ---------------------- 1464 1465 class VCL_DLLPUBLIC MetaRefPointAction : public MetaAction 1466 { 1467 private: 1468 1469 Point maRefPoint; 1470 sal_Bool mbSet; 1471 1472 virtual sal_Bool Compare( const MetaAction& ) const; 1473 1474 public: 1475 DECL_META_ACTION( RefPoint, META_REFPOINT_ACTION ) 1476 1477 MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet ); 1478 1479 const Point& GetRefPoint() const { return maRefPoint; } 1480 sal_Bool IsSetting() const { return mbSet; } 1481 }; 1482 1483 // --------------------- 1484 // - MetaCommentAction - 1485 // --------------------- 1486 1487 class VCL_DLLPUBLIC MetaCommentAction : public MetaAction 1488 { 1489 private: 1490 1491 ByteString maComment; 1492 sal_Int32 mnValue; 1493 sal_uInt32 mnDataSize; 1494 sal_uInt8* mpData; 1495 1496 SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize ); 1497 virtual sal_Bool Compare( const MetaAction& ) const; 1498 1499 protected: 1500 ~MetaCommentAction(); 1501 1502 public: 1503 MetaCommentAction( sal_Int32 nValue = 0L ); 1504 MetaCommentAction( const MetaCommentAction& rAct ); 1505 MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL ); 1506 MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ); 1507 1508 virtual void Move( long nHorzMove, long nVertMove ); 1509 virtual void Scale( double fScaleX, double fScaleY ); 1510 1511 virtual void Execute( OutputDevice* pOut ); 1512 virtual MetaAction* Clone(); 1513 virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); 1514 virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); 1515 1516 const ByteString& GetComment() const { return maComment; } 1517 sal_Int32 GetValue() const { return mnValue; } 1518 sal_uInt32 GetDataSize() const { return mnDataSize; } 1519 const sal_uInt8* GetData() const { return mpData; } 1520 }; 1521 1522 // ------------------------ 1523 // - MetaLayoutModeAction - 1524 // ------------------------ 1525 1526 class VCL_DLLPUBLIC MetaLayoutModeAction : public MetaAction 1527 { 1528 private: 1529 1530 sal_uInt32 mnLayoutMode; 1531 virtual sal_Bool Compare( const MetaAction& ) const; 1532 1533 public: 1534 DECL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION ) 1535 1536 MetaLayoutModeAction( sal_uInt32 nLayoutMode ); 1537 1538 sal_uInt32 GetLayoutMode() const { return mnLayoutMode; } 1539 }; 1540 1541 // ------------------------ 1542 // - MetaTextLanguageAction - 1543 // ------------------------ 1544 1545 class VCL_DLLPUBLIC MetaTextLanguageAction : public MetaAction 1546 { 1547 private: 1548 1549 LanguageType meTextLanguage; 1550 virtual sal_Bool Compare( const MetaAction& ) const; 1551 1552 public: 1553 DECL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION ) 1554 1555 MetaTextLanguageAction( LanguageType ); 1556 1557 LanguageType GetTextLanguage() const { return meTextLanguage; } 1558 }; 1559 1560 // --------------------------- 1561 // - MetaRenderGraphicAction - 1562 // --------------------------- 1563 1564 class VCL_DLLPUBLIC MetaRenderGraphicAction : public MetaAction 1565 { 1566 private: 1567 1568 ::vcl::RenderGraphic maRenderGraphic; 1569 Point maPoint; 1570 Size maSize; 1571 double mfRotateAngle; 1572 double mfShearAngleX; 1573 double mfShearAngleY; 1574 1575 virtual sal_Bool Compare( const MetaAction& ) const; 1576 1577 public: 1578 DECL_META_ACTION( RenderGraphic, META_RENDERGRAPHIC_ACTION ) 1579 1580 MetaRenderGraphicAction( const Point& rPoint, const Size& rSize, 1581 const vcl::RenderGraphic& rRenderData, 1582 double fRotateAngle = 0.0, 1583 double fShearAngleX = 0.0, 1584 double fShearAngleY = 0.0 ); 1585 1586 virtual void Move( long nHorzMove, long nVertMove ); 1587 virtual void Scale( double fScaleX, double fScaleY ); 1588 1589 const ::vcl::RenderGraphic& GetRenderGraphic() const { return maRenderGraphic; } 1590 const Point& GetPoint() const { return maPoint; } 1591 const Size& GetSize() const { return maSize; } 1592 double GetRotateAngle() const { return mfRotateAngle; } 1593 double GetShearAngleX() const { return mfShearAngleX; } 1594 double GetShearAngleY() const { return mfShearAngleY; } 1595 }; 1596 1597 #endif // _SV_METAACT_HXX 1598