OLD | NEW |
1 #ifndef __DEFINED__SkPdfType5HalftoneDictionary | 1 #ifndef __DEFINED__SkPdfType5HalftoneDictionary |
2 #define __DEFINED__SkPdfType5HalftoneDictionary | 2 #define __DEFINED__SkPdfType5HalftoneDictionary |
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 type 5 halftone dictionary | 9 // Entries in a type 5 halftone dictionary |
10 class SkPdfType5HalftoneDictionary : public SkPdfDictionary { | 10 class SkPdfType5HalftoneDictionary : public SkPdfDictionary { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 SkPdfType5HalftoneDictionary& operator=(const SkPdfType5HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} | 526 SkPdfType5HalftoneDictionary& operator=(const SkPdfType5HalftoneDictionary& fr
om) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; ret
urn *this;} |
527 | 527 |
528 /** (Optional) The type of PDF object that this dictionary describes; if present
, | 528 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
529 * must be Halftone for a halftone dictionary. | 529 * must be Halftone for a halftone dictionary. |
530 **/ | 530 **/ |
531 bool has_Type() const { | 531 bool has_Type() const { |
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
533 } | 533 } |
534 | 534 |
535 std::string Type() const { | 535 std::string Type() const; |
536 std::string ret; | |
537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | |
538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
539 return ""; | |
540 } | |
541 | |
542 /** (Required) A code identifying the halftone type that this dictionary describ
es; | 536 /** (Required) A code identifying the halftone type that this dictionary describ
es; |
543 * must be 5 for this type of halftone. | 537 * must be 5 for this type of halftone. |
544 **/ | 538 **/ |
545 bool has_HalftoneType() const { | 539 bool has_HalftoneType() const { |
546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneType", "", NULL)); | 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneType", "", NULL)); |
547 } | 541 } |
548 | 542 |
549 double HalftoneType() const { | 543 double HalftoneType() const; |
550 double ret; | |
551 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneT
ype", "", &ret)) return ret; | |
552 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
553 return 0; | |
554 } | |
555 | |
556 /** (Optional) The name of the halftone dictionary. | 544 /** (Optional) The name of the halftone dictionary. |
557 **/ | 545 **/ |
558 bool has_HalftoneName() const { | 546 bool has_HalftoneName() const { |
559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneName", "", NULL)); | 547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Halft
oneName", "", NULL)); |
560 } | 548 } |
561 | 549 |
562 std::string HalftoneName() const { | 550 std::string HalftoneName() const; |
563 std::string ret; | |
564 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HalftoneN
ame", "", &ret)) return ret; | |
565 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
566 return ""; | |
567 } | |
568 | |
569 /** (Required, one per colorant) The halftone corresponding to the colorant or | 551 /** (Required, one per colorant) The halftone corresponding to the colorant or |
570 * color component named by the key. The halftone may be of any type other | 552 * color component named by the key. The halftone may be of any type other |
571 * than 5. Note that the key must be a name object; strings are not permitted,
as | 553 * than 5. Note that the key must be a name object; strings are not permitted,
as |
572 * they are in type 5 PostScript halftone dictionaries. | 554 * they are in type 5 PostScript halftone dictionaries. |
573 **/ | 555 **/ |
574 /* | 556 /* |
575 bool has_[any_colorant_name]() const { | 557 bool has_[any_colorant_name]() const { |
576 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", NULL)); | 558 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", NULL)); |
577 } | 559 } |
578 | 560 |
579 bool is[any_colorant_name]ADictionary() const { | 561 bool is[any_colorant_name]ADictionary() const { |
580 SkPdfObject* ret = NULL; | 562 SkPdfObject* ret = NULL; |
581 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; | 563 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; |
582 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 564 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
583 } | 565 } |
584 | 566 |
585 SkPdfDictionary* get[any_colorant_name]AsDictionary() const { | 567 SkPdfDictionary* get[any_colorant_name]AsDictionary() const; |
586 SkPdfDictionary* ret = NULL; | |
587 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_
colorant_name]", "", &ret)) return ret; | |
588 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
589 return NULL; | |
590 } | |
591 | |
592 bool is[any_colorant_name]AStream() const { | 568 bool is[any_colorant_name]AStream() const { |
593 SkPdfObject* ret = NULL; | 569 SkPdfObject* ret = NULL; |
594 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; | 570 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_col
orant_name]", "", &ret)) return false; |
595 return ret->podofo()->HasStream(); | 571 return ret->podofo()->HasStream(); |
596 } | 572 } |
597 | 573 |
598 SkPdfStream* get[any_colorant_name]AsStream() const { | 574 SkPdfStream* get[any_colorant_name]AsStream() const; |
599 SkPdfStream* ret = NULL; | |
600 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "[any_colo
rant_name]", "", &ret)) return ret; | |
601 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
602 return NULL; | |
603 } | |
604 | |
605 */ | 575 */ |
606 /** (Required) A halftone to be used for any colorant or color component that | 576 /** (Required) A halftone to be used for any colorant or color component that |
607 * does not have an entry of its own. The value may not be a type 5 halftone. I
f | 577 * does not have an entry of its own. The value may not be a type 5 halftone. I
f |
608 * there are any nonprimary colorants, the default halftone must have a transfe
r | 578 * there are any nonprimary colorants, the default halftone must have a transfe
r |
609 * function. | 579 * function. |
610 **/ | 580 **/ |
611 bool has_Default() const { | 581 bool has_Default() const { |
612 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", NULL)); | 582 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", NULL)); |
613 } | 583 } |
614 | 584 |
615 bool isDefaultADictionary() const { | 585 bool isDefaultADictionary() const { |
616 SkPdfObject* ret = NULL; | 586 SkPdfObject* ret = NULL; |
617 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; | 587 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; |
618 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 588 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
619 } | 589 } |
620 | 590 |
621 SkPdfDictionary* getDefaultAsDictionary() const { | 591 SkPdfDictionary* getDefaultAsDictionary() const; |
622 SkPdfDictionary* ret = NULL; | |
623 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Defau
lt", "", &ret)) return ret; | |
624 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
625 return NULL; | |
626 } | |
627 | |
628 bool isDefaultAStream() const { | 592 bool isDefaultAStream() const { |
629 SkPdfObject* ret = NULL; | 593 SkPdfObject* ret = NULL; |
630 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; | 594 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default"
, "", &ret)) return false; |
631 return ret->podofo()->HasStream(); | 595 return ret->podofo()->HasStream(); |
632 } | 596 } |
633 | 597 |
634 SkPdfStream* getDefaultAsStream() const { | 598 SkPdfStream* getDefaultAsStream() const; |
635 SkPdfStream* ret = NULL; | |
636 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Default",
"", &ret)) return ret; | |
637 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
638 return NULL; | |
639 } | |
640 | |
641 }; | 599 }; |
642 | 600 |
643 #endif // __DEFINED__SkPdfType5HalftoneDictionary | 601 #endif // __DEFINED__SkPdfType5HalftoneDictionary |
OLD | NEW |