Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfSeparationDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfSeparationDictionary 1 #ifndef __DEFINED__SkPdfSeparationDictionary
2 #define __DEFINED__SkPdfSeparationDictionary 2 #define __DEFINED__SkPdfSeparationDictionary
3 3
4 #include "SkPdfUtils.h" 4 #include "SkPdfUtils.h"
5 #include "SkPdfEnums_autogen.h" 5 #include "SkPdfEnums_autogen.h"
6 #include "SkPdfArray_autogen.h" 6 #include "SkPdfArray_autogen.h"
7 #include "SkPdfDictionary_autogen.h" 7 #include "SkPdfDictionary_autogen.h"
8 8
9 // Entries in a separation dictionary 9 // Entries in a separation dictionary
10 class SkPdfSeparationDictionary : public SkPdfDictionary { 10 class SkPdfSeparationDictionary : public SkPdfDictionary {
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 /** (Required) An array of indirect references to page objects representing sepa ra- 528 /** (Required) An array of indirect references to page objects representing sepa ra-
529 * tions of the same document page. One of the page objects in the array must b e 529 * tions of the same document page. One of the page objects in the array must b e
530 * the one with which this separation dictionary is associated, and all of them must 530 * the one with which this separation dictionary is associated, and all of them must
531 * have separation dictionaries (SeparationInfo entries) containing Pages array s 531 * have separation dictionaries (SeparationInfo entries) containing Pages array s
532 * identical to this one. 532 * identical to this one.
533 **/ 533 **/
534 bool has_Pages() const { 534 bool has_Pages() const {
535 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages ", "", NULL)); 535 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages ", "", NULL));
536 } 536 }
537 537
538 SkPdfArray* Pages() const { 538 SkPdfArray* Pages() const;
539 SkPdfArray* ret;
540 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "" , &ret)) return ret;
541 // TODO(edisonn): warn about missing required field, assert for known good p dfs
542 return NULL;
543 }
544
545 /** (Required) The name of the device colorant to be used in rendering this 539 /** (Required) The name of the device colorant to be used in rendering this
546 * separation, such as Cyan or PANTONE 35 CV. 540 * separation, such as Cyan or PANTONE 35 CV.
547 **/ 541 **/
548 bool has_DeviceColorant() const { 542 bool has_DeviceColorant() const {
549 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Devic eColorant", "", NULL)); 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Devic eColorant", "", NULL));
550 } 544 }
551 545
552 bool isDeviceColorantAName() const { 546 bool isDeviceColorantAName() const {
553 SkPdfObject* ret = NULL; 547 SkPdfObject* ret = NULL;
554 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo lorant", "", &ret)) return false; 548 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo lorant", "", &ret)) return false;
555 return ret->podofo()->GetDataType() == ePdfDataType_Name; 549 return ret->podofo()->GetDataType() == ePdfDataType_Name;
556 } 550 }
557 551
558 std::string getDeviceColorantAsName() const { 552 std::string getDeviceColorantAsName() const;
559 std::string ret = "";
560 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceColor ant", "", &ret)) return ret;
561 // TODO(edisonn): warn about missing required field, assert for known good p dfs
562 return "";
563 }
564
565 bool isDeviceColorantAString() const { 553 bool isDeviceColorantAString() const {
566 SkPdfObject* ret = NULL; 554 SkPdfObject* ret = NULL;
567 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo lorant", "", &ret)) return false; 555 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCo lorant", "", &ret)) return false;
568 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString; 556 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString;
569 } 557 }
570 558
571 std::string getDeviceColorantAsString() const { 559 std::string getDeviceColorantAsString() const;
572 std::string ret = "";
573 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DeviceCol orant", "", &ret)) return ret;
574 // TODO(edisonn): warn about missing required field, assert for known good p dfs
575 return "";
576 }
577
578 /** (Optional) An array defining a Separation or DeviceN color space (see "Separ a- 560 /** (Optional) An array defining a Separation or DeviceN color space (see "Separ a-
579 * tion Color Spaces" on page 201 and "DeviceN Color Spaces" on page 205). This 561 * tion Color Spaces" on page 201 and "DeviceN Color Spaces" on page 205). This
580 * provides additional information about the color specified by DeviceColorant- 562 * provides additional information about the color specified by DeviceColorant-
581 * in particular, the alternate color space and tint transformation function th at 563 * in particular, the alternate color space and tint transformation function th at
582 * would be used to represent the colorant as a process color. This information 564 * would be used to represent the colorant as a process color. This information
583 * enables a viewer application to preview the separation in a color that appro xi- 565 * enables a viewer application to preview the separation in a color that appro xi-
584 * mates the device colorant. 566 * mates the device colorant.
585 * The value of DeviceColorant must match the space's colorant name (if it is a 567 * The value of DeviceColorant must match the space's colorant name (if it is a
586 * Separation space) or be one of the space's colorant names (if it is a Device N 568 * Separation space) or be one of the space's colorant names (if it is a Device N
587 * space). 569 * space).
588 **/ 570 **/
589 bool has_ColorSpace() const { 571 bool has_ColorSpace() const {
590 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Color Space", "", NULL)); 572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Color Space", "", NULL));
591 } 573 }
592 574
593 SkPdfArray* ColorSpace() const { 575 SkPdfArray* ColorSpace() const;
594 SkPdfArray* ret;
595 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ColorSpace ", "", &ret)) return ret;
596 // TODO(edisonn): warn about missing required field, assert for known good p dfs
597 return NULL;
598 }
599
600 }; 576 };
601 577
602 #endif // __DEFINED__SkPdfSeparationDictionary 578 #endif // __DEFINED__SkPdfSeparationDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698