| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfReferenceDictionary | 1 #ifndef __DEFINED__SkPdfReferenceDictionary |
| 2 #define __DEFINED__SkPdfReferenceDictionary | 2 #define __DEFINED__SkPdfReferenceDictionary |
| 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 reference dictionary | 9 // Entries in a reference dictionary |
| 10 class SkPdfReferenceDictionary : public SkPdfDictionary { | 10 class SkPdfReferenceDictionary : public SkPdfDictionary { |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 virtual bool valid() const {return true;} | 524 virtual bool valid() const {return true;} |
| 525 | 525 |
| 526 SkPdfReferenceDictionary& operator=(const SkPdfReferenceDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} | 526 SkPdfReferenceDictionary& operator=(const SkPdfReferenceDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} |
| 527 | 527 |
| 528 /** (Required) The file containing the target document. | 528 /** (Required) The file containing the target document. |
| 529 **/ | 529 **/ |
| 530 bool has_F() const { | 530 bool has_F() const { |
| 531 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); | 531 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
| 532 } | 532 } |
| 533 | 533 |
| 534 SkPdfFileSpec F() const { | 534 SkPdfFileSpec F() const; |
| 535 SkPdfFileSpec ret; | |
| 536 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; | |
| 537 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 538 return SkPdfFileSpec(); | |
| 539 } | |
| 540 | |
| 541 /** (Required) A page index or page label (see Section 8.3.1, "Page Labels") | 535 /** (Required) A page index or page label (see Section 8.3.1, "Page Labels") |
| 542 * identifying the page of the target document containing the content to be | 536 * identifying the page of the target document containing the content to be |
| 543 * imported. Note that the reference is a weak one and can be inadvertently in- | 537 * imported. Note that the reference is a weak one and can be inadvertently in- |
| 544 * validated if the referenced page is changed or replaced in the target docume
nt | 538 * validated if the referenced page is changed or replaced in the target docume
nt |
| 545 * after the reference is created. | 539 * after the reference is created. |
| 546 **/ | 540 **/ |
| 547 bool has_Page() const { | 541 bool has_Page() const { |
| 548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page"
, "", NULL)); | 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page"
, "", NULL)); |
| 549 } | 543 } |
| 550 | 544 |
| 551 bool isPageAInteger() const { | 545 bool isPageAInteger() const { |
| 552 SkPdfObject* ret = NULL; | 546 SkPdfObject* ret = NULL; |
| 553 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", "
", &ret)) return false; | 547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", "
", &ret)) return false; |
| 554 return ret->podofo()->GetDataType() == ePdfDataType_Number; | 548 return ret->podofo()->GetDataType() == ePdfDataType_Number; |
| 555 } | 549 } |
| 556 | 550 |
| 557 long getPageAsInteger() const { | 551 long getPageAsInteger() const; |
| 558 long ret = 0; | |
| 559 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", "",
&ret)) return ret; | |
| 560 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 561 return 0; | |
| 562 } | |
| 563 | |
| 564 bool isPageAString() const { | 552 bool isPageAString() const { |
| 565 SkPdfObject* ret = NULL; | 553 SkPdfObject* ret = NULL; |
| 566 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", "
", &ret)) return false; | 554 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", "
", &ret)) return false; |
| 567 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 555 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
| 568 } | 556 } |
| 569 | 557 |
| 570 std::string getPageAsString() const { | 558 std::string getPageAsString() const; |
| 571 std::string ret = ""; | |
| 572 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Page", ""
, &ret)) return ret; | |
| 573 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 574 return ""; | |
| 575 } | |
| 576 | |
| 577 /** (Optional) An array of two strings constituting a file identifier (see Secti
on 9.3, | 559 /** (Optional) An array of two strings constituting a file identifier (see Secti
on 9.3, |
| 578 * "File Identifiers") for the file containing the target document. The use of
this | 560 * "File Identifiers") for the file containing the target document. The use of
this |
| 579 * entry improves a viewer application's chances of finding the intended file a
nd | 561 * entry improves a viewer application's chances of finding the intended file a
nd |
| 580 * allows it to warn the user if the file has changed since the reference was c
reated. | 562 * allows it to warn the user if the file has changed since the reference was c
reated. |
| 581 **/ | 563 **/ |
| 582 bool has_ID() const { | 564 bool has_ID() const { |
| 583 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); | 565 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); |
| 584 } | 566 } |
| 585 | 567 |
| 586 SkPdfArray* ID() const { | 568 SkPdfArray* ID() const; |
| 587 SkPdfArray* ret; | |
| 588 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &
ret)) return ret; | |
| 589 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 590 return NULL; | |
| 591 } | |
| 592 | |
| 593 }; | 569 }; |
| 594 | 570 |
| 595 #endif // __DEFINED__SkPdfReferenceDictionary | 571 #endif // __DEFINED__SkPdfReferenceDictionary |
| OLD | NEW |